4 %define STAGE2START 0x7e00
5 %define STAGE2SIZE 0xFF
17 mov ah, 0x0e ; TTY output
19 mov bl, 0x07 ; Color: Light grey on black background
24 ; Call print_al on all characters in si
25 ; si must be null terminated
27 mov cl, 0 ; Start with iteration 0 - equivalent of int i = 0
29 lodsb ; Load next characet of si into al
35 jb print_bytes_si_loop
40 mov ch, 33 ; Our string is 33 characters long
58 ; Move cursor to 0, 0 on page 0
65 mov ch, 33 ; Our string is 33 characters long
69 mov ah, 0x02 ; Read sectors
70 mov al, STAGE2SIZE ; Stage 2 size (16 MiB) in sectors
71 xor ch, ch ; Cylinder 0
72 mov cl, 2 ; Second sector, they start at 1
75 mov bx, STAGE2START ; Memory address to load stage 2 into
78 jc stage2_error ; Carry flag is set if there was an error
80 cmp al, STAGE2SIZE ; Have we read as many sectors as we requested?
83 jmp STAGE2START ; Hand over control to stage 2
85 hello db 'Welcome to loadnothing stage 1!', 13, 10 ; \r\n
86 error db 'Error reading stage 2 from disk', 13, 10 ; \r\n
88 times (446 - ($ - $$)) db 0x00