Can anyone see an issue with this? I'm sure this used to work 100% but now while testing it seems to return complete junk under bochs and real h/w.
Code: Select all
;--------------------------------------------------------------------------------
; Check for EDD / Int13h extensions.
;--------------------------------------------------------------------------------
mov ah,41h
mov bx,55aah
mov dl,[m_driveNo]
int 13h
jc short no_extensions
cmp bx,0aa55h
jne short no_extensions
;--------------------------------------------------------------------------------
; Obtain drive info/geometry from Int13h extensions.
; -> Result Packet will be at 0000:0500h
;--------------------------------------------------------------------------------
mov ah,48h
mov dl,[m_driveNo]
push ds
xor ax,ax
mov ds,ax
mov si,500h
mov word [ds:si],30 ; tried 26/30/66 etc.. didn't make a difference
mov word [ds:si+2],0 ; PhoenixBIOS 4 rel. 6 fails on this function if the flags word isn't 0 on entry.
int 13h
pop ds
jc short no_extensions ; If the carry is set the function call failed and we'll fall back to use legacy int13h calls.
cmp ah,0 ; Double check the errorcode as well in case the BIOS doesn't set the carry correctly.
jne short no_extensions
xor ax,ax
mov es,ax
mov ax,[es:500h+24]
mov [m_sectorsize],ax ; Get reported bytes per sector. COMPLETE GARBAGE HERE... either 0000h or 0606h ??