aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarin Ivanov <[email protected]>2024-05-01 02:59:51 +0300
committerMarin Ivanov <[email protected]>2024-05-01 09:22:37 +0300
commit4c6c36bdbda2e7475c25f6053c5914e15858c223 (patch)
tree70bd2c0144eba49013f6f8f4afe3a4cfc494d773
parent8a75ae114231b26cef2814dcc8d5810bb94f87b9 (diff)
wip: work with slices
-rw-r--r--src/main.zig10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.zig b/src/main.zig
index f716a84..ac2376e 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -35,7 +35,17 @@ inline fn outb(port: u16, data: u8) void {
);
}
+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]);
+ }
+}
+
export fn _start() callconv(.C) noreturn {
+ write("test\n");
outb(0xe9, 'H');
outb(0xe9, 'i');
outb(0xe9, '!');