mirror of https://github.com/tailix/loadwarka.git
Add main module
This commit is contained in:
parent
08af13d2f7
commit
f7de862e65
3
build.sh
3
build.sh
|
@ -10,13 +10,14 @@ STAGE1_LDFLAGS='--defsym=program_start=0x7c00'
|
||||||
STAGE2_LDFLAGS='--defsym=program_start=0x7e00'
|
STAGE2_LDFLAGS='--defsym=program_start=0x7e00'
|
||||||
|
|
||||||
STAGE1_OBJS="$SRC/common.o $SRC/stage1.o"
|
STAGE1_OBJS="$SRC/common.o $SRC/stage1.o"
|
||||||
STAGE2_OBJS="$SRC/common.o $SRC/stage2.o"
|
STAGE2_OBJS="$SRC/common.o $SRC/stage2.o $SRC/main.o"
|
||||||
|
|
||||||
./clean.sh
|
./clean.sh
|
||||||
|
|
||||||
${CROSS}gcc -c $SRC/common.S -o $SRC/common.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/stage1.S -o $SRC/stage1.o
|
||||||
${CROSS}gcc -c $SRC/stage2.S -o $SRC/stage2.o
|
${CROSS}gcc -c $SRC/stage2.S -o $SRC/stage2.o
|
||||||
|
${CROSS}gcc -c $SRC/main.c -o $SRC/main.o
|
||||||
|
|
||||||
${CROSS}ld -T$SRC/linker.ld -o $SRC/stage1.bin $STAGE1_LDFLAGS $STAGE1_OBJS
|
${CROSS}ld -T$SRC/linker.ld -o $SRC/stage1.bin $STAGE1_LDFLAGS $STAGE1_OBJS
|
||||||
${CROSS}ld -T$SRC/linker.ld -o $SRC/stage2.bin $STAGE2_LDFLAGS $STAGE2_OBJS
|
${CROSS}ld -T$SRC/linker.ld -o $SRC/stage2.bin $STAGE2_LDFLAGS $STAGE2_OBJS
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
}
|
|
@ -21,4 +21,6 @@ _start:
|
||||||
mov $newline, %si
|
mov $newline, %si
|
||||||
call print_str
|
call print_str
|
||||||
|
|
||||||
|
call main
|
||||||
|
|
||||||
ljmp $0, $hang
|
ljmp $0, $hang
|
||||||
|
|
Loading…
Reference in New Issue