summaryrefslogtreecommitdiffstats
path: root/scripts/qemu.sh
diff options
context:
space:
mode:
authorsalmonik <salmonik@tuta.io>2026-07-31 19:53:53 +0200
committersalmonik <salmonik@tuta.io>2026-07-31 19:53:53 +0200
commitdc23d2f22cafeb6b97ba460789a834a6c586314d (patch)
tree987bec11922073923c4c42bda84c0f670884dbca /scripts/qemu.sh
parentvt: defer scrolls and batch framebuffer pushes (diff)
downloadrs-dos-dc23d2f22cafeb6b97ba460789a834a6c586314d.tar.gz
rs-dos-dc23d2f22cafeb6b97ba460789a834a6c586314d.zip
ahci: SATA driver + FAT32 persistent disk mounted at /disk
- ahci.rs: polling AHCI on PCI class 1/6/1, bus mastering + ABAR map, port 0 up, IDENTIFY + READ/WRITE DMA EXT through one 4KiB DMA buffer - fat.rs: BPB parse, whole-FAT RAM cache with write-back to both copies, LFN read/write, dirs, multi-cluster files, FSInfo free-count sync, space-padded dot entries ('..' = cluster 0 under root), fsck-clean - fs.rs: /disk mount node + 24-slot ephemeral node pool; ls/cat/hexdump/ echo/mkdir/touch/rm/edit all work on disk paths unchanged - QEMU: explicit bus assignment (disk=ide.0, ESP=ide.1); the implicit fat:rw:esp drive was stealing AHCI port 0 - Debugged against QEMU source: header DW0 is CFL in bits 4:0 / PRDTL in bits 31:16 (Linux libahci layout), FIS count at bytes 12-13, device at byte 7; QEMU rejects H2D FIS flags bits 6:4, so direction is the header W bit only - Verified: full shell round-trip on /disk, reboot persistence (poweroff then mdir/mtype and a fresh boot), fsck.fat clean
Diffstat (limited to 'scripts/qemu.sh')
-rwxr-xr-xscripts/qemu.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/qemu.sh b/scripts/qemu.sh
index b75bed4..123d9d0 100755
--- a/scripts/qemu.sh
+++ b/scripts/qemu.sh
@@ -40,7 +40,10 @@ while [ $# -gt 0 ]; do
40 ;; 40 ;;
41 --image | -i) 41 --image | -i)
42 _img_file="$(printf -- '-drive file=%s,format=raw,if=none,id=hd' "$2")" 42 _img_file="$(printf -- '-drive file=%s,format=raw,if=none,id=hd' "$2")"
43 DRIVE_ARGS=("$_img_file" '-device' 'ide-hd,drive=hd') 43 # Explicit buses: data disk -> ide.0 (port 0), ESP -> ide.1.
44 DRIVE_ARGS=("$_img_file" '-device' 'ide-hd,drive=hd,bus=ide.0' \
45 '-drive' 'file=fat:rw:esp,format=raw,if=none,id=esp' \
46 '-device' 'ide-hd,drive=esp,bus=ide.1')
44 shift 2 47 shift 2
45 ;; 48 ;;
46 --bios | -b) 49 --bios | -b)