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