sh: Add shutdown command

This commit is contained in:
jn 2023-01-30 01:04:01 +01:00
parent 75a10ffdc3
commit 5641fc6987
3 changed files with 14 additions and 0 deletions

View File

@ -33,6 +33,11 @@ shell_parse_command:
call compare_string call compare_string
ifz jmp shell_help_command ifz jmp shell_help_command
; shutdown
mov r1, shell_shutdown_command_string
call compare_string
ifz jmp shell_shutdown_command
; type ; type
mov r1, shell_type_command_string mov r1, shell_type_command_string
call compare_string call compare_string
@ -57,3 +62,4 @@ shell_invalid_command_string: data.str "invalid command or FXF binary" data.8 10
#include "commands/exit.asm" #include "commands/exit.asm"
#include "commands/help.asm" #include "commands/help.asm"
#include "commands/type.asm" #include "commands/type.asm"
#include "commands/shutdown.asm"

View File

@ -21,6 +21,7 @@ shell_help_text:
data.str "exit | exit the shell" data.8 10 data.str "exit | exit the shell" data.8 10
data.str "help | show this help text" data.8 10 data.str "help | show this help text" data.8 10
data.str "type | print file $0 of type $1" data.8 10 data.str "type | print file $0 of type $1" data.8 10
data.str "shutdown| turn the computer off" data.8 10
data.8 10 data.8 10
data.str "type the name of an FXF binary to launch" data.8 10 data.str "type the name of an FXF binary to launch" data.8 10
data.str "it as a new task; the shell will suspend" data.8 10 data.str "it as a new task; the shell will suspend" data.8 10

View File

@ -0,0 +1,7 @@
; shutdown command
shell_shutdown_command_string: data.str "shutdown" data.8 0
shell_shutdown_command:
call poweroff
ret