aboutsummaryrefslogtreecommitdiffstats
path: root/core/isolinux.asm
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-26 20:29:31 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-26 20:29:31 -0700
commitf92916d7e556cdf4894333b515f4ce24ca9951ea (patch)
tree08b4d785a46805dc3f7d33c75083c41c349d93cb /core/isolinux.asm
parentb8c15b400ad50af55678defe7c488262f21ac5fc (diff)
downloadsyslinux-f92916d7e556cdf4894333b515f4ce24ca9951ea.tar.gz
isohybrid: make isolinux.bin and isohybrid two-way compatiblesyslinux-3.81-pre16syslinux-3.81
It turns out we *can* determine if we have the extra partition offset information after all, by looking at the value of the stack pointer. This depends on the internals of the old isohdpfx code, but that's really all we need to worry about. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core/isolinux.asm')
-rw-r--r--core/isolinux.asm16
1 files changed, 11 insertions, 5 deletions
diff --git a/core/isolinux.asm b/core/isolinux.asm
index 104de14a..090999d2 100644
--- a/core/isolinux.asm
+++ b/core/isolinux.asm
@@ -108,14 +108,12 @@ GetlinsecPtr resw 1 ; The sector-read pointer
BIOSName resw 1 ; Display string for BIOS type
%define HAVE_BIOSNAME 1
BIOSType resw 1
+bsSecPerTrack resw 1 ; Used in hybrid mode
+bsHeads resw 1 ; Used in hybrid mode
DiskError resb 1 ; Error code for disk I/O
DriveNumber resb 1 ; CD-ROM BIOS drive number
ISOFlags resb 1 ; Flags for ISO directory search
RetryCount resb 1 ; Used for disk access retries
- alignb 8
-bsHidden resq 1 ; Used in hybrid mode
-bsSecPerTrack resw 1 ; Used in hybrid mode
-bsHeads resw 1 ; Used in hybrid mode
_spec_start equ $
@@ -233,6 +231,9 @@ bi_end:
; - EBIOS flag
; (top of stack)
;
+ ; If we had an old isohybrid, the partition offset will
+ ; be missing; we can check for that with sp >= 0x7c00.
+ ; Serious hack alert.
%ifndef DEBUG_MESSAGES
_hybrid_signature:
dd 0x7078c0fb ; An arbitrary number...
@@ -244,8 +245,11 @@ _start_hybrid:
pop dx
pop di
pop es
+ cmp sp,7C00h
+ jae .nooffset
pop dword [cs:bsHidden]
pop dword [cs:bsHidden+4]
+.nooffset:
mov si,bios_cbios
jcxz _start_common
@@ -1056,7 +1060,9 @@ bios_cbios_str db 'CHDD', 0
bios_ebios_str db 'EHDD' ,0
%endif
- alignz 4
+ alignz 8
+bsHidden dq 0 ; Used in hybrid mode
+
bios_cdrom: dw getlinsec_cdrom, bios_cdrom_str
%ifndef DEBUG_MESSAGES
bios_cbios: dw getlinsec_cbios, bios_cbios_str