From dd139699af289285891596830277449e0a313903 Mon Sep 17 00:00:00 2001 From: CrazyEttin <> Date: Thu, 24 Jun 2021 20:30:49 +0300 Subject: [PATCH] =?UTF-8?q?Change=20loadf=20so=20that=20it=20aborts=20if?= =?UTF-8?q?=20the=20load=20fails=20and=20so=20that=20it=20doesn=E2=80=99t?= =?UTF-8?q?=20print=20error=20messages=20itself,=20only=20sends=20an=20err?= =?UTF-8?q?or=20code=20to=20the=20program=20that=20called=20it.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/LOADF.INC | 13 ++++--------- src/SYSTEM.ASM | 10 ++-------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/src/LOADF.INC b/src/LOADF.INC index 6d8b8d0..3136fd8 100644 --- a/src/LOADF.INC +++ b/src/LOADF.INC @@ -53,13 +53,10 @@ pop ax call .checkconv jmp .extloop -;Set the carry flag and print an error message if the file name is invalid +;Set the carry flag if the file name is invalid .error: pop ax stc -mov si, .errormsg -mov ah, 0x2 -int 0x21 jmp .done ;Find and load the file @@ -81,6 +78,8 @@ mov al, 0x1 ;Load mov ah, 0x2 int 0x13 +;Abort if the load failed +jc .done ;Store the disk values used for the rest of the call mov ax, word [buffer + 0xb] @@ -146,11 +145,8 @@ add di, ax pop cx loop .search -;Set the carry flag and print an error message if the file is not found +;Set the carry flag if the file is not found stc -mov si, .errormsg -mov ah, 0x2 -int 0x21 jmp .clearstack ;Load the file entry @@ -261,7 +257,6 @@ iret .sectorspertrack dw 0x0 .sides dw 0x0 .file times 0xb db 0x20 -.errormsg db "File not found", 0x0 .cluster dw 0x0 .pointer dw 0x0 diff --git a/src/SYSTEM.ASM b/src/SYSTEM.ASM index 8d8d215..6c0a1d1 100644 --- a/src/SYSTEM.ASM +++ b/src/SYSTEM.ASM @@ -77,7 +77,7 @@ mov ah, 0x0 int 0x21 ;Read mov di, input -mov al, 0x4e +mov al, 0x4c mov ah, 0x3 int 0x21 @@ -105,12 +105,6 @@ jmp 0x2000 ;Print a command error message and return to the shell cmderror: -mov bh, 0x0 -mov ah, 0x3 -int 0x10 -dec dh -mov ah, 0x2 -int 0x10 mov si, cmderrormsg mov ah, 0x2 int 0x21 @@ -169,7 +163,7 @@ welcomemsg db 0xd, 0xa, "Welcome to EttinOS!", 0xd, 0xa, 0x0 prompt db "> ", 0x0 driverrormsg db "Unknown drive", 0x0 cmderrormsg db "Unknown command", 0x0 -input times 0x4e db 0x0 +input times 0x4c db 0x0 crlf db 0xd, 0xa, 0x0 ;Set the drive letter