Linker script now makes use of kernel32_strap.asm in order to ensure that we enter the correct position in kernel32.bin, updated kernel32.ld, Makefile, etc accordingly. Added types.h for convenience.

This commit is contained in:
2021-09-02 12:46:14 +01:00
parent 1905f3babd
commit 76e61b1d71
5 changed files with 70 additions and 22 deletions
+7 -5
View File
@@ -1,5 +1,4 @@
CFLAGS = -m32 -nostdlib -fno-builtin -fno-exceptions -fno-leading-underscore -fno-pie
CFLAGS = -m32 -nostdlib -fno-builtin -fno-exceptions -fno-leading-underscore -fno-pie -fno-stack-protector
LDFLAGS =
disk.img: boot.sector kernel.bin hello.bin print.bin hello.txt boot32.bin kernel32.bin
@@ -26,8 +25,11 @@ print.bin: print.asm
boot32.bin: boot32.asm
nasm $< -o $@
kernel32.bin: kernel32.ld kernel32.o
ld $(LDFLAGS) -T $< -o $@ kernel32.o
kernel32.bin: kernel32.ld kernel32_strap.o kernel32.o
ld $(LDFLAGS) -T $<
kernel32.o: kernel32.c
gcc $(CFLAGS) -o $@ -c $<
gcc $(CFLAGS) -o $@ -c $<
kernel32_strap.o: kernel32_strap.asm
nasm -felf32 $< -o $@