blob: 511afef4d760109f4327e419ed0b8ea8c38f4ff2 [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 \
11 pic.o
swissChilid8137922021-02-17 15:34:07 -080012CFLAGS = -nostdlib -nostdinc -fno-builtin -fno-stack-protector -ffreestanding -m32 -O2 -g
13LDFLAGS = -Tlink.ld -melf_i386
14ASMFLAGS = -felf
15
16kernel.elf: $(SOURCES)
17 ld $(LDFLAGS) -o $@ $^
18
19clean:
swissChili0b35bf22021-02-18 12:49:40 -080020 rm -f *.o *.bin *.elf ../bin/*.iso
swissChilid8137922021-02-17 15:34:07 -080021
swissChili0b35bf22021-02-18 12:49:40 -080022debug: kernel.elf
23 qemu-system-i386 -s -S -kernel kernel.elf &
24 @echo run "target remote localhost:1234" to connect to qemu
25 gdb
26 @pkill qemu-system-i38
27
28qemu: kernel.elf
29 qemu-system-i386 -monitor stdio -kernel kernel.elf
30
31qemu-iso: install
swissChilid8137922021-02-17 15:34:07 -080032 qemu-system-i386 -monitor stdio ../bin/bluejay.iso
33
34.s.o:
35 nasm $(ASMFLAGS) $<
36
37install: kernel.elf
38 cp kernel.elf ../boot/
swissChili0b35bf22021-02-18 12:49:40 -080039 rm -f ../bin/bluejay.iso
swissChilid8137922021-02-17 15:34:07 -080040 grub-mkrescue -o ../bin/bluejay.iso ..
41
swissChili0b35bf22021-02-18 12:49:40 -080042.PHONY: install qemu clean qemu-iso debug