diff options
| author | salmonik <salmonik@tuta.io> | 2026-07-31 21:29:49 +0200 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-07-31 21:29:49 +0200 |
| commit | 3997ec4d2d7d6f69b08d0c04ce8de0df03c52a45 (patch) | |
| tree | 60c5b079103e74d919a32b24276c536e69ce82f7 /CONTEXT.md | |
| parent | ahci: SATA driver + FAT32 persistent disk mounted at /disk (diff) | |
| download | rs-dos-3997ec4d2d7d6f69b08d0c04ce8de0df03c52a45.tar.gz rs-dos-3997ec4d2d7d6f69b08d0c04ce8de0df03c52a45.zip | |
ahci: scan all ports; fat: mount first valid FAT32 disk
The kernel previously started only AHCI port 0, so any launch where the
firmware/QEMU put something else on port 0 (e.g. the ESP from an implicit
-drive file=fat:rw:esp) left the real disk unnoticed: 'unsupported sector
size 0' and no mount.
- ahci.rs: enumerate CAP.NP/PI ports, start every port that links up
(empty ports settle at DET=0 and are skipped quickly), keep up to 8
disks, and expose disk_count()/select() for the filesystem
- fat.rs: try each disk in port order and mount the first valid FAT32
volume; non-FAT disks are logged and skipped
- scripts/boot.sh: attach the data disk on ide.0 and the ESP on ide.1
(DISK_IMG env var, default /tmp/disk.img), matching the Makefile
- Verified with the disk on port 0 (Makefile style), port 5 (old-style
command line), and with the ESP on port 0; fsck.fat stays clean
Diffstat (limited to '')
| -rw-r--r-- | CONTEXT.md | 6 |
1 files changed, 5 insertions, 1 deletions
| @@ -170,7 +170,11 @@ Single Rust crate (`x86_64-unknown-uefi` target). Module breakdown: | |||
| 170 | ✅ **AHCI + FAT32 (persistent disk)** — a SATA AHCI driver (polling DMA, | 170 | ✅ **AHCI + FAT32 (persistent disk)** — a SATA AHCI driver (polling DMA, |
| 171 | no interrupts) plus a FAT32 filesystem, mounted as `/disk`; every shell | 171 | no interrupts) plus a FAT32 filesystem, mounted as `/disk`; every shell |
| 172 | command works on disk paths: `ls`/`cat`/`hexdump`/`echo >`/`>>`/ | 172 | command works on disk paths: `ls`/`cat`/`hexdump`/`echo >`/`>>`/ |
| 173 | `mkdir`/`touch`/`rm`/`edit`. Whole-FAT cache with write-back to both | 173 | `mkdir`/`touch`/`rm`/`edit`. The driver scans **all** implemented |
| 174 | ports (CAP.NP/PI) and starts every port with a device; `fat::init` | ||
| 175 | tries each disk in port order and mounts the first valid FAT32 | ||
| 176 | volume — so the kernel finds the disk no matter which AHCI port the | ||
| 177 | firmware/QEMU put it on (real hardware included). Whole-FAT cache with write-back to both | ||
| 174 | FAT copies, checksum-validated LFN read/write, multi-cluster files, | 178 | FAT copies, checksum-validated LFN read/write, multi-cluster files, |
| 175 | space-padded `.`/`..` dot entries (`..` → cluster 0 under the root), | 179 | space-padded `.`/`..` dot entries (`..` → cluster 0 under the root), |
| 176 | FSInfo free-count maintenance (fsck-clean after a session, verified | 180 | FSInfo free-count maintenance (fsck-clean after a session, verified |
