From 9d2021cf1f374da5a23e49cbc2c0040c8ac558e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Krekel=C3=A4?= Date: Mon, 13 Mar 2023 14:40:28 +0200 Subject: [PATCH] Reset disk system on read error --- ponydos.asm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ponydos.asm b/ponydos.asm index 9b1d8b6..3a9dc5e 100644 --- a/ponydos.asm +++ b/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 ; ------------------------------------------------------------------