From fee0869fadaff5577df2d6c3ef1c35e888bac00e Mon Sep 17 00:00:00 2001 From: Tom-on64 Date: Tue, 26 Dec 2023 21:25:58 +0100 Subject: [PATCH] More minor changes --- build.sh | 3 +++ src/fs/edit.asm | 6 ++++-- src/kernel.asm | 2 +- src/lib/disk.asm | 5 +++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 src/lib/disk.asm diff --git a/build.sh b/build.sh index 4ecfd5f..da64c24 100644 --- a/build.sh +++ b/build.sh @@ -22,5 +22,8 @@ cat build/calc.bin build/edit.bin > build/files.bin # Final binary cat build/bootloader.bin build/kernel.bin build/files.bin > build/kern.bin +# Cleanup +rm build/*[!kern].bin + # Run QEMU qemu-system-x86_64 -drive format=raw,file="./build/kern.bin",index=0,media=disk -m 256M diff --git a/src/fs/edit.asm b/src/fs/edit.asm index 24b72ae..fa11b32 100644 --- a/src/fs/edit.asm +++ b/src/fs/edit.asm @@ -11,9 +11,8 @@ launch: mov si, controlsMsg call drawString - xor cx, cx mov di, hexCode - + xor cx, cx ; Clear counter getHexCh: xor ax, ax int 0x16 @@ -44,6 +43,7 @@ getHexCh: stosb mov dx, [hexByte] call printHexByte + inc byte [codeLen] xor cx, cx mov al, ' ' mov ah, 0x0e @@ -51,6 +51,7 @@ getHexCh: jmp getHexCh .backspace: mov byte [hexByte], 0 + dec byte [codeLen] xor cx, cx cmp di, hexByte ; Check if there's anything to delete je getHexCh ; If not, ignore @@ -116,6 +117,7 @@ backChars: db 8,8,8,' ',8,8,0 hexByte: db 0 +codeLen: db 0 hexCode: times 256 db 0 ; Code buffer ret diff --git a/src/kernel.asm b/src/kernel.asm index 9d10f94..3fb55e1 100644 --- a/src/kernel.asm +++ b/src/kernel.asm @@ -4,7 +4,7 @@ start: ; Save the drive number from stack mov byte [driveNumber], dl - mov bx, 0x8000 + mov bx, 0x2000 mov es, bx xor bx, bx diff --git a/src/lib/disk.asm b/src/lib/disk.asm new file mode 100644 index 0000000..e568ae2 --- /dev/null +++ b/src/lib/disk.asm @@ -0,0 +1,5 @@ +; +; Loads a file from the filetable into a memory location +; +loadFile: + \ No newline at end of file