usr.bin: add shtest
shtest is a simple userland shell test program that accepts input and echoes it back to the user
This commit is contained in:
parent
be6cac591c
commit
3b1dc7e153
4 changed files with 96 additions and 1 deletions
19
usr.bin/shtest/syscall.S
Normal file
19
usr.bin/shtest/syscall.S
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/* syscall handler for simple userland shell test */
|
||||
|
||||
#define __ASM__
|
||||
|
||||
.macro _sc_define name, num
|
||||
.global \name
|
||||
\name:
|
||||
movq $\num, %rax
|
||||
movq %rcx, %r10
|
||||
int $0x80
|
||||
ret
|
||||
.endm
|
||||
|
||||
_sc_define read, 0
|
||||
_sc_define write, 1
|
||||
_sc_define open, 2
|
||||
_sc_define close, 3
|
||||
_sc_define exit, 60
|
||||
Loading…
Reference in a new issue