Skip to main content

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 filesystem
  • XFS_CMD_OPEN (2) - Open file
  • XFS_CMD_READ (3) - Read from file
  • XFS_CMD_WRITE (4) - Write to file
  • XFS_CMD_CLOSE (5) - Close file
  • XFS_CMD_OPENDIR (6) - Open directory
  • XFS_CMD_READDIR (7) - Read directory entry
  • XFS_CMD_CLOSEDIR (8) - Close directory
  • XFS_CMD_STAT (9) - Get file information
  • XFS_CMD_UNLINK (10) - Delete file
  • XFS_CMD_MKDIR (11) - Create directory
  • XFS_CMD_RMDIR (12) - Remove directory
  • XFS_CMD_CHDIR (13) - Change directory
  • XFS_CMD_GETCWD (14) - Get current directory
  • XFS_CMD_RENAME (15) - Rename file
  • XFS_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