Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 9: The FAT and VFAT Filesystems 6/16/2003 CSCE 590 Summer 2003.

Similar presentations


Presentation on theme: "Lecture 9: The FAT and VFAT Filesystems 6/16/2003 CSCE 590 Summer 2003."— Presentation transcript:

1 Lecture 9: The FAT and VFAT Filesystems 6/16/2003 CSCE 590 Summer 2003

2 Disk Drive Review Disks or platters of magnetic material –Can be one or two sided –Rated to hold a certain amount of magnetic charge Motor to spin the disks Set of read/write/erase heads –Read/write heads sandwiched between two erase heads Actuator (stepper motor) to position heads Interface (circuitry) to transfer data to and from disk

3 Disk Drive http://www.ntfs.com/hard-disk-basics.htm

4 Low Level Formatting Setting down a series of concentric circles (tracks) on each disk Division of tracks into wedge shaped sectors –A sector holds 512 bytes –Smallest physical storage unit on disk –Sectors are numbered starting with 1 Numbers of tracks and sectors is standardized

5 Tracks 1024 tracks on a side of a platter in a hard disk 80 tracks per side on a 3.5” HD floppy Outside track is numbered 0 –Old days innermost track is numbered 1023 (BIOS limitation) –Large Block Addressing (LBA) tricks the BIOS into handling bigger, more complicated modern disks In a stack of platters, the n th track on each side of each platter makes up the n th cylinder –When all heads are in the same position on the disk –Older disk drives would identify a sector by cylinder/head/sector notation

6 Sectors Outside of disk spins faster than inside. Old days, fixed number of sectors on a track (63) –Data density increased towards the center of the disk Now, use zoned-bit recording where there are more sectors towards the outside of the disk –The raw data transfer rate is greater on the outside tracks or zones, and we write to the outside (0 th ) track first, so drive appears to get slower as it ages! –Why modern hard drives are low level formatted at the factory

7 Sectors http://www.pctechguide.com/04disks.htm Any sector can be referenced by its platter number, side number (0 or 1), track and sector numbers

8 Starting and Ending Head, Sector and Cylinder Maximum Formatted Capacity = (sector size) x (sectors per track) x (cylinders) x (heads) Ranges of values –Head fields (1 byte) ~ range 0 to 2 8 – 1 = 256 values –Sector fields (6 bits) ~ range 0 to 2 6 – 1 = 64 values –Cylinder fileds (10 bits) ~ range 0 to 2 10 – 1 = 1024 values Maximum Formatted Capacity = (sector size) x (sectors per track) x (cylinders) x (heads) = 512 x 64 x 1024 x 256 = 2 9 x 2 6 x 2 10 x 2 8 = 2 33 = 2 3 x 2 30 = 8,455,716,864 = 7.8 GB

9 High Level Formatting Placing a series of tables, data structures, and code into the first few sectors of the disk Master Boot Record (MBR) –In very first sector (cylinder 0, head 0, sector 1) –Contains master partition table –And boot code

10 Master Boot Record Processor always starts executing at the same place on boot BIOS loads initial boot program from MBR that starts the process of loading the operating system Boot program checks the Partition Table and identifies system partition Loads the system’s Partition Boot Sector into memory and transfer control to the executable code in the Partition Boot Sector

11 Partition Table Each entry 16 bytes long Maximum four entries Boot Indicator field for x-86 based computers –RISC computers use the NVRAM contains info on where to boot System ID Field – describes the type of file system used to format the volume

12 Byte offsetField LengthSample ValueMeaning 001 byte0x80Boot Indicator 00 = Do not use for booting 08 = System partition 011 byte0x01Starting Head 026 bits0x01Starting Sector 0310 bits0x00Starting Cylinder 041 byte0x06System ID (volume type) 051 byte0x0FEnding Head 066 bits0x3FEnding Sector 0710 bits0x196Ending Cylinder 084 bytes3F 00 00 00Relative Sector 124 bytes51 42 06 00Total Sectors Partition Table Format

13 Extended Partitions Used when there are more than four partitions Not used for bootable/system partitions Can create any number of logical volumes in an extended partition The entry in the Partition Table for an extended partition points to the first sector of the extended partition, which is another Partition Table

14 Extended Partition Table Entries contain: –Current logical drive –Info about the next logical drive –Entries three and four are all zeroes Each logical drive has its own Partition Table that points to the next logical drive

15 File Allocation Table (FAT) The FAT file System is a simple file system. The File Allocation Table resides at the start of the volume Duplicate copy maintained for recovery In the FAT file system space is allocated in clusters. The size of the default cluster is determined by the size of the volume The cluster number must fit in 16 bits and be a power of 2. Partition Boot Sector Fat-1Fat-2 Duplicate Root FolderOther folders and files

16 Differences Between FAT Systems SystemBytes per Cluster Cluster Limit FAT121.5 Number of Clusters <= 4087 FAT1624087 <= # Clusters <= 65526 FAT32465526 <= # Clusters <= 268,435,456

17 FAT Partition Boot Sector The Partition Boot Sector contains information to access the volume Fields in Partition Boot Sector Byte offsetField LengthSample ValueMeaning 003 bytesEB 3C 90Jump Instruction 038 bytesMSDOS5.0OEM Name in Text 0B25 bytesBIOS Parameter Block 2426 bytesExt. BIOS Par. Block 3E448 bytesBootstrap Code 1FE2 bytes0x55AASector End Marker

18 BIOS Parameter Block and Extended Parameter Block Fields Contains specific information about the volume, such as: –Bytes per sector. –Sectors per cluster –Number of reserved sectors before the first FAT –Number of FATs. –Number of root directory entries (max limit)

19 File Allocation System Uses a File Allocation Table to to organize the file system and keep track of cluster usage Two copies of the FAT are kept (in older versions of FAT, adjacent to each other, in the same cluster) Files are given first available cluster in the partition Also uses folders to indicate where in the FAT the info for a file may be

20 File Allocation Table Information Information on clusters –Unused 0x0000 (free) –Cluster in use by a file –Bad cluster (0xFFF7) –Last cluster in a file (0xFFF8-0xFFFF) If a file consists of multiple clusters then the end of the first cluster contains a link to the next cluster in the file. Example http://www.ntfs.com/fat-allocation.htm

21 FAT Root Folder Root folder contains each entry for each file and folder on the root At a fixed location Fixed size 512 entries for a hard disk Other folders contain similar entries but can be anywhere on the disk and have unlimited (relatively) entries

22 FAT Folder Structure Folder entries include –Name (8+3 characters) –Attribute byte –Creation time –Creation date –Last access date –Last modified time –Last modified date –Starting cluster number in the file allocation table (16 bits)

23 FAT Filenames Old 8+3 names, eight bits for the name, three bits for the extension

24 VFAT Longer names are supported but backward FAT compatibility is maintained in VFAT Example of conversion and storage –“The quick brown.fox” – 15 + extension –“THEQUI~1.FOX” made up name Unicode  2 bytes for each character in the long name Windows sets volume, read-only, system, and hidden attributes on log filename entries to get backwards compatible to ignore these fields

25 VFAT Long Filename Storage 0123456789101112131415 2nd long entry 0x42wwnn..ffoo0x0F0x00Chek sum xx 0x00 0xFF 0x00 0xFF 1rst long entry 0x01TThhee qq0x0F0x00Chek sum uu iicckk bb0x00 rroo Short Entry THEQUI~1FOX0x20NTCreate Time CreaDateLastAces0x00 LastMod. Time LastMod. Date FirstClust er FileSIze……….……

26 http://www.ntfs.com/


Download ppt "Lecture 9: The FAT and VFAT Filesystems 6/16/2003 CSCE 590 Summer 2003."

Similar presentations


Ads by Google