blob: b9f17080640ba98914ae93af7b73b49177065674 [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 \
swissChili9b3584b2021-02-18 13:57:27 -08008 log.o \
9 irq.o \
swissChilidefeb0d2021-02-18 15:28:36 -080010 pic.o \
swissChili825d46b2021-02-21 10:14:16 -080011 timer.o \
12 paging.o \
13 switch_table.o
swissChilid8137922021-02-17 15:34:07 -080014CFLAGS = -nostdlib -nostdinc -fno-builtin -fno-stack-protector -ffreestanding -m32 -O2 -g
15LDFLAGS = -Tlink.ld -melf_i386
16ASMFLAGS = -felf
swissChili825d46b2021-02-21 10:14:16 -080017QEMUFLAGS = -d cpu_reset
swissChilid8137922021-02-17 15:34:07 -080018
19kernel.elf: $(SOURCES)
20 ld $(LDFLAGS) -o $@ $^
21
22clean:
swissChili0b35bf22021-02-18 12:49:40 -080023 rm -f *.o *.bin *.elf ../bin/*.iso
swissChilid8137922021-02-17 15:34:07 -080024
swissChili0b35bf22021-02-18 12:49:40 -080025debug: kernel.elf
26 qemu-system-i386 -s -S -kernel kernel.elf &
27 @echo run "target remote localhost:1234" to connect to qemu
28 gdb
29 @pkill qemu-system-i38
30
31qemu: kernel.elf
swissChili825d46b2021-02-21 10:14:16 -080032 qemu-system-i386 $(QEMUFLAGS) -monitor stdio -kernel kernel.elf -no-reboot
swissChili0b35bf22021-02-18 12:49:40 -080033
34qemu-iso: install
swissChili825d46b2021-02-21 10:14:16 -080035 qemu-system-i386 $(QEMUFLAGS) -monitor stdio ../bin/bluejay.iso
swissChilid8137922021-02-17 15:34:07 -080036
37.s.o:
38 nasm $(ASMFLAGS) $<
39
40install: kernel.elf
41 cp kernel.elf ../boot/
swissChili0b35bf22021-02-18 12:49:40 -080042 rm -f ../bin/bluejay.iso
swissChilid8137922021-02-17 15:34:07 -080043 grub-mkrescue -o ../bin/bluejay.iso ..
44
swissChili0b35bf22021-02-18 12:49:40 -080045.PHONY: install qemu clean qemu-iso debug