swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 1 | init(kernel, kernel.elf) |
| 2 | |
| 3 | preset(freestanding) |
| 4 | preset(optimize) |
| 5 | preset(debug) |
| 6 | preset(32) |
| 7 | preset(warn) |
| 8 | preset(nasm) |
| 9 | |
| 10 | archetype(c) |
| 11 | archetype(asm) |
| 12 | |
| 13 | depends(initrd, $(ROOT)/boot/initrd, initrd.img) |
| 14 | |
swissChili | 6422869 | 2021-03-16 08:19:23 -0700 | [diff] [blame] | 15 | LDFLAGS += -Tlink.ld -melf_i386 |
swissChili | 7be3274 | 2021-04-03 21:17:24 -0700 | [diff] [blame] | 16 | ASMFLAGS += -felf -Fdwarf |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 17 | QEMUFLAGS = -d cpu_reset |
| 18 | |
| 19 | OBJECTS = boot.o \ |
| 20 | main.o \ |
| 21 | descriptor_tables.o \ |
| 22 | io.o \ |
| 23 | vga.o \ |
| 24 | gdt_flush.o \ |
| 25 | idt.o \ |
| 26 | log.o \ |
| 27 | irq.o \ |
| 28 | pic.o \ |
| 29 | timer.o \ |
| 30 | paging.o \ |
| 31 | switch_table.o \ |
| 32 | scan_codes.o \ |
| 33 | kheap.o \ |
| 34 | alloc.o \ |
| 35 | vfs.o \ |
| 36 | multiboot.o \ |
swissChili | 6422869 | 2021-03-16 08:19:23 -0700 | [diff] [blame] | 37 | vfs_initrd.o \ |
swissChili | e20b79b | 2021-03-17 21:20:13 -0700 | [diff] [blame] | 38 | syscall.o \ |
swissChili | cfd3c3c | 2021-04-03 15:04:24 -0700 | [diff] [blame] | 39 | task.o \ |
| 40 | task_api.o |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 41 | |
| 42 | type(custom_link) |
| 43 | |
swissChili | cfd3c3c | 2021-04-03 15:04:24 -0700 | [diff] [blame] | 44 | debug-wait: kernel.elf |
| 45 | qemu-system-i386 -s -S -kernel kernel.elf |
| 46 | |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 47 | debug: kernel.elf |
| 48 | qemu-system-i386 -s -S -kernel kernel.elf & |
| 49 | @echo run "target remote localhost:1234" to connect to qemu |
swissChili | cfd3c3c | 2021-04-03 15:04:24 -0700 | [diff] [blame] | 50 | gdb $< |
swissChili | 2b5acc8 | 2021-03-13 17:06:42 -0800 | [diff] [blame] | 51 | @pkill qemu-system-i38 |
| 52 | |
| 53 | qemu: kernel.elf |
| 54 | qemu-system-i386 $(QEMUFLAGS) -monitor stdio -kernel kernel.elf -no-reboot |
| 55 | |
| 56 | qemu-iso: install |
| 57 | qemu-system-i386 $(QEMUFLAGS) -monitor stdio $(ROOT)/bin/bluejay.iso |
| 58 | |
| 59 | scan_codes.c: gen_scan_codes.py scan_codes.tsv |
| 60 | python3 $< > $@ |
| 61 | |
| 62 | install: kernel.elf lib(initrd) |
| 63 | cp kernel.elf $(ROOT)/boot/ |
| 64 | rm -f $(ROOT)/bin/bluejay.iso |
| 65 | grub-mkrescue -o $(ROOT)/bin/bluejay.iso $(ROOT) |
| 66 | |
| 67 | finish |