const uart = @import("uart.zig"); const mem = @import("mem.zig"); const std = @import("std"); fn logFn( comptime message_level: std.log.Level, comptime scope: @EnumLiteral(), comptime format: []const u8, args: anytype, ) void { return std.log.defaultLogFileTerminal( message_level, scope, format, args, uart.terminal, ) catch {}; } pub const std_options: std.Options = .{ .logFn = logFn, .page_size_max = 4096, .page_size_min = 4096, }; pub const panic = std.debug.FullPanic(panicFn); fn panicFn(msg: []const u8, first_trace_addr: ?usize) noreturn { std.log.err("kernel panic at {?}", .{first_trace_addr}); std.log.err("{s}", .{msg}); while (true) {} } export fn kmain() callconv(.c) noreturn { uart.init(0x1000_0000); std.log.info("hello, world", .{}); mem.init(); while (true) {} }