mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-27 13:58:20 +00:00
feat(ke+pl): pass boot info to early init
This commit is contained in:
+1
-1
@@ -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);
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user