SteveOS for 16 bit processors (286)

Makefile 970B

    C_SOURCES=$(wildcard kernel/*.c util/*.c) HEADERS=$(wildcard kernel/*.h util/*.h) OBJ = ${C_SOURCES:.c=.o} #-g -> debugging. CFLAGS = -g -m16 -nostdlib -nostdinc -fno-builtin -fno-stack-protector -nostartfiles -nodefaultlibs \ -Wall -Wextra -Werror #Cross compiler CC = /home/stephen/opt/cross/bin/i686-elf-gcc GDB = /home/stephen/opt/cross/bin/i686-elf-gdb os.img: bootsect.bin kernel.bin cat $^ > Steve16.img kernel.bin: boot/knlent.o ${OBJ} #entry point at 0xBEEF (temporary) i686-elf-ld -o $@ -Ttext 0xBEEF $^ --oformat binary run: os.img qemu-system-i386 -drive file=Steve16.img,index=0,if=floppy,format=raw count: find . -name '*.asm' | xargs wc -l clean: rm -rf *.bin *.dis *.o Steve16.img *.elf rm -rf kernel/*.o util/*.o boot/*.bin # Generic rules for wildcards # To make an object, always compile from its .c %.o: %.c ${HEADERS} ${CC} ${CFLAGS} -ffreestanding -c $< -o $@ %.o: %.asm nasm $< -f elf -o $@ %.bin: %.asm nasm $< -f bin -o $@