Przeglądaj źródła

print a message periodically.

Lucas Stadler 11 lat temu
rodzic
commit
0db6288186
1 zmienionych plików z 18 dodań i 2 usunięć
  1. 18 2
      os/first.asm

+ 18 - 2
os/first.asm

@ -17,10 +17,26 @@ start:
17 17
        mov si, text_string     ; put string position into si
18 18
        call print_string
19 19
20
        ;; jump here, infinite loop!
21
        jmp $
20
run:
21
        ;; sleep a bit
22
        mov cx, 10
23
        mov dx, 0
24
        call sleep
25
26
        ;; say something so we notice it happened
27
        mov si, sleepy_string   ; could be done earlier, but maybe we'll print different messages later
28
        call print_string
29
30
        ;; go back to sleep
31
        jmp run
22 32
23 33
        text_string db 'This is my very first OS!', 0
34
        sleepy_string db ' Waking up again...', 0
35
36
sleep:
37
        mov ah, 0x86            ; "wait", specify length in `cx` and `dx` in microseconds (10^-6s)
38
        int 0x15
39
        ret
24 40
25 41
clear_screen:
26 42
        mov ah, 0x00            ; "set video mode"