MKS2 filesystem
Volumes, directories, names, allocation and verified publication.
Namespace
| Path | Meaning |
|---|---|
| / | Virtual root; contains dev/ and mnt/. |
| /dev | Fixed device and stream names. |
| /mnt | Fixed registered mountpoints. |
| /mnt/smp0 | SMP0 volume, or the boot ROM’s internal read-only volume when booting there. |
| /mnt/smp1 | SMP1 volume; normally the writable data cartridge. |
| /mnt/fd0 and /mnt/cf0 | Reserved mountpoints with no driver in 0.6. |
| /dev/console | Application-level keyboard/LCD stream supported by CAT/CP. |
| /dev/null | Application-level empty source/discard sink supported by CAT/CP. |
Names and directories
Names are case-sensitive, 1–12 ASCII characters from letters, digits, dot, hyphen and underscore. The normalized path is at most 95 bytes. . and .. have their usual path-navigation meaning.
Each volume has 16 inodes total, shared by files and directories across the entire tree. A directory stores a parent link, not an independently sized table of 16 children. The volume root is implicit and does not consume an inode.
Directory contents have no timestamps, owner, group, permission bits, hard links or symbolic links. Empty directories use no data sectors; even an empty regular file reserves one 256-byte sector.
Capacity and file sizes
| Volume size | Logical sectors | Data-area upper bound |
|---|---|---|
| 8 KiB | 32 | 6912 bytes |
| 10 KiB | 40 | 8960 bytes |
| 16 KiB | 64 | 15104 bytes |
| 32 KiB | 128 | 31488 bytes |
| 64 KiB | 256 | 64256 bytes |
Sectors are 256 bytes. Five sectors are reserved for the header and two metadata copies. A file uses one contiguous extent and can be at most 64,256 bytes, subject to volume capacity, other files, metadata generations and free contiguous space.
The editor’s 1,280-byte limit is an application limit. CAT, CP and LESS stream larger files. MBC reads source blocks but independently limits a program to 64 non-empty source lines.
Verified writes and replacement
The file writer knows the final length before writing. It reserves a new extent that does not overlap either valid metadata generation or the sectors of an open reader. Data is written, reread and compared. Only a successful close publishes the new inode in the inactive metadata copy.
An interrupted or incomplete output does not publish a partial new file. An earlier version remains referenced if it existed. Both generations and pinned readers can temporarily keep old extents unavailable, so replacement may require more free space than the final file length.
Only one writer can be open. There are two owned handles total, allowing two readers or one reader plus one writer. A writer blocks conflicting filesystem mutations. This is neither journaling nor a general multiwriter filesystem.
Reading and recovery
MOUNT validates the header and metadata copies, then chooses the newest valid generation with modular 16-bit comparison. If one copy is invalid, it can use the other. Both invalid copies cause failure.
A regular file has a byte-sum checksum in its inode. Reading through EOF verifies it; closing early does not force a complete scan. An application can display earlier bytes before discovering a later checksum failure. The system does not automatically substitute an old file version for damaged data.
The checks detect many ordinary corruption cases but are not a cryptographic integrity mechanism or a complete validator for deliberately hostile images.
Operations and compatibility
MKDIR/RMDIR manage directories; RM removes one file; CP copies and replaces; MV renames within a volume or copies then removes across volumes. Cross-volume MV has no atomic transaction spanning both devices.
MKS2 has a single partition per volume and its own on-media format. It is not FAT, ext2, a Linux filesystem or the original MK90 BASIC cartridge format. No conversion or repair command is supplied. On-media format reference.