diff --git a/other/editor.png b/other/editor.png index 0a3fe94..c322030 100644 Binary files a/other/editor.png and b/other/editor.png differ diff --git a/src/boot.asm b/src/boot.asm index a57c8bb..604b675 100644 --- a/src/boot.asm +++ b/src/boot.asm @@ -68,7 +68,14 @@ start: mov bl, byte [driveNumber] - ; Far jump to the kernel + ; Setup video mode + mov ax, 0x0003 + int 0x10 + mov ah, 0x0b + mov bx, 0x0001 + int 0x10 + + ; Far jump to the kernel (never returns) jmp KERNEL_LOC:0x0000 readFail: diff --git a/src/fs/edit.asm b/src/fs/edit.asm index faad2ee..24b72ae 100644 --- a/src/fs/edit.asm +++ b/src/fs/edit.asm @@ -2,7 +2,7 @@ launch: pusha - call resetTextMode + call clearText mov di, 0x0e60 ; Offset in vidmem (2nd to last line) mov si, statusBarMsg @@ -36,7 +36,7 @@ getHexCh: mov [hexByte], al jmp getHexCh .putByte: - cmp di, hexCode+256 + cmp di, hexCode+256 jge getHexCh ; Max length reached rol byte [hexByte], 4 or byte [hexByte], al @@ -60,6 +60,9 @@ getHexCh: call print jmp getHexCh .runInput: + mov si, runMsg + call print + pusha call hexCode ; Call the code popa @@ -101,12 +104,12 @@ return: jmp 0x2000:0x0000 ; - Includes - -%include "./src/lib/screen.asm" %include "./src/lib/print.asm" ; ------------ statusBarMsg: db " -- HEX -- ", 0 controlsMsg: db "'$' to execute code; '!' to quit", 0 +runMsg: db ENDL, ENDL, 0 ranMsg: db ENDL, ENDL, " - Finished Execution - ", ENDL, 0 backChars: db 8,8,8,' ',8,8,0 diff --git a/src/kernel.asm b/src/kernel.asm index a32b68d..9d10f94 100644 --- a/src/kernel.asm +++ b/src/kernel.asm @@ -9,6 +9,7 @@ start: xor bx, bx call resetTextMode + call clearText ; Print start message mov si, startMsg @@ -84,7 +85,7 @@ runCommand: mov di, clearCmd call .cmp - je clearScreen + je clear mov di, exitCmd call .cmp @@ -239,8 +240,8 @@ help: ; ; Clears the screen ; -clearScreen: - call resetTextMode +clear: + call clearText jmp input ; diff --git a/src/lib/print.asm b/src/lib/print.asm index 1da7901..e32255f 100644 --- a/src/lib/print.asm +++ b/src/lib/print.asm @@ -78,11 +78,26 @@ printHexByte: hexString: db "0x0000", 0 ; -; Clears the screen +; Clears the screen in text mode +; Assumes VGA text 3 - 80x25, 16 color ; -clear: +clearText: pusha - ; TODO: Make this function + push es + mov ax, 0x0b800 + mov es, ax + xor di, di ; es:di - b800:0000 + + mov al, ' ' ; Fill with spaces + mov ah, 0x17 ; White on blue + mov cx, 80*25 + rep stosw + + mov ah, 2 + xor dx, dx ; Set cursor to 0,0 + int 0x10 + + pop es popa ret