feat(loader, kernel): impl part of loader and initialize kernel structure

This commit is contained in:
2026-04-11 09:42:09 +08:00
parent 1233ae9e9b
commit 34ccf69569
53 changed files with 1743 additions and 777 deletions

19
arch/x86_64/io.zig Normal file
View File

@@ -0,0 +1,19 @@
pub fn outb(port: u16, value: u8) void {
asm volatile (
\\outb %al, %dx
:
: [port] "{dx}" (port), [value] "{al}" (value)
: .{}
);
}
pub fn inb(port: u16) u8 {
var value: u8 = 0;
asm volatile (
\\inb %dx, %al
: [value] "={al}" (value)
: [port] "{dx}" (port)
: .{}
);
return value;
}