forked from offtopia/ponydos
Reset disk system on read error
This commit is contained in:
parent
feb4eecb05
commit
9d2021cf1f
10
ponydos.asm
10
ponydos.asm
|
@ -214,8 +214,10 @@ read_sector:
|
|||
; es:bx = output buffer
|
||||
mov bx, di
|
||||
|
||||
.retry:
|
||||
mov ax, 0x0201 ; read one sector
|
||||
int 0x13
|
||||
jc .error
|
||||
|
||||
pop dx
|
||||
pop cx
|
||||
|
@ -223,6 +225,14 @@ read_sector:
|
|||
pop ax
|
||||
ret
|
||||
|
||||
.error:
|
||||
; Reset the disk system unconditinoally, as we have no
|
||||
; kernel panic handler to go to after 3 tries and proper
|
||||
; error handling would take too much code
|
||||
xor ah, ah
|
||||
int 0x10
|
||||
jmp .retry
|
||||
|
||||
; ------------------------------------------------------------------
|
||||
; Mouse callback
|
||||
; ------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue