diff options
author | Niklas Halle <niklas@niklashalle.net> | 2020-05-05 16:23:02 +0200 |
---|---|---|
committer | Niklas Halle <niklas@niklashalle.net> | 2020-05-05 16:23:02 +0200 |
commit | 247a79f26485eaa062f1cdd4545a3bfe6cd6ca81 (patch) | |
tree | 95142c0476513c176da623d45137a5918ba9e1dd /01_exercise | |
parent | 5b75cdd06f266d384491f51f0e92226b5e19ea3b (diff) | |
download | betriebssysteme-247a79f26485eaa062f1cdd4545a3bfe6cd6ca81.tar.gz betriebssysteme-247a79f26485eaa062f1cdd4545a3bfe6cd6ca81.zip |
sleep
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 |