5 boot_driveno equ 7b00h ; 1 byte
6 stage2_size equ stage2_end - stage2_start
17 mov [boot_driveno], dl
19 ; load the rest of the code at 7e00
23 mov ah, 2 ; read sectors LBA call
24 mov al, (stage2_size + 511) / 512 ; num sectors
25 mov cx, 2 ; ch: cylinder, cl: sector
27 mov dl, [boot_driveno]
29 jnc stage2_start ; loaded successfully, jump to it
31 ; failed to load second sector
38 ; expects string ptr in ax
51 str_load_fail db "Failed to load second stage!",0
52 str_booting db "Booting ...",0
58 ; start of the second stage