More minor changes

This commit is contained in:
2023-12-26 21:25:58 +01:00
parent 39f7dba229
commit fee0869fad
4 changed files with 13 additions and 3 deletions
+3
View File
@@ -22,5 +22,8 @@ cat build/calc.bin build/edit.bin > build/files.bin
# Final binary # Final binary
cat build/bootloader.bin build/kernel.bin build/files.bin > build/kern.bin cat build/bootloader.bin build/kernel.bin build/files.bin > build/kern.bin
# Cleanup
rm build/*[!kern].bin
# Run QEMU # Run QEMU
qemu-system-x86_64 -drive format=raw,file="./build/kern.bin",index=0,media=disk -m 256M qemu-system-x86_64 -drive format=raw,file="./build/kern.bin",index=0,media=disk -m 256M
+4 -2
View File
@@ -11,9 +11,8 @@ launch:
mov si, controlsMsg mov si, controlsMsg
call drawString call drawString
xor cx, cx
mov di, hexCode mov di, hexCode
xor cx, cx ; Clear counter
getHexCh: getHexCh:
xor ax, ax xor ax, ax
int 0x16 int 0x16
@@ -44,6 +43,7 @@ getHexCh:
stosb stosb
mov dx, [hexByte] mov dx, [hexByte]
call printHexByte call printHexByte
inc byte [codeLen]
xor cx, cx xor cx, cx
mov al, ' ' mov al, ' '
mov ah, 0x0e mov ah, 0x0e
@@ -51,6 +51,7 @@ getHexCh:
jmp getHexCh jmp getHexCh
.backspace: .backspace:
mov byte [hexByte], 0 mov byte [hexByte], 0
dec byte [codeLen]
xor cx, cx xor cx, cx
cmp di, hexByte ; Check if there's anything to delete cmp di, hexByte ; Check if there's anything to delete
je getHexCh ; If not, ignore je getHexCh ; If not, ignore
@@ -116,6 +117,7 @@ backChars: db 8,8,8,' ',8,8,0
hexByte: db 0 hexByte: db 0
codeLen: db 0
hexCode: times 256 db 0 ; Code buffer hexCode: times 256 db 0 ; Code buffer
ret ret
+1 -1
View File
@@ -4,7 +4,7 @@ start:
; Save the drive number from stack ; Save the drive number from stack
mov byte [driveNumber], dl mov byte [driveNumber], dl
mov bx, 0x8000 mov bx, 0x2000
mov es, bx mov es, bx
xor bx, bx xor bx, bx
+5
View File
@@ -0,0 +1,5 @@
;
; Loads a file from the filetable into a memory location
;
loadFile: