diff --git a/boot0.s b/boot0.s index 79109c7..847b8c4 100644 --- a/boot0.s +++ b/boot0.s @@ -86,14 +86,22 @@ bits 16 repe cmpsb jne .panic - ; mov word fs:[0x0000], 0xc048 - ; mov word fs:[0x0002], 0xc069 - mov al, [0x7e00] - mov byte fs:[0x0000], al - mov al, [0x7e01] - mov byte fs:[0x0002], al - mov al, [0x7e02] - mov byte fs:[0x0004], al + ; Ensure the 8-byte starting LBA fits in 16 bits + mov di, 0x7e00 ; the rep increments di so we need to reset it + xor bx, bx + mov ax, [di + 0x4a] + or bx, ax + mov ax, [di + 0x4c] + or bx, ax + mov ax, [di + 0x4e] + or bx, ax + jnz .panic + + mov ax, [di + 0x48] + + mov word fs:[0x0000], 0xc048 + mov word fs:[0x0002], 0xc069 + hlt .panic: