From 4f2d40ca35e0e39886dc881d06256fc25ba27a77 Mon Sep 17 00:00:00 2001 From: user Date: Thu, 16 Jul 2026 12:20:57 +0200 Subject: fs rewrite stage 2: inodes + root directory (block-based, persistent) - fs.asm: a real block filesystem on the persistent block device - superblock, block/inode bitmaps, a 32-entry inode table (type, size, 8 direct block pointers -> files up to 2 KiB), and a root directory of 16-byte entries. Metadata cached in WRAMX; one-block data cache streams file/dir blocks. - same syscall interface (open/getb/putb/list/remove) -> tools unchanged; ls now enumerates until flist() runs out (16 files, was hardcoded 8). - old 8-slot WRAM FS removed; cart RAM partitioned: process banks 0-7, disk 8-11. - two register-clobber bugs fixed: alloc_block/alloc_inode returned the bitmap-block number (write_bitmap clobbers C); db_use loaded the wrong block on a transition (db_flush->write_block clobbers C) -> multi-block files broke. - verified: 10+ files, multi-block (300-byte) files, delete, and persistence across reboots. Debug 'blk' disk tool retained (fill/peek). - README: document the block filesystem. --- src/kdata.asm | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/kdata.asm') diff --git a/src/kdata.asm b/src/kdata.asm index b299021..b239caa 100644 --- a/src/kdata.asm +++ b/src/kdata.asm @@ -45,6 +45,10 @@ wFsMode:: DS 1 wFsSlot:: DS 1 wFsByte:: DS 1 wFsOFPtr:: DS 2 +wFsCurBlk:: DS 1 ; data block currently in fs_datbuf ($FF = none) +wFsDirty:: DS 1 ; fs_datbuf needs write-back +wFsInode:: DS 1 ; working inode number +wFsNameBuf:: DS 16 ; kernel-side copy of a name argument wKChar:: DS 1 ; scratch for KPutc wKillParent::DS 1 ; scratch for sys_kill wPsBuf:: DS 2 ; scratch for sys_ps -- cgit v1.3.1-sl0p