diff options
| author | Marin Ivanov <[email protected]> | 2024-05-02 01:07:26 +0300 |
|---|---|---|
| committer | Marin Ivanov <[email protected]> | 2024-05-02 01:07:26 +0300 |
| commit | 476d95c3d01d085013d2986997d0232c3a97d27b (patch) | |
| tree | 29dff4a771f1f95ae96f98684871f35442e237a7 /src | |
| parent | b443cf5d72a3b5b11331475a29772eca63479377 (diff) | |
write in console and debugcon
Diffstat (limited to 'src')
| -rw-r--r-- | src/debugcon.zig | 7 | ||||
| -rw-r--r-- | src/main.zig | 14 |
2 files changed, 5 insertions, 16 deletions
diff --git a/src/debugcon.zig b/src/debugcon.zig index 6014637..e721a4d 100644 --- a/src/debugcon.zig +++ b/src/debugcon.zig @@ -14,10 +14,7 @@ pub fn outb(port: u16, data: u8) void { } pub fn write(data: []const u8) void { - const len: u8 = @intCast(data.len & 0xFF); - outb(0xe9, 0x30 + len); - for (0..len) |i| { - outb(0xe9, 0x30); - outb(0xe9, data[i]); + for (data) |x| { + outb(0xe9, x); } } diff --git a/src/main.zig b/src/main.zig index 5534a84..2ac40fa 100644 --- a/src/main.zig +++ b/src/main.zig @@ -32,21 +32,13 @@ export const multiboot2 align(4) linksection(".multiboot") = MultibootHeader{ .tag2 = 8, }; -var vga = @as([*]volatile u16, @ptrFromInt(0xB8000)); - export fn kmain() noreturn { - //print OK - vga[0] = 0x2f4f; - vga[1] = 0x2f4b; - console.initialize(); - console.puts("test"); + console.setColor(0x2F); + console.puts("64-bit Yadka"); // write debug data - debug.outb(0xe9, 'H'); - debug.outb(0xe9, 'i'); - debug.outb(0xe9, '!'); - debug.outb(0xe9, '\n'); + debug.write("Hi!\n"); while (true) {} } |
