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