Copy Link
Add to Bookmark
Report

Differences between Xbox FATX and MS-DOS FAT

xbox's profile picture
Published in 
xbox
 · 8 months ago

written by Michael Steil, 10 May 2002

There is already a document describing the FATX filesystem structure ("Xbox Disk Layout" by Andrew de Quincey and Lucien Murray-Pitts). The document you are reading right now points out the differences between FATX and the FAT16/FAT32 file systems of MS-DOS/Windows, and requires the reader to know about FAT. The differences are especially important for instance when modifying the Linux FAT driver to support FATX.

Basics

FATX is basically a FAT derivative that dropped some legacy fields as well as redundant information that could lead to inconsistencies and thus creating possible security problems.

The FAT filesystem consists of the boot block (or superblock in Unix jargon), the File Allocation Table(s), the directory entries and the actual file data. The File Allocation Table format and the file data layout on disk are actually identical on FAT and FATX. This shows that both are very similar.

The Superblock

The DOS boot block is partially defined by the IBM-PC hard disk layout (boot program, OEM string, ...). FATX has a very different boot block. The actual data is 18 bytes long, but the complete boot block always occupies 4 KB.

OffsetSizeDescription
04"FATX" string (ASCII)
44Volume ID (int)
84Cluster size in (512 byte) sectors
122Number of FAT copies
144Unknown (always 0?)
184078Unused

On the Xbox, the cluster size is always set to 32 sectors (that's 16 KB) and the number of FATs is always 1.

As you can see, the FATX boot block lacks some fields of the FAT one:

FieldFAT VersionComment
Bytes per sectorallAlways 512 on FATX
Reserved clustersallno reserved clusters on FATX
Number of root directory entriesallAlways 256 (one cluster) on FATX
Number of sectorsallRedundant, definied by partitioning
Media codeallLegacy
Number of sectors the FAT occupiesallRedundant, can be calculated with volume size
Sectors per trackallLegacy
HeadsallLegacy
Flags ("Fat Mirroring", "Active FAT")FAT32 onlyNot supported on FATX
Filesystem versionFAT32 onlyThere will never be more than one version of FATX.
First cluster in root directoryFAT32 only???
Filesystem info sectorFAT32 onlyNot supported on FATX
Backup boot sectorFAT32 onlyNot supported on FATX

The File Allocation Table

The (single) File Allocation Table always starts at position 4 KB of the filesystem. Its format is identical to the FAT16/32 formats. Partitions with less than 65525 clusters (smaller than about 1GB) will be FATX16, else FATX32. Just as FAT16/FAT32, FATX16 has 16 bit FAT entries and FATX32 has 32 bit FAT entries.

On the Xbox, partitions 0, 1, 2 and 3 (Scratch A, B, C and System) are FATX16, partition 4 (Data) is FATX32.

The size of the FAT can be calculated like this (cluster map size entry being 16 or 32):

FAT size in bytes = ((partition size in bytes / cluster size) * cluster map entry size) rounded up to the nearest 4096 byte boundary.

The Directory Entries

FAT directory entries are quite complicated because of their ancient original design and the downwards-compatible extension to long file names. FATX has directory entries similar to the orginal FAT ones, but with long filenames (up to 42 characters).

A directory entry is 64 bytes long, thus a cluster can contain up to 256 directory entries. Subdirectories can contain more than 256 entries, since they may consist of more than one cluster, as on FAT.

A directory entry looks like this:

OffsetSizeDescription
01Size of filename (max. 42)
11Attribute as on FAT
242Filename in ASCII, padded with 0xff (not zero-terminated)
444First cluster
484File size in bytes
522Modification time
542Modification date
562Creation time
582Creation date
602Last access time
622Last access date

The order of the three time stamps has not yet been verified, the order in the table corresponds to the order in VFAT directory entries. The format of the timestamps looks a lot like the DOS one, but this has not been fully confirmed yet.

Note that FATX doesn't support Unicode filenames. The file names are case insensitive but case preserving, as on FAT.

Deleted files are marked with a value of 0xe5 in the filename size field. (FAT marks deleted files with a first filename character of 0xe5.) A directory entry with a filename size of 0xff marks the end of the directory.

Open Questions

  • What about ANSI filenames? Can the Xbox kernel correctly convert the case?
  • Is the description of the three time stamps correct?
  • What exactly is the format of the date?
  • What is the meaning of the unknown fields in the superblock? Is there a flag for "unmounted cleanly"?

← previous
next →
loading
sending ...
New to Neperos ? Sign Up for free
download Neperos App from Google Play
install Neperos as PWA

Let's discover also

Recent Articles

Recent Comments

Neperos cookies
This website uses cookies to store your preferences and improve the service. Cookies authorization will allow me and / or my partners to process personal data such as browsing behaviour.

By pressing OK you agree to the Terms of Service and acknowledge the Privacy Policy

By pressing REJECT you will be able to continue to use Neperos (like read articles or write comments) but some important cookies will not be set. This may affect certain features and functions of the platform.
OK
REJECT