Cargo.toml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. [package]
  2. name = "dragonos_kernel"
  3. version = "0.2.0"
  4. edition = "2021"
  5. # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
  6. [lib]
  7. crate-type = ["staticlib"]
  8. [workspace]
  9. members = ["crates/*"]
  10. [features]
  11. default = ["fatfs", "kvm", "fatfs-secure", "static_keys_test"]
  12. # kvm
  13. kvm = []
  14. fatfs = []
  15. fatfs-secure = ["fatfs"]
  16. driver_ps2_mouse = []
  17. # kprobe
  18. kprobe_test = []
  19. static_keys_test = []
  20. # kstack_protect 开启该功能后,会开启内核栈保护功能。用于辅助检测栈溢出。(内核栈占用会*2)
  21. kstack_protect = []
  22. # 运行时依赖项
  23. [dependencies]
  24. acpi = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/acpi-rs.git", rev = "282df2af7b" }
  25. asm_macros = { path = "crates/asm_macros" }
  26. atomic_enum = "=0.2.0"
  27. bit_field = "=0.10"
  28. bitfield-struct = "=0.5.3"
  29. bitflags = "=1.3.2"
  30. bitmap = { path = "crates/bitmap" }
  31. driver_base_macros = { "path" = "crates/driver_base_macros" }
  32. elf = { version = "=0.7.2", default-features = false }
  33. fdt = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/fdt", rev = "9862813020" }
  34. # 一个no_std的hashmap、hashset
  35. hashbrown = "=0.13.2"
  36. ida = { path = "crates/ida" }
  37. intertrait = { path = "crates/intertrait" }
  38. kcmdline_macros = { path = "crates/kcmdline_macros" }
  39. kdepends = { path = "crates/kdepends" }
  40. klog_types = { path = "crates/klog_types" }
  41. linkme = "=0.3.27"
  42. num = { version = "=0.4.0", default-features = false }
  43. num-derive = "=0.3"
  44. num-traits = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/num-traits.git", rev = "1597c1c", default-features = false }
  45. smoltcp = { version = "=0.11.0", default-features = false, features = [
  46. "alloc",
  47. "socket-raw",
  48. "socket-udp",
  49. "socket-tcp",
  50. "socket-icmp",
  51. "socket-dhcpv4",
  52. "socket-dns",
  53. "proto-ipv4",
  54. "proto-ipv6",
  55. ] }
  56. syscall_table_macros = { path = "crates/syscall_table_macros" }
  57. system_error = { path = "crates/system_error" }
  58. unified-init = { path = "crates/unified-init" }
  59. virtio-drivers = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/virtio-drivers", rev = "415ab38ff9" }
  60. wait_queue_macros = { path = "crates/wait_queue_macros" }
  61. paste = "=1.0.14"
  62. slabmalloc = { path = "crates/rust-slabmalloc" }
  63. log = "0.4.21"
  64. kprobe = { path = "crates/kprobe" }
  65. lru = "0.12.3"
  66. rbpf = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/rbpf", rev = "f31e471a29", default-features = false }
  67. printf-compat = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/printf-compat", rev = "626801cb5f", default-features = false }
  68. static-keys = { version = "=0.7" }
  69. defer = "0.2.1"
  70. cfg-if = { version = "1.0.0" }
  71. derive_builder = { version = "0.20.2", default-features = false, features = [
  72. "alloc",
  73. ] }
  74. # target为x86_64时,使用下面的依赖
  75. [target.'cfg(target_arch = "x86_64")'.dependencies]
  76. multiboot2 = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/multiboot2", rev = "05739aab40" }
  77. raw-cpuid = "11.0.1"
  78. x86 = "=0.52.0"
  79. x86_64 = "=0.15.2"
  80. uefi = { version = "=0.26.0", features = ["alloc"] }
  81. uefi-raw = "=0.5.0"
  82. # target为riscv64时,使用下面的依赖
  83. [target.'cfg(target_arch = "riscv64")'.dependencies]
  84. riscv = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/riscv.git", rev = "4241a97", features = [
  85. "s-mode",
  86. ] }
  87. sbi-rt = { version = "=0.0.3", features = ["legacy"] }
  88. uefi = { version = "=0.26.0", features = ["alloc"] }
  89. uefi-raw = "=0.5.0"
  90. # target为loongarch64时,使用下面的依赖
  91. [target.'cfg(target_arch = "loongarch64")'.dependencies]
  92. loongArch64 = "=0.2.5"
  93. # 由于unwinding库不支持loongarch64架构,因此需要排除该依赖项
  94. [target.'cfg(not(target_arch = "loongarch64"))'.dependencies]
  95. unwinding = { version = "=0.2.8", default-features = false, features = [
  96. "unwinder",
  97. "fde-gnu-eh-frame-hdr",
  98. "panic",
  99. "personality",
  100. ] }
  101. # 构建时依赖项
  102. [build-dependencies]
  103. kernel_build = { path = "../build-scripts/kernel_build" }
  104. [dependencies.lazy_static]
  105. version = "=1.4.0"
  106. # 由于在no_std环境,而lazy_static依赖了spin库,因此需要指定其使用no_std
  107. features = ["spin_no_std"]
  108. # The development profile, used for `cargo build`
  109. [profile.dev]
  110. # opt-level = 0 # Controls the --opt-level the compiler builds with
  111. debug = true # Controls whether the compiler passes `-g`
  112. # The release profile, used for `cargo build --release`
  113. [profile.release]
  114. debug = false