hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2026-10-04 00:52:49 +0200
committerhachem <im@hachem.wtf>2026-10-04 00:52:49 +0200
commit627f05098785327744e666c9149375125499d2ff (patch)
treea72f3949e0729f1e73ad39ccb1809698a5ed8298 /Makefile
parent09982d80c45805715984cc1cae96c37e4fc148c3 (diff)
feat: revelfs type shi
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile20
1 files changed, 17 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 4d95142..ea96df8 100644
--- a/Makefile
+++ b/Makefile
@@ -9,8 +9,10 @@ QEMU ?= qemu-system-x86_64
KERNEL := zig-out/bin/revel
ISO := revel.iso
+DISK := revel-disk.img
+DISK_MB := 16
-.PHONY: all kernel iso run clean distclean
+.PHONY: all kernel iso run clean distclean wipedisk
all: iso
@@ -42,8 +44,20 @@ iso: kernel limine/limine
iso_root -o $(ISO)
./limine/limine bios-install $(ISO)
-run: iso
- $(QEMU) -M q35 -m 256M -cdrom $(ISO) -boot d -no-reboot -no-shutdown
+# persistent scratch disk for the filesystem. survives across boots and across
+# `make clean`, blow it away by hand or with `make wipedisk` if you want a fresh one
+$(DISK):
+ qemu-img create -f raw $(DISK) $(DISK_MB)M
+
+wipedisk:
+ rm -f $(DISK)
+
+# -M pc (i440fx) not q35, we want the piix3 legacy ide controller at the classic
+# 0x1F0 ports so the ata pio driver can find the disk. q35 only gives you ahci
+run: iso $(DISK)
+ $(QEMU) -M pc -m 256M -cdrom $(ISO) -boot d \
+ -drive file=$(DISK),format=raw,if=ide \
+ -no-reboot -no-shutdown
clean:
rm -rf iso_root zig-out .zig-cache $(ISO)