Cargo.toml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  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.12.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. "medium-ip",
  56. ] }
  57. syscall_table_macros = { path = "crates/syscall_table_macros" }
  58. system_error = { path = "crates/system_error" }
  59. unified-init = { path = "crates/unified-init" }
  60. virtio-drivers = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/virtio-drivers", rev = "415ab38ff9" }
  61. wait_queue_macros = { path = "crates/wait_queue_macros" }
  62. paste = "=1.0.14"
  63. slabmalloc = { path = "crates/rust-slabmalloc" }
  64. log = "0.4.21"
  65. kprobe = { path = "crates/kprobe" }
  66. lru = "0.12.3"
  67. rbpf = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/rbpf", rev = "f31e471a29", default-features = false }
  68. printf-compat = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/printf-compat", rev = "626801cb5f", default-features = false }
  69. static-keys = { version = "=0.7" }
  70. defer = "0.2.1"
  71. cfg-if = { version = "1.0.0" }
  72. derive_builder = { version = "0.20.2", default-features = false, features = [
  73. "alloc",
  74. ] }
  75. inherit-methods-macro = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/inherit-methods-macro", rev = "98f7e3e" }
  76. # target为x86_64时,使用下面的依赖
  77. [target.'cfg(target_arch = "x86_64")'.dependencies]
  78. multiboot2 = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/multiboot2", rev = "05739aab40" }
  79. raw-cpuid = "11.0.1"
  80. x86 = "=0.52.0"
  81. x86_64 = "=0.15.2"
  82. uefi = { version = "=0.26.0", features = ["alloc"] }
  83. uefi-raw = "=0.5.0"
  84. # target为riscv64时,使用下面的依赖
  85. [target.'cfg(target_arch = "riscv64")'.dependencies]
  86. riscv = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/riscv.git", rev = "4241a97", features = [
  87. "s-mode",
  88. ] }
  89. byte-slice-cast = { version = "1.2.2", default-features = false }
  90. sbi-rt = { version = "=0.0.3", features = ["legacy"] }
  91. uefi = { version = "=0.26.0", features = ["alloc"] }
  92. uefi-raw = "=0.5.0"
  93. # target为loongarch64时,使用下面的依赖
  94. [target.'cfg(target_arch = "loongarch64")'.dependencies]
  95. loongArch64 = "=0.2.5"
  96. # 由于unwinding库不支持loongarch64架构,因此需要排除该依赖项
  97. [target.'cfg(not(target_arch = "loongarch64"))'.dependencies]
  98. unwinding = { version = "=0.2.8", default-features = false, features = [
  99. "unwinder",
  100. "fde-gnu-eh-frame-hdr",
  101. "panic",
  102. "personality",
  103. ] }
  104. # 构建时依赖项
  105. [build-dependencies]
  106. kernel_build = { path = "../build-scripts/kernel_build" }
  107. [dependencies.lazy_static]
  108. version = "=1.4.0"
  109. # 由于在no_std环境,而lazy_static依赖了spin库,因此需要指定其使用no_std
  110. features = ["spin_no_std"]
  111. # The development profile, used for `cargo build`
  112. [profile.dev]
  113. # opt-level = 0 # Controls the --opt-level the compiler builds with
  114. debug = true # Controls whether the compiler passes `-g`
  115. # The release profile, used for `cargo build --release`
  116. [profile.release]
  117. debug = false
  118. # debug = true