feat(loader, kernel): impl part of loader and initialize kernel structure
This commit is contained in:
19
arch/x86_64/io.zig
Normal file
19
arch/x86_64/io.zig
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user