loader: rework kernel entry point

This commit is contained in:
Loïc Grégoire
2026-08-07 15:40:58 -04:00
parent 13375f294c
commit 5bb264a9ae
4 changed files with 25 additions and 14 deletions
+3
View File
@@ -11,6 +11,9 @@ var thread0: ke.Thread = undefined;
export fn kmain(boot_info: *r.BootInfo) callconv(.c) void {
r.boot_info = boot_info;
// Immediately initialize the context of what will eventually become
// our idle thread. We keep running on the loader stack up until we switch
// into the thread.
thread0.init(
boot_info.kernel_stack,
boot_info.kernel_stack_size,
+6 -1
View File
@@ -137,7 +137,12 @@ pub const Thread = struct {
arg: ?*anyopaque,
) void {
thread.* = .{
.context = .init(stack, stack_size, entry, arg),
.context = .init(
stack,
stack_size,
entry,
arg,
),
.lock = .init(),
.nice = 0,
.priority = prio,