blob: 6ce6c273142ee90c8768c3136458c5a7dbd825d2 [file] [log] [blame]
swissChili9b3584b2021-02-18 13:57:27 -08001SOURCES = boot.o \
2 main.o \
3 descriptor_tables.o \
4 io.o \
5 vga.o \
6 gdt_flush.o \
7 idt.o \
8 interrupts.o \
9 log.o \
10 irq.o \
swissChilidefeb0d2021-02-18 15:28:36 -080011 pic.o \
12 timer.o
swissChilid8137922021-02-17 15:34:07 -080013CFLAGS = -nostdlib -nostdinc -fno-builtin -fno-stack-protector -ffreestanding -m32 -O2 -g
14LDFLAGS = -Tlink.ld -melf_i386
15ASMFLAGS = -felf
16
17kernel.elf: $(SOURCES)
18 ld $(LDFLAGS) -o $@ $^
19
20clean:
swissChili0b35bf22021-02-18 12:49:40 -080021 rm -f *.o *.bin *.elf ../bin/*.iso
swissChilid8137922021-02-17 15:34:07 -080022
swissChili0b35bf22021-02-18 12:49:40 -080023debug: kernel.elf
24 qemu-system-i386 -s -S -kernel kernel.elf &
25 @echo run "target remote localhost:1234" to connect to qemu
26 gdb
27 @pkill qemu-system-i38
28
29qemu: kernel.elf
30 qemu-system-i386 -monitor stdio -kernel kernel.elf
31
32qemu-iso: install
swissChilid8137922021-02-17 15:34:07 -080033 qemu-system-i386 -monitor stdio ../bin/bluejay.iso
34
35.s.o:
36 nasm $(ASMFLAGS) $<
37
38install: kernel.elf
39 cp kernel.elf ../boot/
swissChili0b35bf22021-02-18 12:49:40 -080040 rm -f ../bin/bluejay.iso
swissChilid8137922021-02-17 15:34:07 -080041 grub-mkrescue -o ../bin/bluejay.iso ..
42
swissChili0b35bf22021-02-18 12:49:40 -080043.PHONY: install qemu clean qemu-iso debug