From 057e5377af2d086917b9cd0ffb336231d7d098cb Mon Sep 17 00:00:00 2001 From: user Date: Thu, 16 Jul 2026 11:42:38 +0200 Subject: fs rewrite stage 1: persistent block device (bounce buffer, cart SRAM) - blk.asm: read_block/write_block move 256-byte blocks between battery-backed cart-RAM banks (8-11, the 'disk') and a WRAM bounce buffer. Banking is hidden in those two routines; they inline the 'restore my bank' step so they never touch the stack while the disk bank is mapped over the process's $A000 window (the stack lives there too -- a call/ret would rug-pull it). - format-on-first-boot: superblock magic in block 0; otherwise the disk persists. - cart RAM bumped to 128 KiB (-r 4); process banks 0-7, disk banks 8-11. - debug tool 'blk fill/peek' + syscalls to validate round-trip and persistence. - verified: round-trip incl. cross-bank (block 100 -> bank 11); block survives a reboot via .sav; magic intact (no reformat on 2nd boot). - old WRAM 8-slot FS still backs the tools until stages 2-3. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index a3a4b2b..87a7d9d 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,7 @@ OBJS := $(patsubst src/%.asm,$(BUILD)/%.o,$(SRCS)) ASFLAGS := -I include -Wall # MBC5 + RAM + battery; -r 3 = 32 KiB cart RAM (bump for more task banks) -FIXFLAGS := -v -m MBC5+RAM+BATTERY -r 3 -p 0xFF -t GBOS +FIXFLAGS := -v -m MBC5+RAM+BATTERY -r 4 -p 0xFF -t GBOS .PHONY: all clean run @@ -20,7 +20,7 @@ $(BUILD)/%.o: src/%.asm | $(BUILD) # C programs: compiled with SDCC into ROM-bank blobs and INCBIN'd by programs.asm CBLOBS := c/chello.bin c/echo.bin c/true.bin c/false.bin c/uname.bin \ c/pid.bin c/cat.bin c/wc.bin c/head.bin c/args.bin \ - c/ls.bin c/save.bin c/rm.bin c/sh.bin c/ps.bin c/kill.bin c/spin.bin + c/ls.bin c/save.bin c/rm.bin c/sh.bin c/ps.bin c/kill.bin c/spin.bin c/blk.bin $(BUILD)/programs.o: $(CBLOBS) # C programs also depend on the shared libc sources -- cgit v1.3.1-sl0p