Appendix B
Device and storage atlas
Use this atlas when a name, a sector number and a Mac file all seem to point to the same thing. Each locates an object at a different layer.
Trace a request to its destination
| Guest name or handle | OS-9 route on the supplied system | Destination |
|---|---|---|
| /dd | Default system disk descriptor through RBF | The boot filesystem supplied on HD0 |
| /h0 | H0 through RBF and EmuDsk, drive 0 | The HD0 image shown under Virtual Hard Disks |
| /h1 | H1 through RBF and EmuDsk, drive 1 | Your writable HD1 image, with an initialized OS-9 filesystem |
| /Term | Term through SCF and VTIO | The guest terminal displayed in the emulator |
| A shell pipeline ! | Pipe manager, with an open write end and read end | Bytes passed from one guest process to the next |
| Standard output, 1 | Per-process path number, inherited or redirected by the shell | Terminal, file or pipe selected for this run |
devs reports relationships among active devices, drivers and managers. dmode /h1 identifies the disk descriptor and its drive number. tmode inspects the current terminal options. The quick-start equipment map pairs the drive window with guest names. The HD1 virtual device serves sectors. It is RBF that interprets them as directory entries and file descriptors.
Decode the station disk
All offsets below are hexadecimal byte offsets inside the named structure. Multi-byte integers here are most-significant byte first. The example values come from chapter 5’s actual exercise disk.
| Structure | Offset and width | Value in the example |
|---|---|---|
| Volume description | $00, three bytes, total sectors | 05 A0 00 → 368,640 sectors |
| Volume description | $04, two bytes, allocation map length | 16 80 → 5,760 bytes |
| Volume description | $06, two bytes, sectors per cluster | 00 08 → 8 |
| Volume description | $08, three bytes, root descriptor LSN | 00 00 18 |
| report directory entry | $00–$1C, name field | 72 65 70 6F 72 F4 → report. The high bit of its last character marks the end |
| Same 32-byte entry | $1D, three bytes, descriptor LSN | 00 00 28 |
| File descriptor at $28 | $00, attributes, followed at $01 by two-byte owner ID | 03 → owner read/write. Owner 00 00 |
| File descriptor | $08, one byte, link count | 01 |
| File descriptor | $09, four bytes, file length | 00 00 00 17 → 23 bytes |
| First segment entry | $10, three-byte start, then two-byte sector count | 00 00 29 00 07 → seven sectors beginning at $29 |
| File data | $00 from start of the first segment | 65 63 68 6F → echo |
A descriptor can hold more segment entries when a file grows in disjoint runs. Use the declared file length to stop. The descriptor’s link count is a filesystem property. A module’s in-memory link count has a different lifetime and purpose.
Identify an image before changing it
free /h1 reports the filesystem’s volume name, capacity and free space. A copied disk keeps its volume name, so the name alone cannot identify the right backup. Use a known file or a time-specific marker, then confirm the Mac file assigned to the drive. Recover the right copy uses both checks.
For the layout and terminology, see The NitrOS-9 Project, NitrOS-9 Technical Reference, revision 0.1 (2004), chapter 5, pp. 48–52. The example sector numbers and file contents in this atlas were measured on the VCC Plus practice disk.