swissChili | 9b46c90 | 2022-07-10 15:48:46 -0700 | [diff] [blame] | 1 | # -*- tcl -*- |
| 2 | |
| 3 | ldflags -T[pwd]/link.ld -melf_i386 |
| 4 | asmflags -felf -Fdwarf |
| 5 | set qemuflags "-drive file=hd0_ext2.img,format=raw" |
| 6 | |
| 7 | depends sys $root/src/libsys libsys.a |
| 8 | depends initrd $root/boot/initrd initrd.img |
| 9 | depends ata_pio dri/ata_pio ata_pio.a |
| 10 | depends pci dri/pci pci.a |
| 11 | depends ide dri/ide ide.a |
| 12 | depends ext2 dri/fs/ext2 ext2.a |
| 13 | |
| 14 | option FS ext2 |
| 15 | |
| 16 | srcs boot.s \ |
| 17 | main.c \ |
| 18 | descriptor_tables.c \ |
| 19 | io.c \ |
| 20 | vga.c \ |
| 21 | gdt_flush.s \ |
| 22 | tss_flush.s \ |
| 23 | idt.s \ |
| 24 | log.c \ |
swissChili | 0db9775 | 2022-07-29 21:09:16 -0700 | [diff] [blame] | 25 | irq.s \ |
swissChili | 9b46c90 | 2022-07-10 15:48:46 -0700 | [diff] [blame] | 26 | pic.c \ |
| 27 | timer.c \ |
| 28 | paging.c \ |
| 29 | switch_table.s \ |
| 30 | kheap.c \ |
| 31 | alloc.c \ |
| 32 | vfs.c \ |
| 33 | multiboot.c \ |
| 34 | vfs_initrd.c \ |
| 35 | syscall.c \ |
| 36 | task.c \ |
| 37 | task_api.s \ |
| 38 | faults.c \ |
| 39 | sync.c |
| 40 | |
| 41 | objs [lib ext2] \ |
| 42 | [lib ide] \ |
| 43 | [lib ata_pio] \ |
| 44 | [lib pci] \ |
| 45 | [lib sys] |
| 46 | |
| 47 | rule debug-wait kernel.elf { |
| 48 | shell "qemu-system-i386 -s -S $::qemuflags -kernel kernel.efl" |
| 49 | } |
| 50 | rule debug kernel.elf { |
| 51 | shell "qemu-system-i386 -s -S $::qemuflags -kernel kernel.efl" |
| 52 | shell "echo run target remote localhost:1234 to connect to qemu" |
| 53 | shell "gdb $::first_src" |
| 54 | shell "pkill qemu-system-i386" |
| 55 | } |
| 56 | |
| 57 | rule qemu "kernel.elf hd0_$::options(FS).img" { |
| 58 | shell "qemu-system-i386 $::qemuflags -d cpu_reset -monitor stdio -kernel kernel.elf -no-reboot" |
| 59 | } |