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>
; entry stack:
; - CBIOS Heads
; - CBIOS Sectors
- ; - CBIOS flag
+ ; - EBIOS flag
; - DX (including drive number)
; - DI
; - ES
; 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
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
/* 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
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 */
1:
popw %dx
+ pushw %cx /* Save EBIOS flag */
/* Get (C)HS geometry */
movb $0x08, %ah