forked from AbleOS/ableos
35 lines
748 B
Plaintext
35 lines
748 B
Plaintext
request_page := fn(page_count: u8): ^u8 {
|
|
msg := "\{00}\{01}xxxxxxxx\0"
|
|
msg_page_count := msg + 1;
|
|
*msg_page_count = page_count
|
|
return @eca(^u8, 3, 2, msg, 12)
|
|
}
|
|
|
|
release_page := fn(ptr: ^u8, page_count: u8): void {
|
|
msg := "\{01}\{00}xxxxxxxx\0"
|
|
|
|
msg_page_count := msg + 1;
|
|
*msg_page_count = page_count
|
|
|
|
msg_ptr := @as(^^u8, @bitcast(msg + 2));
|
|
*msg_ptr = ptr
|
|
|
|
return @eca(void, 3, 2, msg, 12)
|
|
}
|
|
|
|
outb := fn(addr_high: u8, addr_low: u8, value: u8): void {
|
|
msg := "\0\0\0\0";
|
|
*msg = 1;
|
|
*(msg + 1) = addr_high;
|
|
*(msg + 2) = addr_low;
|
|
*(msg + 3) = value
|
|
@eca(void, 3, 3, msg, 4)
|
|
return
|
|
}
|
|
|
|
inb := fn(addr_high: u8, addr_low: u8): u8 {
|
|
msg := "\0\0\0\0";
|
|
*(msg + 1) = addr_high;
|
|
*(msg + 2) = addr_low
|
|
return @eca(u8, 3, 3, msg, 3)
|
|
} |