forked from PoliEcho-holding-org/kern
Added shutdown command
This commit is contained in:
@@ -34,3 +34,8 @@ Graphics mode test: \
|
|||||||

|

|
||||||
|
|
||||||
_These images may be outdated, Idk_
|
_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)
|
||||||
|
|||||||
@@ -68,6 +68,10 @@ runCommand:
|
|||||||
call .cmp
|
call .cmp
|
||||||
je clearScreen
|
je clearScreen
|
||||||
|
|
||||||
|
mov di, exitCmd
|
||||||
|
call .cmp
|
||||||
|
je shutdown
|
||||||
|
|
||||||
jmp .end
|
jmp .end
|
||||||
.cmp:
|
.cmp:
|
||||||
push cx
|
push cx
|
||||||
@@ -221,6 +225,15 @@ clearScreen:
|
|||||||
call resetTextMode
|
call resetTextMode
|
||||||
jmp input
|
jmp input
|
||||||
|
|
||||||
|
;
|
||||||
|
; Shuts the system down
|
||||||
|
; Only works for QEMU
|
||||||
|
;
|
||||||
|
shutdown:
|
||||||
|
mov ax, 0x2000
|
||||||
|
mov dx, 0x0604
|
||||||
|
out dx, ax
|
||||||
|
|
||||||
;
|
;
|
||||||
; File list (ls)
|
; File list (ls)
|
||||||
;
|
;
|
||||||
@@ -395,6 +408,7 @@ fileListMsg: db " Filename E# St Size ", ENDL, \
|
|||||||
helpMsg: db "Available Commands:", ENDL, \
|
helpMsg: db "Available Commands:", ENDL, \
|
||||||
" clear | Clears the screen", ENDL, \
|
" clear | Clears the screen", ENDL, \
|
||||||
" edit | Opens the code editor", ENDL, \
|
" edit | Opens the code editor", ENDL, \
|
||||||
|
" exit | Shuts the system down", ENDL, \
|
||||||
" gfx | Graphics mode test", ENDL, \
|
" gfx | Graphics mode test", ENDL, \
|
||||||
" help | Prints this message", ENDL, \
|
" help | Prints this message", ENDL, \
|
||||||
" ls | List all files", ENDL, \
|
" ls | List all files", ENDL, \
|
||||||
@@ -406,6 +420,7 @@ clearCmd: db "clear", 0
|
|||||||
gfxCmd: db "gfx", 0
|
gfxCmd: db "gfx", 0
|
||||||
helpCmd: db "help", 0
|
helpCmd: db "help", 0
|
||||||
lsCmd: db "ls", 0
|
lsCmd: db "ls", 0
|
||||||
|
exitCmd: db "exit"
|
||||||
rebootCmd: db "reboot", 0
|
rebootCmd: db "reboot", 0
|
||||||
|
|
||||||
; Files
|
; Files
|
||||||
|
|||||||
Reference in New Issue
Block a user