refactor(ke): remove console abstraction

This commit is contained in:
Loïc Grégoire
2026-03-28 10:05:54 -04:00
parent 35094cb298
commit eb29d92442
2 changed files with 21 additions and 70 deletions
+2 -10
View File
@@ -39,8 +39,8 @@ pub threadlocal var my_cpu: *ke.Cpu = undefined;
pub fn devices_init() void {}
fn debug_write(_: *ke.Console, buf: []const u8) void {
_ = linux.write(1, buf.ptr, @intCast(buf.len));
pub fn debug_write(char: u8) void {
_ = linux.write(linux.STDERR_FILENO, @ptrCast(&char), 1);
}
pub const arm_timer = timer.arm_timer;
@@ -60,12 +60,6 @@ const bootstrap_offsets = [1]usize{0};
pub var cpu_offsets: []usize = undefined;
var early_console: ke.Console = .{
.write = debug_write,
.last_seq = 0,
.link = undefined,
};
pub fn early_init() linksection(b.init) void {
// Ensure we can use per-cpu data.
cpu_offsets = @constCast(&bootstrap_offsets);
@@ -106,8 +100,6 @@ pub fn early_init() linksection(b.init) void {
b.kernel_heap_base = heap_base;
std.log.info("um: kernel heap lives at {X}", .{heap_base});
ke.log.register_console(&early_console);
}
fn sigusr1_handler(_: posix.SIG, _: *const posix.siginfo_t, _: ?*anyopaque) callconv(.c) void {