shell: Add clear
command
This commit is contained in:
parent
c321e54cfb
commit
c6919d4168
22
kernel/shell/commands/clear.asm
Normal file
22
kernel/shell/commands/clear.asm
Normal file
|
@ -0,0 +1,22 @@
|
|||
; clear command
|
||||
|
||||
const FILL_TERM: 0xF0
|
||||
const MOVE_CURSOR: 0xF1
|
||||
|
||||
shell_clear_command_string: data.str "clear" data.8 0
|
||||
|
||||
shell_clear_command:
|
||||
movz.8 r0, FILL_TERM
|
||||
call print_character_to_terminal
|
||||
movz.8 r0, 0
|
||||
call print_character_to_terminal
|
||||
call print_character_to_terminal
|
||||
|
||||
movz.8 r0, MOVE_CURSOR
|
||||
call print_character_to_terminal
|
||||
movz.8 r0, 0
|
||||
call print_character_to_terminal
|
||||
movz.8 r0, 0
|
||||
call print_character_to_terminal
|
||||
|
||||
ret
|
|
@ -3,6 +3,11 @@
|
|||
shell_parse_command:
|
||||
mov r0, shell_text_buf_bottom
|
||||
|
||||
; clear
|
||||
mov r1, shell_clear_command_string
|
||||
call compare_string
|
||||
ifz jmp shell_clear_command
|
||||
|
||||
; dir
|
||||
mov r1, shell_dir_command_string
|
||||
call compare_string
|
||||
|
@ -45,6 +50,7 @@ shell_parse_command:
|
|||
shell_invalid_command_string: data.str "invalid command or FXF binary" data.8 10 data.8 0
|
||||
|
||||
; all commands
|
||||
#include "shell/commands/clear.asm"
|
||||
#include "shell/commands/dir.asm"
|
||||
#include "shell/commands/disk.asm"
|
||||
#include "shell/commands/diskrm.asm"
|
||||
|
|
|
@ -14,6 +14,7 @@ shell_help_text:
|
|||
data.str "(in descriptions, $n is argument n)" data.8 10
|
||||
data.str "command | description" data.8 10
|
||||
data.str "------- | -----------" data.8 10
|
||||
data.str "clear | clear the terminal contents" data.8 10
|
||||
data.str "dir | show contents of selected disk" data.8 10
|
||||
data.str "disk | select disk $0" data.8 10
|
||||
data.str "diskrm | remove disk $0" data.8 10
|
||||
|
|
Loading…
Reference in New Issue
Block a user