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
+2 -1
View File
@@ -1,5 +1,6 @@
const std = @import("std");
const danos = @import("danos");
const config = @import("config");
const arch = @import("arch");
const console = @import("console.zig");
const log = @import("log.zig");
@@ -278,7 +279,7 @@ fn bringUpSecondaries() void {
log.print("\ndanos: bringing up {d} application processor(s)\n", .{cores.len - 1});
const max_wake_attempts = 3; // a core that misses the first INIT-SIPI-SIPI gets retried
for (cores[1..], 1..) |core, index| {
const stack = heap.allocator().alloc(u8, 16 * 1024) catch {
const stack = heap.allocator().alloc(u8, config.kernel_stack_size) catch {
log.print(" cpu apic_id {d}: no stack; skipped\n", .{core.apic_id});
continue;
};