Move hang func to separate module

This commit is contained in:
Alex Kotov 2022-01-28 00:02:58 +05:00
parent e8b31fa661
commit 7a53abea22
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
4 changed files with 12 additions and 13 deletions

View File

@ -9,13 +9,13 @@ CROSS="$BIN/i386-elf-"
STAGE1_LDFLAGS='--defsym=program_start=0x7c00'
STAGE2_LDFLAGS='--defsym=program_start=0x7e00'
STAGE1_OBJS="$SRC/header.o $SRC/print.o $SRC/stage1.o"
STAGE2_OBJS="$SRC/header.o $SRC/print.o $SRC/stage2.o"
STAGE1_OBJS="$SRC/header.o $SRC/common.o $SRC/stage1.o"
STAGE2_OBJS="$SRC/header.o $SRC/common.o $SRC/stage2.o"
./clean.sh
${CROSS}gcc -c $SRC/header.S -o $SRC/header.o
${CROSS}gcc -c $SRC/print.S -o $SRC/print.o
${CROSS}gcc -c $SRC/common.S -o $SRC/common.o
${CROSS}gcc -c $SRC/stage1.S -o $SRC/stage1.o
${CROSS}gcc -c $SRC/stage2.S -o $SRC/stage2.o

View File

@ -3,10 +3,16 @@
#endif
.code16
.global hang
.global print_char
.global print_str
.section .text
hang:
cli
hlt
jmp hang
do_ret:
ret

View File

@ -8,6 +8,7 @@
.code16
.global _start
.extern hang
.extern print_str
.section .rodata
@ -117,11 +118,7 @@ read_loop:
finish:
ljmp $0, $STAGE2_BASE
hang:
cli
hlt
jmp hang
ljmp $0, $hang
do_ret:
ret

View File

@ -41,8 +41,4 @@ teststr4: .string "Test string from sector 4\r\n"
sector4:
mov $hello4, %si
call print_str
hang:
cli
hlt
jmp hang
ljmp $0, $hang