mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-31 23:38:21 +00:00
loader: rework kernel entry point
This commit is contained in:
@@ -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
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user