gather kernel tunables into config.zig

max_cpus, max_tasks, kernel/IST stack sizes, and timer_hz move from scattered constants into one config module. root.zig goes back to being just the boot contract. Values unchanged; any can become a -D build option later.
This commit is contained in:
Daniel Samson
2026-07-08 16:26:36 +01:00
parent 1b47de5058
commit 7501bd1703
9 changed files with 56 additions and 21 deletions
+3 -2
View File
@@ -5,6 +5,7 @@
//! (halt, the descriptor tables, later paging), and nothing generic.
const danos = @import("danos");
const config = @import("config");
const gdt = @import("gdt.zig");
const tss = @import("tss.zig");
const idt = @import("idt.zig");
@@ -148,8 +149,8 @@ pub fn pageExecutable(virt: u64) bool {
return paging.isExecutable(virt);
}
/// Kernel tick rate: 1000 Hz (1 ms), the scheduler's time quantum.
pub const timer_hz = 1000;
/// Kernel tick rate (the scheduler's time quantum), from config.
pub const timer_hz = config.timer_hz;
/// The ACPI PM timer, as a calibration reference (re-exported for the config).
pub const PmTimer = apic.PmTimer;