diff options
| author | user <user@clank> | 2026-07-16 11:42:38 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-07-16 11:42:38 +0200 |
| commit | 057e5377af2d086917b9cd0ffb336231d7d098cb (patch) | |
| tree | fd814d32d88a0eede32a69f45b729310b182e13a /README.md | |
| parent | jobs: background execution (&), non-blocking reap, spin demo (diff) | |
| download | gbos-057e5377af2d086917b9cd0ffb336231d7d098cb.tar.gz gbos-057e5377af2d086917b9cd0ffb336231d7d098cb.tar.xz gbos-057e5377af2d086917b9cd0ffb336231d7d098cb.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | README.md | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -294,6 +294,15 @@ $ ps ## Filesystem +> **Being rewritten** into a persistent block-based FS. Stage 1 landed: a block +> device (`src/blk.asm`) over battery-backed cart RAM (banks 8–11, 256-byte +> blocks) read/written through a WRAM bounce buffer — so only two routines touch +> cart-RAM banking, and (crucially) they never touch the stack while the disk +> bank is mapped over the process's `$A000` window. Data survives power-off via +> the emulator's `.sav`. The 8-slot WRAM filesystem below still backs the tools +> until stages 2–3 (inodes + directories) replace it. + + A tiny **RAM filesystem** lives in **WRAMX (`$D000-$DFFF`, 4 KiB)** — always mapped in DMG mode and simultaneously accessible with a process's `$A000` data bank, so the kernel copies between file and process memory with no bounce @@ -338,7 +347,11 @@ $ rm notes - [x] shell in C with redirection (`>`/`<`) and pipes (`|`, via a temp file) - [x] per-process stdin/stdout routing (`KGetc`/`KPutc`, `setin`/`setout`) - [ ] more tools (`rev`, `grep`, `tail`), true concurrent pipes -- [ ] battery-backed files (move the FS to cart SRAM), directories +- [~] persistent filesystem rewrite (block-based, cart SRAM), directories: + - [x] **stage 1**: block device (`blk.asm`) — read_block/write_block via a WRAM + bounce buffer, format-on-first-boot, **persists across reboots** (`.sav`) + - [ ] stage 2: inodes + flat root dir (variable-size files); port cat/ls/save + - [ ] stage 3: directories, path resolution, per-process cwd, `cd`/`mkdir` - [ ] Preemptive scheduling: real context save in `TimerISR` → `hSwitchTo` - [ ] Use the `$D000-$DFFF` u-area (SVBK) for per-process kernel state / kstack - [ ] `brk`/heap allocator inside the task bank (heap up, stack down, collision = ENOMEM) |
