File allocation table


from Wikipedia, the free encyclopedia

File Allocation Table (short FAT [ fæt ], English for file allocation table ) describes a widespread family of file systems originally developed by Microsoft in 1977 , which was raised to the industry standard and is still used today as an almost universal exchange format across operating system boundaries. Major additions were also made by Seattle Computer Products , Compaq , Digital Research, and Novell . As a proprietary successor, Microsoft developed NTFS andexFAT .

background

The FAT file system was originally developed in 1977 in an 8-bit version by Marc McDonald for Microsoft's standalone disk BASIC-80 for 8080 processors, and in 1978 it was ported to a DEC PDP-10 with the aid of an 8086 simulator for standalone disk BASIC-86 and in 1979 adapted for Microsoft's MDOS / MIDAS operating system.

Also in 1979, Bob O'Rear's Standalone Disk BASIC-86 was adapted to an S-100 bus hardware platform developed by Seattle Computer Products (SCP) . On this occasion, Tim Paterson became aware of the file system, which he chose in 1980 as the conceptual basis of his 12-bit file system for SCP's QDOS operating system, which, renamed 86-DOS , was initially licensed and bought by Microsoft and then the basis for MS in 1981 -DOS and PC DOS 1.0 was made.

The FAT file system family includes:

  • FAT12 is now for each DOS - Disk used (under Windows ). The Atari ST uses an almost identical file system and can read and write FAT12 disks.
  • Today, FAT16 is mostly used on all types of mobile data carriers (except floppy disks) with a size of up to 2, rarely up to 4  GiB .
  • FAT32 is z. B. used in all types of mobile storage with more than 2 GiB capacity and supported by all Windows versions from Windows 95b and newer DOS systems.
  • FAT + ( FAT32 + / FAT16 + ) is a backwards compatible extension of FAT32 (and - theoretically - FAT16B ), which increases the maximum size of a file from 4  GiB to 256 GiB (is currently supported by, among others, Enhanced DR-DOS and Deskwork )
  • exFAT is a proprietary file system specially developed for flash memory with a theoretical maximum file size of 16 EiB, which is conceptually remotely based on FAT.

Types

FAT12

With the first version of QDOS or 86-DOS , which appeared in 1980 , FAT12 was introduced as the file system for 8.0 "and 5.25" floppy disks. It was not until 86-DOS 0.42 of February 1981 that the internal order structures had a format that resembled the later FAT12 format in MS-DOS and PC DOS in all essential points. Due to different logical geometries and the fact that the BIOS Parameter Block (BPB) was only introduced with DOS 2, however (with the exception of SCP MS-DOS 1.25), neither MS-DOS nor PC DOS can access media formatted under 86-DOS .

No subdirectories were initially managed. That changed with MS-DOS version 2.0.

FAT12 is only used on data carriers or partitions up to a size of 16 MiB ; it is still in use today on all FAT-formatted 3.5 ″ floppy disks.

Features:

  • 12-bit  cluster numbers with which 2 12 = 4096 clusters can be addressed. The numbering of the clusters starts with number 2 on diskettes.
  • Only file names in scheme 8.3 (eight characters for the file name and three characters for the file name extension) are supported.
  • The cluster size is 512 bytes to 4096 bytes.
  • The main directory (root directory) of the partition is limited to a size of 14 clusters, resulting in a maximum number of 224 entries (directories and / or files). Usually the first entry is occupied by the name of the data carrier.
  • The file attributes “write-protected”, “hidden”, “system” and “archive” are supported.
  • Support for passwords and file or folder permissions is not implemented in Microsoft operating systems, but is optionally available on all operating systems that support the appropriate FAT extensions from Digital Research and Novell.

FAT16

FAT16
Manufacturer Microsoft
Full name File allocation table
Initial release 1983 ()
Maximum values
Size of a file 2 GiB (NT: 4 GiB)
File system size 2 GiB (NT: 4 GiB)

FAT16 is a file system that was added to FAT12 in 1983 . The increasing size of the hard disks used made it necessary to expand the address space. Even with 512-byte clusters, a total of 32 MiB disks could be managed, at least in theory.

The original FAT16 implementation generally used partition type 04h on partitioned media (depending on the respective DOS OEM ) and a comparatively short BIOS parameter block (BPB) in the boot sector. Its exact structure and content, especially in DOS 2.x, still strongly depended on the DOS version used, but in all cases it only contained a 16-bit wide entry for the number of sectors, which means the size of FAT16 drives up to 32 MiB 512 MiB limited (depending on the operating system version). With OS / 2 Release 1 an Enhanced BIOS Parameter Block (EBPB) was introduced, recognizable by the signature byte 28h (for DOS-BPB-Version 4.0) at offset + 26h. With the introduction of DOS 3.31 this was replaced by the extended BIOS parameter block (XBPB) with signature 29h (for DOS-BPB version 4.1) at offset + 26h , which is now generally used for FAT12 and FAT16 . EBPB and XBPB stand out among other things. a. from the fact that the entry for the number of sectors grew to 32-bit width, making FAT16 drives with up to 2 GiB, later 4 GiB, possible for the first time, even if the operating systems of the time were not yet able to make use of it. This larger variant of FAT16 was called "BigDOS" in development circles, hence its official name FAT16B. Since older operating systems could not work with this new type, a new partition type (06h) was also defined for use on partitioned media. The old FAT16 variant is still supported, but is no longer used in practice (apart from the forced creation of very small FAT16 partitions with partition type 04h), since at the latest since DOS 5 when creating FAT12 and FAT16 partitions only need to be written to boot sectors with XBPB in order to optimally support some new operating system functions. The fact that there are actually two FAT16 types is no longer present in the general public, even more, since FAT12 is almost only used for floppy disks, today FAT is often wrongly only used with FAT16 (and only in the FAT16B described above Variant), although this would actually mean several FAT12 and FAT16 types. However, the server operating system Novell- NetWare up to version 4.0 still requires a “DOS” boot partition of up to 16 MiB, which was (automatically) created with FAT12.

If access is via Logical Block Addressing (LBA), a FAT16 partition is also referred to as FAT16X .

FAT16 has the following features:

  • 65,536 entries are possible, but only 512 in the root directory.
  • 2 16  - 18 = 65,518 clusters can be addressed (18 clusters reserved FAT16, therefore not 65,536).
  • 8.3 filename format .
  • The partition size is limited to 2 GiB under MS-DOS and Windows 9x (which are based on DOS) when creating a new system under fdisk ; when creating a system with external programs, you can manage just under 4 GiB. Windows NT, FreeDOS and Enhanced DR-DOS can create and manage FAT16 partitions with the maximum size (cluster size 64 KiB).
  • Depending on the partition size, the clusters are between 512 bytes and a maximum of 32 KiB (Windows NT and Enhanced DR-DOS maximum 64 KiB).
  • Files can be up to 2 GiB in size, under Windows NT and Enhanced DR-DOS 4 GiB.
  • The main ( root ) directory must be in a certain position on the data carrier. Its size is determined when the file system is created; i.e., it cannot grow.

A further development took place with FAT32 .

FAT32

FAT32
Manufacturer Microsoft
Full name File allocation table
Maximum values
Size of a file 4 GiB minus 1 byte
Number of all files 268,435,456 (2 28 )
File system size TiB (with typical 512 bytes sector size),

16 TiB at 4 KiB sector size

properties
Supporting operating systems Microsoft Windows 95 B and newer; many newer unixoid operating systems

FAT32 is a file system developed by Microsoft that was introduced with Windows 95B in the summer of 1996 and supplements the previous version FAT16 .

Partitions smaller than 512 MiB are still created with FAT16, from 512 MiB to 2 GiB you have the choice, from 2 GiB FAT32 is used. The addressing works with 32 bits , of which 4 bits are reserved, so that 2 28  = 268,435,456 clusters can be addressed.

FAT32 can also be used with all Windows versions since Windows 95B and - unlike NTFS  - with FreeDOS and Enhanced DR-DOS . Since Windows only supports a few file systems, depending on the version, FAT32 is used, despite its limitations, for data exchange with other Windows systems as well as with non-Windows systems (e.g. macOS , Linux ), e.g. B. on USB memory sticks and mobile hard drives.

Game consoles such as the PlayStation 3 or digital satellite receivers often require FAT32 as the file system for externally connected hard drives.

A disadvantage of a standards-compliant FAT32 file system is that only files that are smaller than 4 GiB can be created. With the backwards compatible extension FAT32 + files up to 256 GiB are possible, but this extension is only supported by a few systems. Another disadvantage is that Windows 2000 or later can only format 32 GB with its own formatting tool.

Since a cluster is only 4 KiB in size up to a partition size of 8 GiB (with standard formatting), these "small and old" disks are used relatively better than with FAT16, where a cluster occupies up to 32 KiB (under Windows NT or Windows 2000 FAT16 cluster size maximum 64 KiB).

If access is via Logical Block Addressing (LBA), a FAT32 partition is also referred to as FAT32X .

FAT32 has the following features:

  • Up to 2 28  = 268,435,456 clusters are used.
  • The maximum file system size depends on the sector size of the medium used. For hard disks, which typically have a sector size of 512 bytes, the maximum size is 2  tebibytes ; for data carriers that use a 4 KiB sector size, the maximum size is 16  Tebibytes . The size is primarily limited by the four-byte total number of sectors field (offset 20h) in the boot sector.
  • Depending on the partition size, the clusters are between 512 bytes and a maximum of 32 KiB.
  • Files may be max. up to 4 GiB - 1 byte (= 4,294,967,295 bytes). This limit is a consequence of the only 4 byte wide field for the file size in the directory table.
  • A maximum of 2 28 files can be stored; since each file occupies at least one cluster, the maximum number of clusters limits the maximum number of files.
  • The main ( root ) directory does not have to be in a specific position on the data carrier and, above all, does not have a fixed size; With the other FAT variants, the maximum number of entries in the main directory is determined during formatting (and cannot be changed later).
  • Old DOS / Windows versions (up to and including Windows 95A, Windows NT up to version 4.0, MS-DOS up to 6.22, PC DOS up to 2000, DR-DOS up to 7.03) can not access them. A full driver is now available free of charge for Windows NT 4.0. The dynamically loadable DRFAT32 driver developed by Matthias Paul for DR-DOS can be used for any DOS systems from 3.3, the FAT32 drives via the redirector interface as an (extended) CD extension with full read / write access to the system involves.
  • Under Windows 2000 and successors, the user can use the built-in “Format” function to create a new FAT32 file system of up to 32 GiB in size. The command line program format.com also has this limitation. Access to larger FAT32 file systems that were created with alternative tools is always possible. With additional programs you can create and format partitions larger than 32 GiB with FAT32 under Windows 2000 or higher. The disk utility of Mac OS X 10.4 and newer as well as the Linux program mkdosfs (in connection with fdisk ) can create one or more FAT32 partitions with more than 32 GiB capacity on hard disks that are larger than 32 GiB.
  • There are several modern DOS systems that natively support FAT32: MS-DOS 7.10 / 8.00, Enhanced DR-DOS, FreeDOS 1.0, OEM PC DOS 7.10 (the successor to PC DOS 2000) and Datalight ROM-DOS .
  • It is no longer possible to save meta information for files in Extended Attributes .

Since FAT32 and NTFS can also coexist in current Windows installations, it should be noted that when files are transferred from NTFS to FAT32, both NTFS streams and permissions are lost, which can be useful or disruptive depending on the application.

Extensions

VFAT

VFAT ( Virtual File Allocation Table ) is an extension of the FAT format for the use of long file names, which can be applied to FAT12, FAT16 and (since its introduction in 1996) also to FAT32. Occasionally, VFAT is incorrectly equated with FAT32 .

The designers of Windows 95 had the goal of enabling the use of long file names, although the versions based on MS-DOS do not support the successor file system NTFS intended for this under the NT series . This is achieved by a trick in the layout of the file system. As before, the file is saved as an 8.3 file name, but an alias is xxxxxx~1.xxxused for longer names in which the number is incremented. The long name is then distributed over several directory entries that have a combination of file attributes that older systems consider invalid and therefore ignore.

However, the use of the "Volume" attribute can result in older MS-DOS (prior to 7.1) mistakenly interpreting such entries as volume names in the dir command, especially if the actual volume name is not in the first position in the directory or completely absent.

The final format allows file names up to 255 characters long (the name including the storage path can contain up to 260 characters) and uses Unicode as the character set with the UCS-2 encoding .

In areas of the entry with the 8.3 file name that were not previously used by Microsoft systems, the creation date and the date of the last access are now also saved.

Support in operating systems

Windows for Workgroups 3.11 optionally supports VFAT , but only for hard disks and without the possibility of long file names.

VFAT is supported in Windows 95 and higher and in Windows NT 3.5 and higher.

Under Linux is VFAT extension fully supported.

UMSDOS

In the early 1990s, many Linux distributions the UMSDOS extension for FAT16 used Linux to install, without the hard drive re- partitioning and formatting the need. UMSDOS adds a Unix- compatible layer on top of a FAT file system . This manages files that have the name . User rights and long file names are saved in it. --linux-.---

In Linux 2.6.11 , UMSDOS was removed from the kernel because it is no longer being developed. A POSIX overlay file system is available as a replacement , which FUSE uses and which can be "displayed" over a normal FAT file system.

UVFAT

UVFAT only existed for a short time and used the VFAT extension to store long file names, while the UMSDOS mechanism was used for the user rights that are missing under all FAT versions. Long file names created under Linux could also be read under modern Windows versions and vice versa. The development was stopped again before the UMSDOS extension.

Derivatives

There are the following derivatives :

exFAT

exFAT ( Extended File Allocation Table ) is a file system specially developed for flash memory . It was introduced in 2006 with Windows CE 6.0. exFAT should be used where NTFS is difficult or impossible to implement and at the same time the restrictions of FAT32 - in particular maximum file size of 4 GiB - should be avoided. Windows 7 , Windows 8 and Windows 10 support exFAT natively, Windows Vista only from Service Pack 1. Microsoft has an update package for Windows XP from SP2. On Apple computers, exFAT is fully supported from Mac OS X Snow Leopard , version 10.6.5. On August 27, 2019, Microsoft published the specifications for exFAT and declared that it supports an implementation of exFAT in the Linux kernel and will release the patents on it via the Open Invention Network. exFAT is directly supported by the Linux kernel from version 5.4, in kernel 5.7 the driver has been replaced by a better one. Zufor already had a proprietary Linux driver from Tuxera and a driver for FUSE licensed by Samsung under the GPLv3 .

The specifications for Memory Stick XC and SDXC flash memory cards require the use of exFAT; In principle, the memory cards can also be formatted with a different file system, but then they do not conform to the standards and can therefore not be used in every device (e.g. digital camera).

The advantages over previous versions are:

  • Theoretical maximum file size of 64 ZiB , recommended maximum file size 512 TB (maximum partition size).
  • A cluster can be a maximum of 32 MiB (theoretically, however, up to 2 255 bytes).
  • A table was introduced which indexes the free clusters.
  • The file system supports extended access rights (ACL) .
  • Transactions are also supported (only with TexFAT ).

Disadvantage:

  • For a long time exFAT could only be used with a license from Microsoft. The specification has now been disclosed.
  • For file systems of 32GB or more, the standard cluster size is 128KB. This means that even small files always take up at least 128KB of space on the file system.

TFAT

TFAT ( Transaction-safe File Allocation Table ) offers protection against damage to the file system, particularly for mobile devices with built-in flash memory, for example if the device's power supply fails during a write operation.

For this, the FAT is managed twice: once as FAT1 with the current file assignments and once as FAT0 with the last known status of the file system. FAT0 is only updated after a transaction has been successfully completed by copying FAT1 to FAT0. A transaction is, for example, the creation of a new file.

During the course of a transaction, changes to the file system are saved in newly created clusters and FAT1 is adjusted accordingly. In the event of an error, an incompletely executed transaction can be reversed by copying from FAT0 to FAT1 and the file system can be restored to the status it was before the transaction began.

The arithmetical limit for TFAT partitions is 2 TiB with a sector size of 512 bytes.

Although TFAT is explicitly intended for non-removable storage, it can also be used with removable storage media. However, problems can arise if a TFAT medium is used in another device that does not support TFAT. In principle, it is then possible to access the medium, but because it is treated like a normal FAT medium, write operations are not transaction-safe. Also, due to differences in the data structures, directories created with TFAT cannot be deleted from FAT systems.

TFAT is usually not supported by desktop systems. It is supported by Microsoft for mobile devices since Windows Mobile 6.5 and Windows CE from version 6.0.

construction

A FAT file system is divided into five areas:

Overview of the structure within a FAT partition
content Boot sector FS information area

(only FAT32)

Possibly. other reserved areas File Allocation Table (FAT) number 1 File Allocation Table number 2 (& possibly others) Root directory (only FAT12 / FAT16) Data area (for files and folder structures) ... (up to the end of the partition)
Size in sectors (Number of reserved sectors) (Number of FATs) * (sectors per FAT) (Number of root directories * 32) / ( bytes per sector) (Number of clusters) * (sectors per cluster)

All multibyte values ​​(16/32 bit) are stored in little endian , i. H. least significant bytes first.

Boot sector

The boot sector can contain x86 machine code ( boot loader ) that is to load the operating system. Elsewhere it contains information about the FAT file system.

Offset
(hex)
Length
(dec)
content
00 3 x86 machine code. Usually a jump instruction to the boot code to skip the data bytes in the boot sector.
Example EB 3C 90:; for x86 processors, this code has the following instructions: JMP SHORT 003C; NOP.
03 8th OEM name (padded with spaces). MS-DOS uses this to determine the structure of the remaining data in the boot sector. Common values ​​are IBM  3.3(with two spaces between “IBM” and “3.3”) and MSDOS5.0. In principle, the name can be freely defined, formatting programs often use their own names.
0B 2 Bytes per sector (Valid values ​​are: 512, 1024, 2048 and 4096. Usually the value is 512.)
0D 1 Sectors per cluster (power of two between 1 and 64, possibly also 128)
0E 2 Number of reserved sectors (including boot sector, so always at least 1)
10 1 Number of FAT copies (usually: 2)
11 2 Maximum number of directory entries in the root directory (not used with FAT32 and always 0000 hex )
13 2 Total number of sectors of the medium max. 65535, for larger media this value is 0, and the actual value is a 4-byte value at offset 20 hex . Always unused with FAT32.
15th 1 Media descriptor byte. Is considered obsolete and is no longer taken into account as of Windows Server 2003.
0xF0 Double-sided, 80 tracks, 18/36 sectors per track (1440  KiB and 2880 KiB 3½ ″ diskette)
0xF8 hard disk
0xF9 Both sides, 80 tracks, 9/15 sectors per track (720 KiB-3½ ″ or 1200 KiB-5¼ ″ diskette)
0xFA One-sided, 80 tracks, 8 sectors per track (320 KiB-3½ "or -5¼" diskette).
Also used for ram disks
0xFB Both sides, 80 tracks, 8 sectors per track (640 KiB 3½ "or -5¼" diskette)
0xFC Single-sided, 40 tracks, 9 sectors per track (180 KiB 5¼ ″ disk)
0xFD Both sides, 40 tracks, 9 sectors per track (360 KiB-5¼ ″ -Diskette)
Both sides, 77 tracks, 26 sectors per track (500 KiB-8 ″ -disks)
0xFE One-sided, 40 tracks, 8 sectors per track (160 KiB-5¼ ″ diskette)
One-sided, 77 tracks, 26 sectors per track (250 KiB-8 ″ disks)
Both sides, 77 tracks, 8 sectors per track (1200 KiB-8 ″ Diskettes)
The two 8 ″ diskette formats were distinguished in terms of whether read accesses to page 2 were successful.
0xFF Double-sided, 40 tracks, 8 sectors per track (320 KiB-5¼ ″ disk)
16 2 Number of sectors per FAT. (Not used with FAT32 and always 0000 hex , see offset 24 hex .)
18th 2 Sectors per track
1A 2 Number of pages or read / write heads
1C 4th Number of "hidden" sectors in front of the boot sector. For hard disks this is the number of sectors between the master boot record and the boot sector of the partition. Always 0 for non-partitioned media (without MBR ).
20th 4th Total number of sectors, if greater than 65535

The data then differ depending on the FAT variant. With FAT12 and FAT16 this data structure follows:

Offset
(hex)
Length
(dec)
content
24 1 Physical BIOS drive number (00 hex for floppy disks, 80 hex , 81 hex ,… for hard disks). Is only relevant for boot drives because this number is used for BIOS calls during booting to access the medium.
25th 1 Reserved. This byte is often used to mark a possibly damaged file system.
26th 1 Extended boat signature
27 4th File system ID (serial number). Is generated when the file system is created and is used to differentiate between different media (e.g. for removable media)
2 B 11 File system name (padded with spaces). Outdated. Has been replaced by a special directory entry in the root directory
36 8th FAT variant, padded with spaces, e.g. B . FAT12   , FAT16   .
3E 448 x86 machine code of the boot loader
1FE 2 BIOS boot sector signature. Contains the two values ​​55 hex AA hex with which the BIOS recognizes a valid boot sector when booting.

FAT32 uses a different structure from offset 24 hex :

Offset
(hex)
Length
(dec)
content
24 4th Number of sectors per FAT
28 2 FAT flags
2A 2 FAT-32 version. At Microsoft always 0000 hex . (optional 0001 hex for FATplus)
2C 4th Cluster number at which the root directory begins. Mostly 2
30th 2 Sector number of the "FS Information Sector" (usually 1)
32 2 Sector number of the boot sector copy (usually: 6; Microsoft recommends not using any other value.)
34 12 reserved for later extensions, currently always 0
40 1 BIOS physical drive number
41 1 Reserved. This byte is often used to mark a possibly damaged file system.
42 1 Extended boat signature
43 4th File system ID (serial number)
47 11 File system name (unused)
52 8th FAT version. AlwaysFAT32   
5A 420 x86 machine code of the boot loader
1FE 2 BIOS boot sector signature. Contains the two values ​​55 hex AA hex with which the BIOS recognizes a valid boot sector when booting.

Reserved sectors

Sectors that are not used by the file system can be reserved between the boot sector and the first FAT. This area can be used by a boot manager or for operating system-specific expansions. Most FAT12 or FAT16 file systems have no other reserved sectors other than the boot sector. The FAT therefore follows directly after the boot sector. FAT32 file systems usually contain some extensions to the boot sector as well as a complete backup copy of the boot sector and the extensions.

FAT

The FAT is a kind of table of fixed size in which records are kept of the used and free clusters of a FAT file system. A cluster is the allocation unit consisting of one or more sectors that can be occupied by a file. The data area is divided into a fixed number of clusters. For each of these clusters there is an entry in the FAT that can indicate the following:

  • The cluster is not occupied, i.e. free.
  • The media is damaged in the location of this cluster.
  • The cluster is occupied by a file:
    • The FAT entry for the next cluster of the file has the number x , that is: the next cluster of the file is the cluster with the number x - 2 .
    • This is the last cluster in the file.

The size (in bits) and the range of values ​​of the table entries differ between FAT12, FAT16 and FAT32 as follows:

meaning Value (hex)
FAT12 FAT16 FAT32
free cluster 000 0000 00000000
broken cluster FF7 FFF7 0FFFFFF7
last cluster of a cluster chain FF8… FFF FFF8… FFFF 0FFFFFF8… 0FFFFFFF
other cluster of a cluster chain 002… FF6 0002… FFF6 00000002… 0FFFFFF6

The location of the occupied clusters of a file can be calculated from the addresses of the associated FAT entries. The FAT entries form a simply linked list .

Because of their fundamental importance for the file system, there are usually two copies of the FAT so that a second FAT still works in the event of data loss. In many cases, data recovery is possible with various programs .

Sometimes you won't find a second FAT on installation disks or media formatted with special programs, which increases the available storage space. In theory, it is also possible to format a file system with more than two FAT copies. These file systems can usually be read by any operating system, but the third (and every further FAT copy) is usually not updated during write access, so that if the first two FATs are damaged, it is often not possible to repair them with the aid of the other copies.

Root directory and subdirectories

The root directory , also called the root directory or main directory, is a table of directory entries. Each file or subdirectory is usually represented by a directory entry. The “long file names” extension introduced in Windows 95 may, however, use several directory entries per file or directory to accommodate the long file names.

With FAT12 and FAT16, the root directory follows the FAT directly and has a fixed size and thus a maximum number of directory entries. This is set when the file system is formatted and can no longer be changed later - except with special software.

With FAT32, the root directory has a variable size and can begin at any position in the data area.

There are different default sizes for the root directory depending on the media type. However, the size of the root directory can be freely selected with special formatting programs. For example, installation disks that contain very few archive files often have a minimal root directory that is only one sector in size and therefore only offers space for 16 directory entries.

Media type Storage
capacity
Number of
directory entries
Sectors for
root directory
8 ″ SD one-sided 250 KiB 68
8 ″ SD on both sides 500 KiB 68
8 ″ DD on both sides 1200 KiB 192
5¼ ″ DD one-sided 160 KiB 64 4th
5¼ ″ DD one-sided 180 KiB 64 4th
5¼ ″ DD on both sides 320 KiB 112 7th
5¼ ″ DD on both sides 360 KiB 112 7th
5¼ ″ HD on both sides 1200 KiB 224 14th
3½ ″ DD on both sides 720 KiB 112 7th
3½ ″ HD on both sides 1440 KiB 224 14th
3½ ″ ED on both sides 2880 KiB 240 15th
Hard drives variable 512 32

A directory entry consists of 32 bytes.

Offset (hex) Length (in bytes) content
00 8th File name without extension
The bytes that are not used are padded with spaces.
08 3 Extension
The unused bytes are padded with blanks.
0B 1 File attributes.
Bit 0: write protected; Bit 1: hidden; Bit 2: system file; Bit 3: volume label; Bit 4: subdirectory; Bit 5: archive; Bit 6–7: unused
The additional pseudo directory entries for VFAT (see below) have the attribute 0x0F (write-protected, hidden, system file, volume label)
0C 1 reserved
0D 1 Creation time in 10ms. From 0 to 199
0E 2 Creation time (format like time of last change at offset 0x16)
10 2 Creation date (format like date of the last change at offset 0x18)
12 2 Date of the last access (format like the date of the last change at offset 0x18)
14th 2 With FAT32, the top two bytes of the cluster
16 2 Time of the last change (5/6/5
bits for hour / minute / seconds)
The resolution of the seconds is 2 s (0..29)
18th 2 Date of last change
(7/4/5 bits for year / month / day)
Year: year since 1980; z. B. for 2007 = 27
1A 2 (Offset of the start cluster) + 2
1C 4th File size in bytes

Interaction: If a file is now to be read, the associated directory entry is searched for. In addition to the attributes, the start cluster can now be selected here. The other clusters are then searched out via the FAT. At the end of the search, the FAT table entry that contains the value FFFFFFh terminates.

A subdirectory is created as a normal file, except that the entry in the higher-level directory is marked with the appropriate bit. The structure of the entries is identical to that of the main directory. Since the clusters of the subdirectories are linked via the FAT, they can grow as required and there is no limit to the number of manageable files.

Deviations

File system of the Atari ST

The Atari ST uses a variant of the FAT12 file system for floppy disks and can therefore read and write floppy disks formatted and written to under MS-DOS. Originally, floppy disks formatted on the Atari could not be used under MS-DOS, but disks formatted under MS-DOS and then written to on the Atari could be used. These incompatibilities were corrected in later GEMDOS versions. The differences of the Atari implementation in detail:

  • Originally, the first bytes of the first sector of a bootable Atari floppy disk contained the opcodes of an assembler instruction for the Motorola 68000 processor, namely a jump instruction (“bra” for “branch always”) to skip the BPB. However, since these opcodes are used in many operating systems as an identifier in order to recognize a valid BPB format, the relevant part of an x86 CPU opcode was written there from TOS 1.04 .
  • With Atari disks, the OEM label begins at offset 2 instead of 3 in the boot sector, and it is only six bytes long instead of the usual eight. In the three bytes gained, Ataris store a serial number, which is supposed to ensure the change of floppy disks even without a floppy disk change signal. Since the OEM label is actually used in many Microsoft operating systems to identify the BPB format in question, an “unusual” OEM label can cause various interactions that make a medium no longer readable under these systems or the data structures when attempting to write destroy it in the file system. As long as the BPB entries do not deviate from the Microsoft standard, this is not a problem.
  • The media ID byte was originally not set correctly during formatting, which could lead to media not being recognized under other operating systems, especially since the BPB format is not exactly identical either.
  • If the floppy disk is bootable, the Atari boot sector is protected against bit errors with a checksum. The sum of all 16-bit big endian words in the boot sector must add up to 1234 16 , otherwise Ataris will consider the boot sector to be invalid. In order to get the correct checksum, the value at Offset + 1FE 16 was changed accordingly. However, since this normally contains the signature 55 16 , AA 16 (which should indicate an IBM-compatible boot sector) and this is evaluated by some systems, an unused byte in the code area should be changed instead to compensate.
  • Atari GEMDOS, like many versions of MS-DOS up to 3.x, only supports cluster sizes of up to 4 KB.

Examples

DOS or Windows floppy disk with FAT12

Offset value meaning
000 h -1FF h Boot sector
0B h -0C h 00 h 02 h = 512 512 (= 200 h ) bytes per sector, the most significant byte is at the end, i.e. 0 + 2 × 256
0D h 01 h = 1 1 sector per cluster (an entry in the FAT refers to one cluster)
0E h -0F h 01 h 00 h = 1 1 reserved sector, i.e. only the boot sector here (position 000 h to 1FF h )
10 h 02 h = 2 2 file allocation tables are available (normal)
11 h -12 h E0 h 00 h = 224 maximum 224 (= 00E0 h ) directory entries in the root directory, the root directory occupies 14 sectors
1 pm - 2 pm 40 h 0B h = 2880 2880 (= 0B40 h ) sectors (each 512 bytes, see above), i.e. 1440 KiB = 1440 · 2 10 = 1474560 bytes
15 h F0 h 3.5-inch floppy disk, double-sided, 18 or 36 sectors (in this case 18 sectors, see value under 18 h )
16 h -17 h 09 h 00 h = 9 9 sectors per FAT. The two FATs are located directly after the boot sector (sector 0, the only reserved sector) consequently on sectors 1–9 (200 h to 13FF h ) and 10–18 (1400 h to 25FF h )
18 h -19 h 12 h 00 h = 18 18 sectors per track (the number of tracks results from the total number of sectors 2880, distributed over two pages (see below), divided by 18 sectors per track, i.e. 80 tracks here)
1A h -1B h 02 h 00 h = 2 two sides or read / write heads: The geometry thus results in: 2 sides (heads) × 80 tracks (tracks) per side × 18 sectors (sectors) per track × 512 bytes per sector.
1C h -1F h 00 h 00 h 00 h 00 h = 0 no hidden sector in front of the boot sector
24 h 00 h = 0 Physical drive number (0 h for floppy disks)
36 h -3D h 46 h 41 h ... 46 h 41 h 54 h 31 h 32 h = "FAT12" (can, but does not have to be entered there)
1FE h -1FF h 55 h AA h Signature of the boot sector, must be there so that it is recognized as valid
200 h -13FF h F0 h FF h ... First FAT . The first bytes are listed here as an example:
F0 FF FF 03 40 00 05 60 00 FF 8F 00 09 A0 00 0B
3 bytes each refer to 2 clusters. The nibbles from cd ef stand for the 12-bit numbers dab efc. The first two entries are pseudo entries, the actual numbering begins with 2. The byte sequence in the example corresponds to the list FF0 FFF 003 004 005 006 FFF 008 009 00A 00B. Cluster 2 is continued over 3, 4, 5, 6 and ends in cluster 6 (entry FFF = −1) Cluster 7 is continued in 8, 9, A, B.
1400 h -25FF h F0 h FF h ... Second FAT . It contains the same:
F0 FF FF 03 40 00 05 60 00 FF 8F 00 09 A0 00 0B
2600 h -41FF h [...] Root directory (root directory): It has 14 sectors (s o..) And contains entries that are readable even in Hexdump (shortly 08.03 and possibly long format).
4200 h -45FF h [...] Data area : data cluster No. 2 and 3 of the diskette. (Each data cluster here is one sector in size, as defined under 0D h .)
4600 h -49FF h [...] Data clusters 4 and 5 of the floppy disk.

See also

Web links

Individual evidence

  1. a b Udo Kuhnt, Luchezar Georgiev, Jeremy Davis: FAT + Draft release, Rev. 2 . Retrieved March 24, 2007 .
  2. Limitations of the FAT32 file system in Windows XP. In: Help and Support. Microsoft Deutschland GmbH, May 24, 2011, retrieved on October 18, 2011 : "You cannot create files on a FAT32 partition that are larger than (2 ^ 32) -1 bytes (i.e. one byte less than 4 GB)"
  3. Maximum volume sizes. In: TechNet. Microsoft Technet, accessed January 11, 2016 : "32 GB (This is due to the Windows 2000 format utility. The maximum volume size that Windows 98 can create is 127.53 GB)."
  4. PCFreunde.de Tutorial: Partition hard drives under Windows with FAT32
  5. Brandon LeBlanc: Vista SP1 Whitepaper . Microsoft , August 28, 2007, archived from the original on September 12, 2008 ; Retrieved February 22, 2012 .
  6. Update for Windows XP (KB955704) . (No longer available online.) Microsoft on January 26, 2009, archived from the original on January 7, 2011 ; Retrieved February 22, 2012 . Info: The archive link was inserted automatically and has not yet been checked. Please check the original and archive link according to the instructions and then remove this notice. @1@ 2Template: Webachiv / IABot / www.microsoft.com
  7. Apple makes many Macs fit for Microsoft's exFAT file system. Retrieved November 11, 2010 .
  8. exFAT in the Linux kernel? Yes! In: microsoft.com. Open Source Blog, 2019, accessed August 29, 2019 (American English).
  9. a b Linux 5.4 released: exFAT support and restrictions for root. In: heise.de. November 26, 2019, accessed April 28, 2020 .
  10. Jonathan Corbet: 5.7 Merge window part 2. In: LWN.net. April 13, 2020, accessed August 17, 2020 .
  11. ^ Tuxera, the NTFS-3G File System Provider, Signs Intellectual Property Agreement with Microsoft. August 26, 2009, archived from the original on February 18, 2011 ; accessed on November 22, 2015 (English).
  12. exFAT fs and Linux. January 29, 2009, accessed August 30, 2009 .
  13. exFAT for Linux releases stable release. January 20, 2013, accessed January 20, 2013 .
  14. Samsung publishes exFAT drivers under GPL , heise open, August 16, 2013
  15. Description of the ExFAT file system driver. Microsoft, September 29, 2009, accessed February 22, 2012 .
  16. Standard cluster size for NFTS, FAT and exFAT. In: support.microsoft.com. November 30, 2018, accessed April 28, 2020 .
  17. TFAT Overview on MSDN (April 3, 2014)
  18. ^ Matthias Paul: Need DOS 6.22 (Not OEM) . In: alt.msdos.programmer. February 20, 2002, accessed October 14, 2006 .
  19. ^ Wally Bass : Cluster Size . In: comp.os.msdos.programmer. February 14, 1994, accessed October 14, 2006 .
  20. Floppy Disk is Not Accessible, Not Formatted, or Not Recognized by Windows. In: support.microsoft.com. Retrieved February 22, 2015 .
  21. Christoph Pfisterer: disktype Documentation, Chapter 3.3 .: ATARI ST