blob: 41333496a4182bdfd39bc72826b3543992ecab42 [file] [log] [blame]
swissChili2b5acc82021-03-13 17:06:42 -08001init(kernel, kernel.elf)
2
3preset(freestanding)
4preset(optimize)
5preset(debug)
6preset(32)
7preset(warn)
8preset(nasm)
9
10archetype(c)
11archetype(asm)
12
13depends(initrd, $(ROOT)/boot/initrd, initrd.img)
swissChili1a3f07f2021-04-05 20:01:55 -070014depends(ata_pio, dri/ata_pio, ata_pio.a)
15
16CFLAGS += -I $(ROOT)/include/kernel
swissChili2b5acc82021-03-13 17:06:42 -080017
swissChili64228692021-03-16 08:19:23 -070018LDFLAGS += -Tlink.ld -melf_i386
swissChili7be32742021-04-03 21:17:24 -070019ASMFLAGS += -felf -Fdwarf
swissChili2b5acc82021-03-13 17:06:42 -080020QEMUFLAGS = -d cpu_reset
21
22OBJECTS = boot.o \
23 main.o \
24 descriptor_tables.o \
25 io.o \
26 vga.o \
27 gdt_flush.o \
28 idt.o \
29 log.o \
30 irq.o \
31 pic.o \
32 timer.o \
33 paging.o \
34 switch_table.o \
35 scan_codes.o \
36 kheap.o \
37 alloc.o \
38 vfs.o \
39 multiboot.o \
swissChili64228692021-03-16 08:19:23 -070040 vfs_initrd.o \
swissChilie20b79b2021-03-17 21:20:13 -070041 syscall.o \
swissChilicfd3c3c2021-04-03 15:04:24 -070042 task.o \
swissChili1a3f07f2021-04-05 20:01:55 -070043 task_api.o \
44 lib(ata_pio)
swissChili2b5acc82021-03-13 17:06:42 -080045
46type(custom_link)
47
swissChilicfd3c3c2021-04-03 15:04:24 -070048debug-wait: kernel.elf
49 qemu-system-i386 -s -S -kernel kernel.elf
50
swissChili2b5acc82021-03-13 17:06:42 -080051debug: kernel.elf
52 qemu-system-i386 -s -S -kernel kernel.elf &
53 @echo run "target remote localhost:1234" to connect to qemu
swissChilicfd3c3c2021-04-03 15:04:24 -070054 gdb $<
swissChili2b5acc82021-03-13 17:06:42 -080055 @pkill qemu-system-i38
56
57qemu: kernel.elf
58 qemu-system-i386 $(QEMUFLAGS) -monitor stdio -kernel kernel.elf -no-reboot
59
60qemu-iso: install
61 qemu-system-i386 $(QEMUFLAGS) -monitor stdio $(ROOT)/bin/bluejay.iso
62
63scan_codes.c: gen_scan_codes.py scan_codes.tsv
64 python3 $< > $@
65
66install: kernel.elf lib(initrd)
67 cp kernel.elf $(ROOT)/boot/
68 rm -f $(ROOT)/bin/bluejay.iso
69 grub-mkrescue -o $(ROOT)/bin/bluejay.iso $(ROOT)
70
71finish