Reset disk system on read error
This commit is contained in:
parent
feb4eecb05
commit
9d2021cf1f
1 changed files with 10 additions and 0 deletions
10
ponydos.asm
10
ponydos.asm
|
@ -214,8 +214,10 @@ read_sector:
|
||||||
; es:bx = output buffer
|
; es:bx = output buffer
|
||||||
mov bx, di
|
mov bx, di
|
||||||
|
|
||||||
|
.retry:
|
||||||
mov ax, 0x0201 ; read one sector
|
mov ax, 0x0201 ; read one sector
|
||||||
int 0x13
|
int 0x13
|
||||||
|
jc .error
|
||||||
|
|
||||||
pop dx
|
pop dx
|
||||||
pop cx
|
pop cx
|
||||||
|
@ -223,6 +225,14 @@ read_sector:
|
||||||
pop ax
|
pop ax
|
||||||
ret
|
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
|
; Mouse callback
|
||||||
; ------------------------------------------------------------------
|
; ------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue