ISOLINUX: fix EBIOS information passing in hybrid HDD mode
authorH. Peter Anvin <hpa@zytor.com>
Fri, 5 Sep 2008 22:00:40 +0000 (15:00 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 5 Sep 2008 22:00:40 +0000 (15:00 -0700)
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 <hpa@zytor.com>
core/isolinux.asm
mbr/isohdpfx.S

index 060a3cf..cb581e9 100644 (file)
@@ -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
index f2bc7dc..2d65c7d 100644 (file)
@@ -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 */
+       j     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