blob: 9a672954a3b64060e8278bc5073f5bfd068d8ad6 [file] [log] [blame]
swissChili9b46c902022-07-10 15:48:46 -07001# -*- tcl -*-
2
3ldflags -T[pwd]/link.ld -melf_i386
4asmflags -felf -Fdwarf
5set qemuflags "-drive file=hd0_ext2.img,format=raw"
6
7depends sys $root/src/libsys libsys.a
8depends initrd $root/boot/initrd initrd.img
9depends ata_pio dri/ata_pio ata_pio.a
10depends pci dri/pci pci.a
11depends ide dri/ide ide.a
12depends ext2 dri/fs/ext2 ext2.a
13
14option FS ext2
15
16srcs 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 \
swissChili0db97752022-07-29 21:09:16 -070025 irq.s \
swissChili9b46c902022-07-10 15:48:46 -070026 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
41objs [lib ext2] \
42 [lib ide] \
43 [lib ata_pio] \
44 [lib pci] \
45 [lib sys]
46
47rule debug-wait kernel.elf {
48 shell "qemu-system-i386 -s -S $::qemuflags -kernel kernel.efl"
49}
50rule 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
57rule qemu "kernel.elf hd0_$::options(FS).img" {
58 shell "qemu-system-i386 $::qemuflags -d cpu_reset -monitor stdio -kernel kernel.elf -no-reboot"
59}