com32/b

21 lines
728 B
Plaintext
Raw Permalink Normal View History

2024-01-10 11:13:45 -08:00
#!/bin/sh
# needs to be configured in boot.s as well
LDADDR=0x100000
BNAME=32.com
[ "$1" = "init" ] && for i in tool/*.c; do cc $i -O3 -o $(echo "$i" | sed 's/\.c$//') | true; done &&
tool/genisr > include/isr.i
[ "$1" = "clean" ] && rm obj/* $BNAME
[ "$1" = "prog" ] && for i in src/*.s; do nasm -felf $i; done &&
for i in src/*.c; do i386-elf-gcc -c $i -ffreestanding -Iinclude -Os | true; done &&
mv *.o src/*.o obj &&
i386-elf-ld -o obj/kernel -Ttext $LDADDR obj/entry.o $(ls obj/*.o | grep -v entry.o) --oformat binary &&
cat obj/boot obj/kernel > $BNAME
[ -z "$1" ] && nasm boot/boot.s -o obj/boot | true && $0 prog | true
[ "$1" = "all" ] && ./b clean | true && ./b | true && dosbox-x $BNAME | true