4 %define STAGE2START 0x7e00
5 %define STAGE2SIZE 0x7f
15 ; Initialize the stack
16 ; It grows down, overwriting this code
17 ; I have no idea what this does exactly
25 mov ah, 0x0e ; TTY output
27 mov bl, 0x07 ; Color: Light grey on black background
32 ; Call print_al on all characters in si
33 ; si must be null terminated
35 mov cl, 0 ; Start with iteration 0 - equivalent of int i = 0
37 lodsb ; Load next characet of si into al
43 jb print_bytes_si_loop
48 mov ch, 33 ; Our string is 33 characters long
66 ; Move cursor to 0, 0 on page 0
73 mov ch, 33 ; Our string is 33 characters long
77 mov ah, 0x02 ; Read sectors
78 mov al, STAGE2SIZE ; Stage 2 size (16 MiB) in sectors
79 xor ch, ch ; Cylinder 0
80 mov cl, 2 ; Second sector, they start at 1
82 mov dl, 0x80 ; Hard Drive 1
83 mov bx, STAGE2START ; Memory address to load stage 2 into
86 jc stage2_error ; Carry flag is set if there was an error
88 cmp al, STAGE2SIZE ; Have we read as many sectors as we requested?
91 jmp STAGE2START ; Hand over control to stage 2
93 hello db 'Welcome to loadnothing stage 1!', 13, 10 ; \r\n
94 error db 'Error reading stage 2 from disk', 13, 10 ; \r\n
96 times (446 - ($ - $$)) db 0x00