diff options
Diffstat (limited to '01_exercise')
-rw-r--r-- | 01_exercise/bootloader.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/01_exercise/bootloader.c b/01_exercise/bootloader.c index 1ba5786..e891116 100644 --- a/01_exercise/bootloader.c +++ b/01_exercise/bootloader.c @@ -33,7 +33,20 @@ char getc() { return ret; } +void sleep(short ms) { + long ys = ms * 1000; + short cx = ys >> 16; + short dx = ys; + + // http://www.ctyme.com/intr/rb-1525.htm : Int 15/AH=86h bios wait + char ah = 0x86; + char al = 0x00; + short command = ah << 8 | al; + + asm volatile("int $0x15;" : : "a"(command), "cx"(cx), "dx"(dx)); +} + void main(void) { print("Hello!"); - put(getc()); -} + print("\n\r > "); +}
\ No newline at end of file |