loader: initial loader code

This commit is contained in:
Loïc Grégoire
2026-07-16 19:48:01 -04:00
parent 26ec72fb36
commit a79c7a07cb
35 changed files with 1197 additions and 548 deletions
+16
View File
@@ -0,0 +1,16 @@
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 -1
View File
@@ -9,7 +9,7 @@ const ex = r.ex;
var thread0: ke.Thread = undefined;
var stack: [r.kib(16)]u8 align(16) = undefined;
pub fn init(boot_info: *pl.BootInfo) linksection(r.init) void {
pub fn init(boot_info: *r.BootInfo) linksection(r.init) void {
ki.impl.early_init();
ki.tunable.init(boot_info);
std.log.info("Welcome to the machine", .{});
+1 -1
View File
@@ -42,7 +42,7 @@ pub fn Tunable(comptime T: type, comptime default: T, comptime name: []const u8)
};
}
pub fn init(boot_info: *pl.BootInfo) void {
pub fn init(boot_info: *r.BootInfo) void {
const cmdline = boot_info.cmdline orelse return;
const elems = set.elems();