luciaos/Makefile
Lucia Ceionia 192d4f04ed Fixed & Improved Makefile, Made V86 GPF handler not directly dereference
a null pointer - due to optimization breaking.
2022-09-16 15:50:58 -05:00

21 lines
707 B
Makefile

objects = entry.o kernel.o handler.o interrupt.o v86.o print.o
CFLAGS = -target "i686-elf" -m32 -ffreestanding -march=pentium-m -fno-stack-protector -nostdlib -c
%.o: %.nasm
nasm -f elf32 -o $@ $<
%.o: %.c
clang $(CFLAGS) -O2 $<
all: $(objects)
nasm boot.nasm -o boot.bin
# not sure why but if interrupt.c has any optimization everything just breaks immediately
gcc -Tlink.ld -m32 -ffreestanding -nostartfiles -nostdlib -o kernel.bin\
$(objects)
dd bs=256 count=1 conv=notrunc if=boot.bin of=virtdisk.bin
dd bs=512 seek=1 conv=notrunc if=kernel.bin of=virtdisk.bin
virtdisk:
dd bs=1M count=32 if=/dev/zero of=virtdisk.bin
echo -n -e '\x55\xaa' | dd bs=1 seek=510 conv=notrunc of=virtdisk.bin