aboutsummaryrefslogtreecommitdiffstats
path: root/c/blk.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-07-16 12:20:57 +0200
committeruser <user@clank>2026-07-16 12:20:57 +0200
commit4f2d40ca35e0e39886dc881d06256fc25ba27a77 (patch)
tree368474d3d24a2480b45c0efd8ffe0b7ee018b879 /c/blk.c
parentfs rewrite stage 1: persistent block device (bounce buffer, cart SRAM) (diff)
downloadgbos-4f2d40ca35e0e39886dc881d06256fc25ba27a77.tar.gz
gbos-4f2d40ca35e0e39886dc881d06256fc25ba27a77.tar.xz
gbos-4f2d40ca35e0e39886dc881d06256fc25ba27a77.zip
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.
Diffstat (limited to 'c/blk.c')
-rw-r--r--c/blk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/c/blk.c b/c/blk.c
index adf2a58..36839c0 100644
--- a/c/blk.c
+++ b/c/blk.c
@@ -6,7 +6,7 @@ void main(void) {
if (argc >= 3 && argv[0][0] == 'f') {
bfill(atou(argv[1]), atou(argv[2]));
} else if (argc >= 2 && argv[0][0] == 'p') {
- putu(bpeek(atou(argv[1]))); nl();
+ putu(bpeek2(atou(argv[1]), argc>=3?atou(argv[2]):0)); nl();
} else {
puts("usage: blk fill <n> <v> | blk peek <n>"); nl();
}