From: Elias Fleckenstein Date: Wed, 21 Sep 2022 18:41:47 +0000 (+0200) Subject: Load stage2 from boot drive rather than fixed hard disk X-Git-Url: https://git.lizzy.rs/?a=commitdiff_plain;h=008164b387cd96c66033bc9beff41585f2deb957;p=loadnothing.git Load stage2 from boot drive rather than fixed hard disk --- diff --git a/stage1/boot.asm b/stage1/boot.asm index 2e995a0..6144c2a 100644 --- a/stage1/boot.asm +++ b/stage1/boot.asm @@ -13,10 +13,12 @@ mov ss, ax ; Initialize the stack ; It grows down, overwriting this code -; I have no idea what this does exactly +; I have no idea what this does exactly (note by Lizzy: bp is base pointer, sp is stack pointer) mov bp, STAGE2START mov sp, bp +push dx ; Save boot drive (will be restored when making the int 0x13 ah=0x02 call) + jmp boot ; Print al register @@ -78,8 +80,8 @@ boot: mov al, STAGE2SECTORS ; Stage 2 size in sectors xor ch, ch ; Cylinder 0 mov cl, 2 ; Second sector, they start at 1 + pop dx ; Restore boot drive xor dh, dh ; Head 0 - mov dl, 0x80 ; Hard Drive 1 mov bx, STAGE2START ; Memory address to load stage 2 into int 0x13