From ae73971d97f9fe3cc49f690e44962f32bd8eea37 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Fri, 5 Sep 2008 15:00:40 -0700 Subject: [PATCH] ISOLINUX: fix EBIOS information passing in hybrid HDD mode We were incorrectly not passing the EBIOS flag in hybrid HDD mode; also compute the EBIOS LBA correctly in hybrid HDD mode. Allow a 34-bit LBA for this, that way we still support up to 2^32 CD-ROM sectors (8 TB). Signed-off-by: H. Peter Anvin --- core/isolinux.asm | 5 ++++- mbr/isohdpfx.S | 12 +++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/core/isolinux.asm b/core/isolinux.asm index 060a3cf..cb581e9 100644 --- a/core/isolinux.asm +++ b/core/isolinux.asm @@ -235,7 +235,7 @@ bi_end: ; entry stack: ; - CBIOS Heads ; - CBIOS Sectors - ; - CBIOS flag + ; - EBIOS flag ; - DX (including drive number) ; - DI ; - ES @@ -749,6 +749,8 @@ getlinsec: jmp word [cs:GetlinsecPtr] ; getlinsec implementation for floppy/HDD EBIOS (EDD) ; getlinsec_ebios: + xor edx,edx + shld edx,eax,2 shl eax,2 ; Convert to HDD sectors shl bp,2 @@ -781,6 +783,7 @@ getlinsec_ebios: jc .error pop bp add eax,edi ; Advance sector pointer + adc edx,0 sub bp,di ; Sectors left shl di,9 ; 512-byte sectors add bx,di ; Advance buffer pointer diff --git a/mbr/isohdpfx.S b/mbr/isohdpfx.S index f2bc7dc..2d65c7d 100644 --- a/mbr/isohdpfx.S +++ b/mbr/isohdpfx.S @@ -44,9 +44,10 @@ isolinux_start_hybrid = 0x7c00+64+4 /* Important: the top 6 words on the stack are passed to isolinux.bin */ stack = 0x7c00 driveno = (stack-6) -sectors = (stack-8) -heads = (stack-10) -secpercyl = (stack-14) +ebios_flag = (stack-8) +sectors = (stack-10) +heads = (stack-12) +secpercyl = (stack-16) BIOS_page = 0x462 @@ -92,8 +93,8 @@ next: jc 1f cmpw $0xaa55, %bx jne 1f - shrw %cx /* Bit 0 = fixed disk subset */ - jnc 1f + andw $1,%cx /* Bit 0 = fixed disk subset */ + jz 1f /* We have EBIOS; patch in the following code at read_sector_cbios: movb $0x42, %ah ; jmp read_common */ @@ -102,6 +103,7 @@ next: 1: popw %dx + pushw %cx /* Save EBIOS flag */ /* Get (C)HS geometry */ movb $0x08, %ah -- 2.7.4