mirror of
https://github.com/rdmsr/zag.git
synced 2026-10-30 06:48:22 +00:00
ke: rework kernel initialization
This commit is contained in:
+4
-9
@@ -11,8 +11,7 @@ const rtl = @import("rtl");
|
||||
// XXX
|
||||
const fbconsole = @import("../dev/fbconsole.zig");
|
||||
|
||||
export fn kmain(boot_info: *r.BootInfo) callconv(.c) void {
|
||||
ke.init(boot_info);
|
||||
pub fn init() void {
|
||||
mm.init();
|
||||
ps.init();
|
||||
|
||||
@@ -23,11 +22,11 @@ export fn kmain(boot_info: *r.BootInfo) callconv(.c) void {
|
||||
exp.console.init();
|
||||
exp.string.init();
|
||||
|
||||
if (boot_info.cmdline) |cline| {
|
||||
if (r.boot_info.cmdline) |cline| {
|
||||
if (rtl.cmdline.get_string(cline, "test")) |tst| {
|
||||
// Run a test if specified.
|
||||
if (r.tests.tests.get(tst)) |func| {
|
||||
const t = ps.thread.create_kernel(ke.Thread.Priority.default, func, boot_info) catch @panic("oom");
|
||||
const t = ps.thread.create_kernel(ke.Thread.Priority.default, func, r.boot_info) catch @panic("oom");
|
||||
ke.sched.enqueue(&t.kern);
|
||||
} else {
|
||||
std.log.info("invalid test: \"{s}\"", .{tst});
|
||||
@@ -35,11 +34,7 @@ export fn kmain(boot_info: *r.BootInfo) callconv(.c) void {
|
||||
}
|
||||
}
|
||||
|
||||
if (boot_info.framebuffer != null) {
|
||||
if (r.boot_info.framebuffer != null) {
|
||||
// fbconsole.init(boot_info);
|
||||
}
|
||||
|
||||
while (true) {
|
||||
std.atomic.spinLoopHint();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,8 @@ pub const DelayedWorkItem = p.work.DelayedWorkItem;
|
||||
pub const Console = p.console.Console;
|
||||
pub const InternedString = p.string.InternedString;
|
||||
|
||||
pub const init = p.init;
|
||||
|
||||
pub const work = struct {
|
||||
pub const enqueue = p.work.enqueue;
|
||||
pub const enqueue_in = p.work.enqueue_in;
|
||||
|
||||
Reference in New Issue
Block a user