-
Notifications
You must be signed in to change notification settings - Fork 113
Expand file tree
/
Copy pathCargo.toml
More file actions
423 lines (357 loc) · 11.5 KB
/
Cargo.toml
File metadata and controls
423 lines (357 loc) · 11.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
[package]
name = "hermit-kernel"
version = "0.13.0"
authors = ["The Hermit Project Developers"]
license = "MIT OR Apache-2.0"
readme = "README.md"
keywords = ["unikernel", "libos"]
categories = ["os"]
repository = "https://github.com/hermit-os/kernel"
documentation = "https://hermit-os.github.io/kernel/hermit/"
edition = "2024"
description = "A Rust-based library operating system"
exclude = [
"/.github/*",
"/.vscode/*",
"/img/*",
".gitattributes",
".gitignore",
]
[package.metadata.docs.rs]
all-features = true
[lib]
name = "hermit"
[[test]]
name = "basic_math"
harness = true
[[test]]
name = "basic_print"
harness = false
[[test]]
name = "measure_startup_time"
harness = false
[features]
default = [
"acpi",
"dhcpv4",
"fsgsbase",
"kernel-stack",
"pci-ids",
"pci",
"smp",
"tcp",
"virtio-fs",
"virtio-net",
"virtio-vsock",
]
#! ### Syscall Features
## Enables multiple address spaces.
##
## This feature makes Hermit use traditional system calls for communicating with the kernel
## instead of using function calls.
##
## Note that this feature is not complete yet.
common-os = []
## Enables support for memory management system calls.
##
## This feature enables functions similar to [sys/mman.h].
##
## For details, see [`syscalls::mman`].
##
## [sys/mman.h]: https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/sys_mman.h.html
mman = []
## Enables support for C and C++ applications via Hermit's [Newlib].
##
## For details of running C and C++ applications with Hermit, see [hermit-c].
##
## [Newlib]: https://github.com/hermit-os/newlib
## [hermit-c]: https://github.com/hermit-os/hermit-c
newlib = []
#! ### Hardware Features
#!
#! [microvm]: https://www.qemu.org/docs/master/system/i386/microvm.html
#! [Uhyve]: https://github.com/hermit-os/uhyve
## Enables _Advanced Configuration and Power Interface_ ([ACPI]) support.
##
## This is not useful on [microvm]s and [Uhyve].
##
## [ACPI]: https://uefi.org/specs/ACPI/6.6/
acpi = []
## Enables using the [FSGSBASE] instruction family.
##
## This feature only applies to x86-64.
##
## Using the FSGSBASE instruction family over RDMSR and WRMSR is more efficient.
##
## According to QEMU, the FSGSBASE instruction family is supported since at least Intel's IvyBridge
## (2012) and AMD's EPYC (2017).
##
## [FSGSBASE]: https://www.intel.com/content/www/us/en/developer/articles/technical/software-security-guidance/best-practices/guidance-enabling-fsgsbase.html
fsgsbase = []
## Enables _Peripheral Component Interconnect_ ([PCI]) support.
##
## This is not useful on [microvm]s.
##
## If this feature is disabled, MMIO-based transports are used for devices.
##
## [PCI]: https://pcisig.com/
pci = ["virtio?/pci"]
## Embeds the [PCI ID] database into the kernel.
##
## This enables displaying human-readable names for PCI devices.
##
## [PCI ID]: https://pci-ids.ucw.cz/
pci-ids = ["dep:pci-ids"]
## Enables semihosting support.
##
## Semihosting allows communicating with the host for
##
## - `stdin`, `stdout`, `stderr`,
## - accessing the host file system,
## - shutting down with an exit code,
## - getting program arguments,
## - getting the time, and
## - generating random data.
##
## Note that Hermit currently only supports shutting down with an exit code.
##
## For details, see the [`semihosting`] crate, [Semihosting for AArch32 and Aarch64], and
## [RISC-V Semihosting].
##
## [`semihosting`]: https://docs.rs/semihosting
## [Semihosting for AArch32 and Aarch64]: https://github.com/riscv-non-isa/riscv-semihosting/releases/download/1.0/riscv-semihosting.pdf
## [RISC-V Semihosting]: https://github.com/ARM-software/abi-aa/tree/2025Q4/semihosting
semihosting = ["dep:semihosting"]
## Enables _symmetric multiprocessing_ (SMP) support.
##
## This allows utilizing _multi-core processors_ (MCP).
##
## This currently enables the `acpi` feature, since ACPI is used for booting the
## _application processor_s (AP) from the _boot-strap processor_ (BSP).
smp = ["acpi"]
#! ### Network Features
## Enables TCP support.
tcp = ["net", "smoltcp", "smoltcp/socket-tcp"]
## Enables UDP support.
udp = ["net", "smoltcp", "smoltcp/socket-udp"]
## Enables DHCPv4 support.
dhcpv4 = ["net", "smoltcp", "smoltcp/proto-dhcpv4", "smoltcp/socket-dhcpv4"]
## Enables DNS support.
dns = ["net", "smoltcp", "smoltcp/socket-dns"]
## Enables pretty-printing the network traffic to the serial device.
net-trace = ["smoltcp?/log", "smoltcp?/verbose"]
#! ### Network Drivers
#!
#! Currently, Hermit does not support multiple network drivers at the same time.
#!
#! If none of these drivers is enabled, but the `net` feature is active, a loopback driver
#! will be enabled as a fallback.
## Enables the virtio-net driver.
virtio-net = ["net", "virtio"]
## Enables the RTL8139 network driver.
rtl8139 = ["net", "pci", "volatile/derive", "endian-num"]
## Enables the Cadence Gigabit Ethernet MAC (GEM) network driver.
gem-net = ["net", "dep:tock-registers"]
#! ### Virtio Drivers
## Enables the virtio-console driver.
virtio-console = ["virtio"]
## Enables the virtio-fs driver.
virtio-fs = ["virtio", "dep:fuse-abi", "fuse-abi/num_enum"]
## Enables the virtio-vsock driver.
virtio-vsock = ["virtio"]
#! ### Other Drivers
## Enables the _Video Graphics Array_ (VGA) driver.
##
## This is only useful on PCs (x86-64).
vga = []
#! ### Performance Features
## Disables putting the CPU to sleep.
##
## Compared to waiting for interrupts, this improves performance but maxes out CPU utilization.
idle-poll = []
#! ### Debugging Features
## Enables regularly printing allocation statistics.
alloc-stats = ["talc/counters"]
## Inserts function instrument code for mcount-based tracing.
##
## This allows instrumentation-based profiling of the kernel.
##
## For details, see [rftrace].
##
## [rftrace]: https://github.com/hermit-os/rftrace
instrument-mcount = []
## Enables switching to a Kernel-specific stack in system calls.
##
## This can be useful to avoid and debug stack overflows.
##
## This only implemented for x86-64 and AArch64 CPUs.
kernel-stack = []
## Enables a kernel shell.
##
## The shell can be used for displaying the current number of received interrupts and for shutting
## down the system.
shell = ["simple-shell"]
## Enables printing system calls.
strace = []
#! ### Internal Features
## Documents the Cargo features in the crate docs.
document-features = ["dep:document-features"]
## Enables the network backend.
##
## This is automatically enabled by any network feature.
net = []
## Enables the virtio driver backend.
##
## This is automatically enabled by any virtio driver.
virtio = ["dep:virtio", "dep:mem-barrier"]
## Enables a warning that this libhermit.a was prebuilt.
warn-prebuilt = []
#! ### Deprecated Features
## An alias for the `virtio-console` feature.
console = ["virtio-console"]
## An alias for the `virtio-fs` feature.
fs = ["virtio-fs"]
## An alias for the `virtio-fs` feature.
fuse = ["virtio-fs"]
## An alias for the `mman` feature.
mmap = ["mman"]
## Configures the kernel to be used via its unstable Rust API.
##
## This feature is not needed to use the kernel via its unstable Rust API.
nostd = []
## An alias for the `net-trace` feature.
trace = ["net-trace"]
## An alias for the `virtio-vsock` feature.
vsock = ["virtio-vsock"]
[lints.rust]
rust_2018_idioms = "warn"
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(careful)'] }
unsafe_op_in_unsafe_fn = "warn"
[lints.clippy]
borrow_as_ptr = "warn"
cast_lossless = "warn"
decimal_literal_representation = "warn"
default_trait_access = "warn"
explicit_deref_methods = "warn"
if_not_else = "warn"
ignored_unit_patterns = "warn"
implicit_clone = "warn"
inconsistent_struct_constructor = "warn"
manual_assert = "warn"
manual_let_else = "warn"
match_same_arms = "warn"
match_wildcard_for_single_variants = "warn"
ptr_as_ptr = "warn"
ptr_cast_constness = "warn"
ref_as_ptr = "warn"
ref_option = "warn"
semicolon_if_nothing_returned = "warn"
separated_literal_suffix = "warn"
transmute_ptr_to_ptr = "warn"
uninlined_format_args = "warn"
unreadable_literal = "warn"
[dependencies]
hermit-macro = { version = "=0.1.0", path = "hermit-macro" }
virtio = { package = "virtio-spec", version = "0.3", optional = true, features = ["alloc", "mmio", "nightly", "zerocopy"] }
ahash = { version = "0.8", default-features = false }
align-address = "0.4"
anstyle = { version = "1", default-features = false }
async-executor = { git = "https://github.com/hermit-os/async-executor.git", branch = "no_std", default-features = false, features = ["static"] }
async-lock = { version = "3.4.2", default-features = false }
bit_field = "0.10"
bitflags = "2"
build-time = "0.1.3"
crossbeam-utils = { version = "0.8", default-features = false }
delegate = "0.13"
document-features = { version = "0.2", optional = true }
embedded-io = { version = "0.7", features = ["alloc"] }
endian-num = { version = "0.2", optional = true, features = ["linux-types"] }
enum_dispatch = "0.3"
fdt = { version = "0.1", features = ["pretty-printing"] }
free-list = "0.3"
fuse-abi = { version = "0.2", optional = true, features = ["linux"] }
hashbrown = { version = "0.16", default-features = false }
heapless = "0.9"
hermit-entry = { version = "0.10.8", features = ["kernel"] }
hermit-sync = "0.1"
lock_api = "0.4"
log = { version = "0.4", default-features = false }
mem-barrier = { version = "0.1.0", optional = true, features = ["nightly"] }
num_enum = { version = "0.7", default-features = false }
pci-ids = { version = "0.2", optional = true }
pci_types = { version = "0.10" }
rand_chacha = { version = "0.10", default-features = false }
shell-words = { version = "1.1", default-features = false }
simple-shell = { version = "0.0.1", optional = true }
smallvec = { version = "1", features = ["const_new"] }
take-static = "0.1"
talc = { version = "4" }
thiserror = { version = "2", default-features = false }
time = { version = "0.3", default-features = false }
volatile = "0.6"
zerocopy = { version = "0.8", default-features = false }
uhyve-interface = "0.1.4"
[dependencies.smoltcp]
version = "0.12"
optional = true
default-features = false
features = [
"alloc",
"async",
"medium-ethernet",
"proto-ipv4",
"proto-ipv6",
# Enable IP fragmentation
"proto-ipv4-fragmentation",
"proto-ipv6-fragmentation",
#
# Assume a MTU size of 9000
#"fragmentation-buffer-size-8192",
#"reassembly-buffer-size-8192",
]
[target.'cfg(target_arch = "x86_64")'.dependencies]
free-list = { version = "0.3", features = ["x86_64"] }
raw-cpuid = "11"
uart_16550 = "0.4"
x86_64 = "0.15"
memory_addresses = { version = "0.3", default-features = false, features = [
"x86_64",
"conv-x86_64",
] }
[target.'cfg(target_arch = "aarch64")'.dependencies]
aarch64-cpu = "11"
arm-gic = { version = "0.6" }
arm-pl011-uart = { version = "0.4", default-features = false }
semihosting = { version = "0.1", optional = true }
memory_addresses = { version = "0.3", default-features = false, features = [
"aarch64",
] }
[target.'cfg(target_arch = "riscv64")'.dependencies]
riscv = "0.16"
sbi-rt = "0.0.3"
semihosting = { version = "0.1", optional = true }
tock-registers = { version = "0.10", optional = true }
trapframe = "0.10"
memory_addresses = { version = "0.3", default-features = false, features = [
"riscv64",
] }
[dev-dependencies]
float-cmp = "0.10"
num-traits = { version = "0.2", default-features = false }
[build-dependencies]
anyhow = "1"
built = { version = "0.8", features = ["git2", "chrono"] }
llvm-tools = "0.1"
[workspace]
members = [
"hermit-macro",
"xtask",
]
exclude = [
"hermit-builtins",
]
[patch.crates-io]
safe-mmio = { git = "https://github.com/hermit-os/safe-mmio", branch = "be" }
[profile.profiling]
inherits = "release"
debug = "line-tables-only"