blob: 23ef8f4af181d97e481562a7cf85cf54b135d3b5 [file] [log] [blame]
swissChili0b35bf22021-02-18 12:49:40 -08001SOURCES = boot.o main.o descriptor_tables.o mem.o vga.o gdt_flush.o idt.o interrupts.o log.o
swissChilid8137922021-02-17 15:34:07 -08002CFLAGS = -nostdlib -nostdinc -fno-builtin -fno-stack-protector -ffreestanding -m32 -O2 -g
3LDFLAGS = -Tlink.ld -melf_i386
4ASMFLAGS = -felf
5
6kernel.elf: $(SOURCES)
7 ld $(LDFLAGS) -o $@ $^
8
9clean:
swissChili0b35bf22021-02-18 12:49:40 -080010 rm -f *.o *.bin *.elf ../bin/*.iso
swissChilid8137922021-02-17 15:34:07 -080011
swissChili0b35bf22021-02-18 12:49:40 -080012debug: kernel.elf
13 qemu-system-i386 -s -S -kernel kernel.elf &
14 @echo run "target remote localhost:1234" to connect to qemu
15 gdb
16 @pkill qemu-system-i38
17
18qemu: kernel.elf
19 qemu-system-i386 -monitor stdio -kernel kernel.elf
20
21qemu-iso: install
swissChilid8137922021-02-17 15:34:07 -080022 qemu-system-i386 -monitor stdio ../bin/bluejay.iso
23
24.s.o:
25 nasm $(ASMFLAGS) $<
26
27install: kernel.elf
28 cp kernel.elf ../boot/
swissChili0b35bf22021-02-18 12:49:40 -080029 rm -f ../bin/bluejay.iso
swissChilid8137922021-02-17 15:34:07 -080030 grub-mkrescue -o ../bin/bluejay.iso ..
31
swissChili0b35bf22021-02-18 12:49:40 -080032.PHONY: install qemu clean qemu-iso debug