rework entry point

This commit is contained in:
Loïc Grégoire
2026-07-17 21:26:13 -04:00
parent a79c7a07cb
commit 3c72101228
7 changed files with 8 additions and 25 deletions
-16
View File
@@ -1,16 +0,0 @@
const std = @import("std");
const r = @import("root");
const pl = r.pl;
const ke = r.ke;
const ki = ke.private;
pub const std_options = r.std_options;
pub const panic = r.panic;
export fn kmain(info: *r.BootInfo) callconv(.c) void {
ke.ncpus = 1;
ki.init(info);
}
+1 -2
View File
@@ -10,6 +10,7 @@ var thread0: ke.Thread = undefined;
var stack: [r.kib(16)]u8 align(16) = undefined;
pub fn init(boot_info: *r.BootInfo) linksection(r.init) void {
ke.ncpus = 1;
ki.impl.early_init();
ki.tunable.init(boot_info);
std.log.info("Welcome to the machine", .{});
@@ -27,6 +28,4 @@ pub fn init(boot_info: *r.BootInfo) linksection(r.init) void {
ki.sched.percpu.local().current_thread = &thread0;
std.log.info("Zag for {s} ({s}), cmdline is \"{?s}\"", .{ pl.name, arch.name, boot_info.cmdline });
ex.private.init(boot_info);
}
+1
View File
@@ -24,6 +24,7 @@ pub const Tunable = p.tunable.Tunable;
// === Exported Interfaces ===
pub const panic = p.panic.panic;
pub const init = p.init;
pub const ipl = struct {
pub const raise = p.ipl.raise;