Cargo.toml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. # initram
  23. initram = []
  24. # 运行时依赖项
  25. [dependencies]
  26. acpi = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/acpi-rs.git", rev = "282df2af7b" }
  27. asm_macros = { path = "crates/asm_macros" }
  28. atomic_enum = "=0.2.0"
  29. bit_field = "=0.10"
  30. bitfield-struct = "=0.5.3"
  31. bitflags = "=1.3.2"
  32. bitmap = { path = "crates/bitmap" }
  33. driver_base_macros = { "path" = "crates/driver_base_macros" }
  34. elf = { version = "=0.7.2", default-features = false }
  35. fdt = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/fdt", rev = "9862813020" }
  36. # 一个no_std的hashmap、hashset
  37. hashbrown = "=0.13.2"
  38. ida = { path = "crates/ida" }
  39. intertrait = { path = "crates/intertrait" }
  40. kcmdline_macros = { path = "crates/kcmdline_macros" }
  41. kdepends = { path = "crates/kdepends" }
  42. klog_types = { path = "crates/klog_types" }
  43. linkme = "=0.3.27"
  44. num = { version = "=0.4.0", default-features = false }
  45. num-derive = "=0.3"
  46. num-traits = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/num-traits.git", rev = "1597c1c", default-features = false }
  47. smoltcp = { version = "=0.12.0", default-features = false, features = [
  48. "alloc",
  49. "socket-raw",
  50. "socket-udp",
  51. "socket-tcp",
  52. "socket-icmp",
  53. "socket-dhcpv4",
  54. "socket-dns",
  55. "proto-ipv4",
  56. "proto-ipv6",
  57. "medium-ip",
  58. ] }
  59. syscall_table_macros = { path = "crates/syscall_table_macros" }
  60. system_error = { path = "crates/system_error" }
  61. unified-init = { path = "crates/unified-init" }
  62. virtio-drivers = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/virtio-drivers", rev = "415ab38ff9" }
  63. wait_queue_macros = { path = "crates/wait_queue_macros" }
  64. paste = "=1.0.14"
  65. slabmalloc = { path = "crates/rust-slabmalloc" }
  66. log = "0.4.21"
  67. kprobe = { path = "crates/kprobe" }
  68. lru = "0.12.3"
  69. rbpf = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/rbpf", rev = "f31e471a29", default-features = false }
  70. printf-compat = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/printf-compat", rev = "626801cb5f", default-features = false }
  71. static-keys = { version = "=0.7" }
  72. cpio_reader = "0.1.2"
  73. xz4rust = { version = "0.2.1", default-features = false, features = ["alloc"] }
  74. defer = "0.2.1"
  75. cfg-if = { version = "1.0.0" }
  76. derive_builder = { version = "0.20.2", default-features = false, features = [
  77. "alloc",
  78. ] }
  79. inherit-methods-macro = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/inherit-methods-macro", rev = "98f7e3e" }
  80. # target为x86_64时,使用下面的依赖
  81. [target.'cfg(target_arch = "x86_64")'.dependencies]
  82. multiboot2 = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/multiboot2", rev = "05739aab40" }
  83. raw-cpuid = "11.0.1"
  84. x86 = "=0.52.0"
  85. x86_64 = "=0.15.2"
  86. uefi = { version = "=0.26.0", features = ["alloc"] }
  87. uefi-raw = "=0.5.0"
  88. # target为riscv64时,使用下面的依赖
  89. [target.'cfg(target_arch = "riscv64")'.dependencies]
  90. riscv = { git = "https://git.mirrors.dragonos.org.cn/DragonOS-Community/riscv.git", rev = "4241a97", features = [
  91. "s-mode",
  92. ] }
  93. byte-slice-cast = { version = "1.2.2", default-features = false }
  94. sbi-rt = { version = "=0.0.3", features = ["legacy"] }
  95. uefi = { version = "=0.26.0", features = ["alloc"] }
  96. uefi-raw = "=0.5.0"
  97. # target为loongarch64时,使用下面的依赖
  98. [target.'cfg(target_arch = "loongarch64")'.dependencies]
  99. loongArch64 = "=0.2.5"
  100. # 由于unwinding库不支持loongarch64架构,因此需要排除该依赖项
  101. [target.'cfg(not(target_arch = "loongarch64"))'.dependencies]
  102. unwinding = { version = "=0.2.8", default-features = false, features = [
  103. "unwinder",
  104. "fde-gnu-eh-frame-hdr",
  105. "panic",
  106. "personality",
  107. ] }
  108. # 构建时依赖项
  109. [build-dependencies]
  110. kernel_build = { path = "../build-scripts/kernel_build" }
  111. [dependencies.lazy_static]
  112. version = "=1.4.0"
  113. # 由于在no_std环境,而lazy_static依赖了spin库,因此需要指定其使用no_std
  114. features = ["spin_no_std"]
  115. # The development profile, used for `cargo build`
  116. [profile.dev]
  117. # opt-level = 0 # Controls the --opt-level the compiler builds with
  118. debug = true # Controls whether the compiler passes `-g`
  119. # The release profile, used for `cargo build --release`
  120. [profile.release]
  121. debug = false
  122. # debug = true