[package]
name = "hermit-kernel"
version = "0.6.7"
authors = [
	"Stefan Lankes <slankes@eonerc.rwth-aachen.de>",
	"Colin Finck <colin.finck@rwth-aachen.de>",
	"Martin Kröning <mkroening@posteo.net>",
	"Frederik Schulz",
	"Thomas Lambertz",
	"Jonathan Klimt <jonathan.klimt@eonerc.rwth-aachen.de>",
	"Jonathan Schwender",
	"Daniel Krebs",
	"Yu Duan",
]
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 = "2021"
description = "A Rust-based library operating system"
exclude = [
	"/.github/*",
	"/.vscode/*",
	"/img/*",
	".gitattributes",
	".gitignore",
]

[lib]
crate-type = ["staticlib", "lib"]  # "lib" required for integration tests
name = "hermit"

[[test]]
name = "basic_math"
harness = true

[[test]]
name = "basic_print"
harness = false

[[test]]
name = "measure_startup_time"
harness = false

[features]
default = ["pci", "pci-ids", "acpi", "fsgsbase", "smp", "tcp", "dhcpv4", "fs"]
acpi = []
dhcpv4 = [
    "smoltcp",
    "smoltcp/proto-dhcpv4",
    "smoltcp/socket-dhcpv4",
]
fs = ["pci"]
fsgsbase = []
gem-net = ["tcp"]
newlib = []
pci = []
rtl8139 = ["tcp", "pci"]
smp = []
tcp = ["smoltcp", "smoltcp/socket-tcp"]
udp = ["smoltcp", "smoltcp/socket-udp"]
trace = []
vga = []
common-os = []

[dependencies]
ahash = { version = "0.8", default-features = false }
align-address = "0.1"
bit_field = "0.10"
bitflags = "2.4"
cfg-if = "1"
crossbeam-utils = { version = "0.8", default-features = false }
dyn-clone = "1.0"
hashbrown = { version = "0.14", default-features = false }
hermit-entry = { version = "0.9", features = ["kernel"] }
hermit-sync = "0.1"
lock_api = "0.4"
log = { version = "0.4", default-features = false }
num = { version = "0.4", default-features = false }
num-derive = "0.4"
num-traits = { version = "0.2", default-features = false }
pci-ids = { version = "0.2", optional = true }
pci_types = { version = "0.6" }
pflock = "0.2"
qemu-exit = "3.0"
rand_chacha = { version = "0.3", default-features = false }
shell-words = { version = "1.1", default-features = false }
smallvec = { version = "1", features = ["const_new"] }
take-static = "0.1"
talc = { version = "4" }
time = { version = "0.3", default-features = false }
zerocopy = { version = "0.7", features = ["derive"] }

[dependencies.smoltcp]
version = "0.11"
optional = true
default-features = false
features = [
    "alloc",
    "async",
    "medium-ethernet",
    "proto-ipv4",
    "proto-ipv6",
    # Enable IP fragmentation
    #"proto-ipv4-fragmentation",
    #
    # Assume a MTU size of 9000
    #"fragmentation-buffer-size-8192",
    #"reassembly-buffer-size-8192",
    #
    # Enable for increased output
    # "log",
    # "verbose",
]

[target.'cfg(target_arch = "x86_64")'.dependencies]
multiboot = "0.8"
uart_16550 = "0.3"
x86 = { version = "0.52", default-features = false }
x86_64 = "0.14"

[target.'cfg(target_arch = "aarch64")'.dependencies]
aarch64 = { version = "0.0", default-features = false }
arm-gic = { version = "0.1" }
hermit-dtb = { version = "0.1" }

[target.'cfg(target_arch = "riscv64")'.dependencies]
fdt = "0.1"
riscv = "0.10"
sbi = "0.2"
trapframe = "0.9"

[dev-dependencies]
float-cmp = "0.9"
num-traits = { version = "0.2", default-features = false }
x86 = { version = "0.52", default-features = false }

[build-dependencies]
anyhow = "1"
llvm-tools = "0.1"

[workspace]
members = [
	"xtask",
]
exclude = [
	"hermit-builtins",
]
