summaryrefslogtreecommitdiff
path: root/src/boot/stage2_real_functions.asm
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/stage2_real_functions.asm')
-rw-r--r--src/boot/stage2_real_functions.asm9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/boot/stage2_real_functions.asm b/src/boot/stage2_real_functions.asm
index 8b4b5af..3810963 100644
--- a/src/boot/stage2_real_functions.asm
+++ b/src/boot/stage2_real_functions.asm
@@ -88,9 +88,9 @@ probe_and_fix_disk_geometry:
; IN dl: drive to read from
read_from_disk:
- mov bx, 0 ; where to store the data
+ mov bx, 0x0880 ; where to store the data
mov es, bx
- mov bx, 0x8800 ; 3072 bytes after first sector
+ mov bx, 0x0 ; 3072 bytes after first sector
.read_next_sector:
@@ -108,6 +108,11 @@ read_from_disk:
jmp .read_next_sector
.next_head:
+ shr bx, 4 ; make it a segment offset..
+ mov ax, es
+ add ax, bx
+ mov es, ax ; ..and add it to ES
+ mov bx, 0x0 ; we also reset bx and update es to avoid hitting the 64k wrap around point
mov [CURRENT_SECTOR], BYTE 1 ; start from first sector again
add [CURRENT_HEAD], BYTE 1 ; advance head
mov ch, [NOF_HEADS]