Files
my-os-project2/Makefile
2025-08-05 20:53:07 +02:00

31 lines
774 B
Makefile

.PHONY: all disk clean
disk:
if [ ! -d limine ]; then \
git clone https://github.com/limine-bootloader/limine.git --branch=v9.x-binary --depth=1; \
make -C limine; \
fi
make -C kernel
rm -f disk.hdd
dd if=/dev/zero bs=1M count=0 seek=64 of=disk.hdd
PATH=$$PATH:/usr/sbin:/sbin sgdisk disk.hdd -n 1:2048 -t 1:ef00 -m 1
./limine/limine bios-install disk.hdd
mformat -i disk.hdd@@1M
mmd -i disk.hdd@@1M ::/EFI ::/EFI/BOOT ::/boot ::/boot/limine
mcopy -i disk.hdd@@1M kernel/mop2 ::/boot
mcopy -i disk.hdd@@1M limine.conf limine/limine-bios.sys ::/boot/limine
mcopy -i disk.hdd@@1M limine/BOOTX64.EFI ::/EFI/BOOT
clean:
rm -rf limine disk.hdd
make -C kernel clean
all: disk
run:
qemu-system-x86_64 \
-d guest_errors \
-serial stdio \
-hda disk.hdd