XFS Internals
This document describes the internal architecture of the XFS filesystem, including register layout, command protocol, and module implementation details.
XFS Registers
XFS uses page 0x49 (XFS_SPECTRANET_PAGE) for its registers. When Page A is mapped to 0x49, the XFS registers are accessible at address 0x1000.
The XFS registers structure (xfs_registers_t) includes:
- Command register: Command to execute (MOUNT, OPEN, READ, etc.)
- Status register: Current status (IDLE, BUSY, COMPLETE, ERROR)
- Result register: Error code or success indicator
- File handle: Handle for file/directory operations
- Arguments: Command-specific arguments
- Workspace: Data transfer buffer (1024 bytes)
XFS Commands
XFS_CMD_MOUNT(1) - Mount filesystemXFS_CMD_OPEN(2) - Open fileXFS_CMD_READ(3) - Read from fileXFS_CMD_WRITE(4) - Write to fileXFS_CMD_CLOSE(5) - Close fileXFS_CMD_OPENDIR(6) - Open directoryXFS_CMD_READDIR(7) - Read directory entryXFS_CMD_CLOSEDIR(8) - Close directoryXFS_CMD_STAT(9) - Get file informationXFS_CMD_UNLINK(10) - Delete fileXFS_CMD_MKDIR(11) - Create directoryXFS_CMD_RMDIR(12) - Remove directoryXFS_CMD_CHDIR(13) - Change directoryXFS_CMD_GETCWD(14) - Get current directoryXFS_CMD_RENAME(15) - Rename fileXFS_CMD_LSEEK(16) - Seek in file
XFS Module
The XFS module is a Spectranet ROM module that implements the VFS interface. It:
- Intercepts mount requests for
"xfs"protocol - Communicates with Spectranext cartridge via XFS registers
- Provides standard VFS operations to Spectrum programs
Next Steps
- XFS Filesystem - Learn how to use XFS from Spectrum programs
- Memory Architecture - Understand memory mapping and page registers