ableos/sysdata/programs/serial_driver/src/main.hb

31 lines
629 B
Plaintext

stn := @use("../../../libraries/stn/src/lib.hb");
.{log, string, memory, buffer} := stn
serial_print := fn(ptr: ^u8): void {
letter := 0
loop if *ptr == 0 break else {
letter = *ptr
memory.outb(3, 248, letter)
ptr += 1
}
return
}
serial_println := fn(ptr: ^u8): void {
serial_print(ptr)
memory.outb(3, 248, 12)
memory.outb(3, 248, 13)
return
}
main := fn(): int {
serial_println("Starting Serial Driver.\0")
// Note that the first byte is reserved, pad accordingly.
a := buffer.create("XNumber\0")
b := buffer.search("XNumber\0")
if a == b {
serial_println("Stopping Serial Driver.\0")
}
return 0
}