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:
@@ -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 $@
|
||||
Reference in New Issue
Block a user