feat(ke+pl): pass boot info to early init

This commit is contained in:
Loïc Grégoire
2026-04-04 21:33:03 -04:00
parent 5557ea39c5
commit 5341e057d2
3 changed files with 6 additions and 4 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ var stack: [8192]u8 align(16) = undefined;
pub fn init(boot_info: *pl.BootInfo) linksection(b.init) void {
std.log.info("hello, world", .{});
ki.impl.early_init();
pl.early_init();
pl.early_init(boot_info);
ki.cpu.init_cpu();
thread0.init(@intFromPtr(&stack), 8192, ki.sched.idle, null);
+3 -1
View File
@@ -1,4 +1,5 @@
const b = @import("base");
const pl = b.pl;
const amd64 = b.arch;
const std = @import("std");
@@ -25,7 +26,7 @@ fn com1_write(c: u8) void {
amd64.outb(com1, c);
}
pub fn early_init() linksection(b.init) void {
pub fn early_init(boot_info: *pl.BootInfo) linksection(b.init) void {
com1_init();
amd64.detect_cpu_features();
@@ -48,6 +49,7 @@ pub fn early_init() linksection(b.init) void {
@intFromBool(f.fxsave),
@intFromBool(f.tsc_deadline),
});
_ = boot_info;
}
pub fn late_init() void {}
+2 -2
View File
@@ -11,8 +11,8 @@ else
@compileError("unsupported architecture");
/// Early platform-specific initialization, called before anything else.
pub inline fn early_init() void {
return impl.early_init();
pub inline fn early_init(boot_info: *BootInfo) void {
return impl.early_init(boot_info);
}
/// Late platform init. Memory allocator is available at this point.