The LBA for getonesec and getlinsec is in EDX:EAX, but both DL and AX
are function inputs to INT 13h (drive number and function number). We
need to preserve the LBA across *both* those, otherwise retries will
not function.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
push word 1
push word 16
mov si,sp
+ pushad
mov ah,42h ; Extended Read
call xint13
+ popad
lea sp,[si+16] ; Remove DAPA
jc .error
ret
pushad ; Try resetting the device
xor ax,ax
- int 13h
+ call xint13
popad
loop .retry ; CX-- and jump if not zero
;
xint13:
mov dl,[DriveNumber]
- pushad
int 13h
- popad
ret
;
push di
push word 16
mov si,sp
+ pushad
mov ah,42h ; Extended Read
push ds
push ss
pop ds
call xint13
pop ds
+ popad
lea sp,[si+16] ; Remove DAPA
jc .error
pop bp
mov ah,02h ; Read sectors
mov bp,retry_count
.retry:
+ pushad
call xint13
+ popad
jc .error
.resume:
movzx ecx,al ; ECX <- sectors transferred