aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-21 10:39:38 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-21 10:39:38 -0700
commit88dd13080be414afa5ea2a47f08c632bc143dc58 (patch)
tree630acf90318651417ef36dab454e858c01c87b95
parent82f9fe073965be25be10f51c16070745575aa476 (diff)
downloadsyslinux-88dd13080be414afa5ea2a47f08c632bc143dc58.tar.gz
syslinux-88dd13080be414afa5ea2a47f08c632bc143dc58.tar.xz
syslinux-88dd13080be414afa5ea2a47f08c632bc143dc58.zip
diskstart: fix CHS mode, reinstate cyl 1023 checksyslinux-4.00-pre55
Fix loading in CHS mode; we were missing a popad. Also reinstate the check for exceeding cylinder 1023. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/diskstart.inc23
1 files changed, 11 insertions, 12 deletions
diff --git a/core/diskstart.inc b/core/diskstart.inc
index 40330dd5..4f15ad27 100644
--- a/core/diskstart.inc
+++ b/core/diskstart.inc
@@ -159,12 +159,13 @@ floppy:
fs rep movsw ; Faster to move words
mov cl,[bsSecPerTrack] ; Patch the sector count
mov [di-76+8],cl
- int 13h ; Some BIOSes need this
- push cx ; Partition offset == 0
- push cx
- push cx
- push cx
+ push ax ; Partition offset == 0
+ push ax
+ push ax
+ push ax
+
+ int 13h ; Some BIOSes need this
jmp short not_harddisk
;
; The drive number and possibly partition information was passed to us
@@ -326,9 +327,8 @@ getonesec_cbios:
; eax = track #
div edi ; Convert track to head/cyl
- ; We should test this, but it doesn't fit...
- ; cmp eax,1023
- ; ja .error
+ cmp eax,1023 ; Outside the CHS range?
+ ja kaboom
;
; Now we have AX = cyl, DX = head, CX = sector (0-based),
@@ -343,11 +343,11 @@ getonesec_cbios:
mov dh,dl
mov ax,0201h ; Read one sector
call xint13
+ popad
jc .error
ret
.error:
- popad
loop .retry
; Fall through to disk_error
@@ -699,9 +699,8 @@ getlinsec_cbios:
; eax = track #
div edi ; Convert track to head/cyl
- ; We should test this, but it doesn't fit...
- ; cmp eax,1023
- ; ja .error
+ cmp eax,1023 ; Outside the CHS range?
+ ja kaboom
;
; Now we have AX = cyl, DX = head, CX = sector (0-based),