Reset disk system on read error

This commit is contained in:
Juhani Krekelä 2023-03-13 14:40:28 +02:00
parent feb4eecb05
commit 9d2021cf1f
1 changed files with 10 additions and 0 deletions

View File

@ -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
; ------------------------------------------------------------------