remove iotest
This commit is contained in:
parent
2e93013e12
commit
0aad59dca9
2 changed files with 0 additions and 98 deletions
|
|
@ -1,36 +0,0 @@
|
|||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
CC := x86_64-elf-gcc
|
||||
LD := x86_64-elf-ld
|
||||
|
||||
OUT := iotest.elf
|
||||
CSRC :=
|
||||
SSRC := iotest.S
|
||||
OBJ := $(CSRC:.c=.o) $(SSRC:.S=.o)
|
||||
DEP := $(OBJ:.o=.d)
|
||||
|
||||
CFLAGS := -Wall -ffreestanding -mno-mmx -mno-sse2 -mno-sse -m64 -MMD -g
|
||||
LDFLAGS := -nostdlib -static -m elf_x86_64
|
||||
|
||||
CURDIR := $(shell pwd | awk -F '/' '{print $$(NF-1),"/",$$NF}' | sed 's/ //g')
|
||||
|
||||
$(OUT): $(OBJ)
|
||||
@$(LD) $^ $(LDFLAGS) -o $@
|
||||
@echo " USR.LD $(CURDIR)/$@"
|
||||
|
||||
-include $(DEP)
|
||||
|
||||
%.o: %.S
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
@echo " USR.CC $(CURDIR)/$@"
|
||||
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -c $< -o $@
|
||||
@echo " USR.CC $(CURDIR)/$@"
|
||||
|
||||
clean:
|
||||
@rm -rf $(OUT) $(OBJ) $(DEP)
|
||||
|
||||
install: $(OUT)
|
||||
@cp $(OUT) ../../bin
|
||||
@echo " INSTALL $(CURDIR)/$(OUT)"
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
/* ftest/ftest.S
|
||||
*
|
||||
* Test the read and write system calls.
|
||||
*/
|
||||
|
||||
sys_read = 0
|
||||
sys_write = 1
|
||||
sys_exit = 60
|
||||
|
||||
STDIN_FILENO = 0
|
||||
STDOUT_FILENO = 1
|
||||
|
||||
.macro print text text_size
|
||||
movl $sys_write, %eax
|
||||
movl $STDOUT_FILENO, %edi
|
||||
movq $\text, %rsi
|
||||
movl $\text_size, %edx
|
||||
int $0x80
|
||||
.endm
|
||||
|
||||
.text
|
||||
.global _start
|
||||
_start:
|
||||
_exit:
|
||||
print entry_message entry_message_size
|
||||
|
||||
movl $sys_read, %eax
|
||||
movl $STDIN_FILENO, %edi
|
||||
movq $buf, %rsi
|
||||
movl $buf_size, %edx
|
||||
int $0x80
|
||||
|
||||
movq %rax, %rdx
|
||||
movl $sys_write, %eax
|
||||
movl $STDOUT_FILENO, %edi
|
||||
movq $buf, %rsi
|
||||
int $0x80
|
||||
|
||||
movq %rax, %rdx
|
||||
movl $sys_write, %eax
|
||||
movl $STDOUT_FILENO, %edi
|
||||
movq $buf, %rsi
|
||||
int $0x80
|
||||
|
||||
movl $sys_exit, %eax
|
||||
movl $0, %edi
|
||||
int $0x80
|
||||
.data
|
||||
entry_message:
|
||||
.ascii "Please enter your text: "
|
||||
entry_message_size = . - entry_message
|
||||
|
||||
exit_message:
|
||||
.ascii "Exiting successfully\n"
|
||||
exit_message_size = . - exit_message
|
||||
|
||||
.bss
|
||||
buf:
|
||||
.skip 1024
|
||||
buf_size = . - buf
|
||||
Loading…
Reference in a new issue