2007년 07월 12일
File system #1 - the structure of FAT file system

- The structure of FAT file system
FAT16 and FAT32 are almost fundamentally same, but there are several differences between two file systems. The most significant difference is the existence of "Root directory area." In case of FAT16 file system, the "Root directory area" must be right after FAT #2 area. But, in FAT32 file system, there is no restriction of the location of "Root directory area", because FAT32 file system considers root directory as one of common directories.
- Boot record
This area means the first sector of a volume and the first sector of "Reserved area." In this area, there are assembly program code for booting a Windows operating system and several parameters of FAT file system. The second area is called "BIOS Parameter Block(BPB)." Even though this area is a small area which occupies just 1 sector, this area is in charge of the most important role. Because OS analyzes this area whenever OS tries to recognize a given volume. The format of boot record slightly different between FAT16 and FAT32.
- Reserved area
This area is reserved for the future. Normally, FAT16 allocates 1 sector for this area and FAT32 allocates 32 sectors for this area. In case of FAT16, if the size of reserved area is just 1 sector, FAT area is right after the boot record area because the boot record area uses 1 sector for itself. This area is not used in common FAT system, so programmers can use this area for their own purpose - save custom information, etc. But, FAT32 uses some sectors of the "Reserved area" for storing some information. Please pay attention to keep these sectors from a overwriting or a erasing.
- FAT #1 and FAT #2 areas
FAT area is the area has cluster management tables. Through FAT area, the programmer can grasp which cluster is empty and which cluster is connected to a certain file. If this area is damaged, FAT never work again - catastrophe! Fortunately, there is a copy of FAT area or more that is FAT #2 area and, of course, FAT #1 is the original. FAT #1 area and FAT #2 has exactly same data. For safe, file system has more than 1 FAT area and can have 3 or more.
- Root directory area (only FAT16)
In FAT16, the location of "Root directory" always right after FAT #2 area. (The location is fixed but the size can be variable.) This structure has an advantage that there is no need to search the location of root directory, however, there are some disadvantages - limited number of files, etc. Because of these drawbacks, the structure had been changed in FAT32. FAT32 just record the location of the root directory, so the location of the root directory is not concerned. Only weak point of this way is that the system is not able to know the location of the root directory if the boot record is destructed. Because of this problem, most of FAT32 codes put the root directory just after FAT #2 area. In this way, the system can find the root directory even though the boot record is seriously damaged.
- Data area (files and directories)
Every files and directories are stored in this area. This area is read and writen by the cluster, the logical unit, basis but other areas are based on the sector.
- Unused area
During FAT file system structurize the volume, there is always a surplus. This area is the surplus and can be used physically. But the size of this area is really small, the programmer usually don't use this area.
# by | 2007/07/12 00:22 | Embedded System | 트랙백 | 덧글(5)

















![[제주여행]한라산 등반 코스](http://md.egloos.com/img/adm/life/default_noimg.gif)










☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]
PPT 를 준비 중인데 출처를 밝혀서 참고 하도록 하겠습니다. 건강하세요..