:: commit 7b6ad6294f0f2e6ad24987df0ad515260f54e4bf

Mintsuki <mintsuki@protonmail.com> — 2026-02-08 07:59

parents: 963607c6f0

stage1/hdd: Zero-extend bytes_per_sect to full EBP to fix 32-bit division

diff --git a/stage1/hdd/disk.asm b/stage1/hdd/disk.asm
index 6d427e68..cac11200 100644
--- a/stage1/hdd/disk.asm
+++ b/stage1/hdd/disk.asm
@@ -35,7 +35,7 @@ read_sectors:
     mov word [si], 30       ; buf_size
     int 0x13
     jc .done
-    mov bp, word [si+24]    ; bytes_per_sect
+    movzx ebp, word [si+24] ; bytes_per_sect
 
     ; ECX byte count to CX sector count
     mov ax, cx
tab: 248 wrap: offon