2024-08-12 08:15:50 -05:00
|
|
|
stn := @use("../../../libraries/stn/src/lib.hb");
|
|
|
|
.{log, string, memory, buffer} := stn
|
2024-05-23 16:59:17 -05:00
|
|
|
|
2024-08-12 08:15:50 -05:00
|
|
|
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
|
2024-05-23 16:59:17 -05:00
|
|
|
}
|