diff --git a/README.md b/README.md index b76a5fa..97dc021 100644 --- a/README.md +++ b/README.md @@ -34,3 +34,8 @@ Graphics mode test: \ ![Graphics Test](other/graphics.png) _These images may be outdated, Idk_ + +## Known issues +- If you run the kernel.bin, loading files sorta breaks, because the program is running at 0x8000, but it thinks that it's at 0x2000 (i think) +- If you run anything in the code editor and return to the kernel, you won't be able to load any files +- If you type only the starting letters of a command, it will still run (ie. 'he' will run help) diff --git a/src/kernel.asm b/src/kernel.asm index a2e63ca..9fee672 100644 --- a/src/kernel.asm +++ b/src/kernel.asm @@ -68,6 +68,10 @@ runCommand: call .cmp je clearScreen + mov di, exitCmd + call .cmp + je shutdown + jmp .end .cmp: push cx @@ -221,6 +225,15 @@ clearScreen: call resetTextMode jmp input +; +; Shuts the system down +; Only works for QEMU +; +shutdown: + mov ax, 0x2000 + mov dx, 0x0604 + out dx, ax + ; ; File list (ls) ; @@ -395,6 +408,7 @@ fileListMsg: db " Filename E# St Size ", ENDL, \ helpMsg: db "Available Commands:", ENDL, \ " clear | Clears the screen", ENDL, \ " edit | Opens the code editor", ENDL, \ + " exit | Shuts the system down", ENDL, \ " gfx | Graphics mode test", ENDL, \ " help | Prints this message", ENDL, \ " ls | List all files", ENDL, \ @@ -406,6 +420,7 @@ clearCmd: db "clear", 0 gfxCmd: db "gfx", 0 helpCmd: db "help", 0 lsCmd: db "ls", 0 +exitCmd: db "exit" rebootCmd: db "reboot", 0 ; Files