summaryrefslogtreecommitdiffstats
path: root/CONTEXT.md
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-08-01 01:56:12 +0200
committersalmonik <salmonik@tuta.io>2026-08-01 01:56:12 +0200
commit4ea992c71dd0cdcffe0f74216e748256bd700a31 (patch)
tree2992b0063f08fbf79586d35ad481539fd7ee9af4 /CONTEXT.md
parentahci: skip ATAPI ports and fast-fail on device abort (diff)
downloadrs-dos-4ea992c71dd0cdcffe0f74216e748256bd700a31.tar.gz
rs-dos-4ea992c71dd0cdcffe0f74216e748256bd700a31.zip
scripts: automate the data-disk workflow (mkdisk / sendkeys / test-disk)
- scripts/mkdisk.sh: create the FAT32 disk with mkfs.fat -C (the flag that actually creates the file — plain mkfs.fat fails on a missing path), accept M/G/K sizes, seed seed/ files via mtools; --fresh re-formats, --no-seed skips seeding - scripts/sendkeys.py: type lines into the guest via the QEMU monitor (US layout). Punctuation must use QEMU's named keys (minus, slash, dot, ...) — bare '-', '.', '/' are not valid sendkey names, and '-' is the modifier separator, so they were silently dropped before - scripts/test-disk.sh: full automated round trip — build, deploy, ensure image, boot headless QEMU, drive the shell (ls /disk, mkdir, echo >, cat, poweroff), then verify with fsck.fat (must be clean) and mtype (file content must have survived poweroff) - Makefile: make disk / disk-fresh / inspect / test-disk; run, run-gui and debug now auto-create a missing DISK_IMG; fix the stale comment (mkfs.fat without -C) - scripts/boot.sh: auto-create a missing DISK_IMG via mkdisk.sh - seed/: motd.txt + lines.txt seeded onto fresh images - Verified end to end: ./scripts/test-disk.sh --fresh passes
Diffstat (limited to '')
-rw-r--r--CONTEXT.md21
1 files changed, 19 insertions, 2 deletions
diff --git a/CONTEXT.md b/CONTEXT.md
index aa9385b..39ce0bd 100644
--- a/CONTEXT.md
+++ b/CONTEXT.md
@@ -186,8 +186,25 @@ Single Rust crate (`x86_64-unknown-uefi` target). Module breakdown:
186 `-device ide-hd,drive=disk,bus=ide.0` puts the data disk on AHCI port 186 `-device ide-hd,drive=disk,bus=ide.0` puts the data disk on AHCI port
187 0; the ESP gets `bus=ide.1`. (The implicit `-drive file=fat:rw:esp` 187 0; the ESP gets `bus=ide.1`. (The implicit `-drive file=fat:rw:esp`
188 otherwise grabs port 0.) Make targets (`run`, `run-gui`, `debug`) 188 otherwise grabs port 0.) Make targets (`run`, `run-gui`, `debug`)
189 attach `$(DISK_IMG)` (default `/tmp/disk.img`). OVMF writes its 189 attach `$(DISK_IMG)` (default `/tmp/disk.img`) and auto-create it when
190 `NvVars` varstore file onto the first FAT volume — harmless. 190 missing. OVMF writes its `NvVars` varstore file onto the first FAT
191 volume — harmless.
192
193 The whole disk workflow is scripted (no manual mkfs/mcopy):
194
195- `make disk` / `./scripts/mkdisk.sh` — create the FAT32 image with
196 `mkfs.fat -C` (the flag that actually creates the file; plain
197 `mkfs.fat` needs an existing file), label `RSDOS`, seed from
198 `seed/` via mtools; `--fresh` re-formats, `--size 128M` sizes it
199- `make inspect` — `mdir -i` listing of the image (mtools)
200- `make test-disk` / `./scripts/test-disk.sh` — full automated round
201 trip: build → deploy → ensure image → boot QEMU headless → drive
202 the shell via `sendkey` through the monitor (`ls /disk`, `mkdir`,
203 `echo >`, `cat`, `poweroff`) → fsck-clean check → `mtype` verifies
204 the written file survived poweroff
205- `./scripts/sendkeys.py` — types lines into the guest via the QEMU
206 monitor (`--sock`, US layout, named keys for punctuation; bare
207 `-`/`.`/`/` are not valid sendkey names)
191 208
192## Known issues / perf notes 209## Known issues / perf notes
193 210