200 likes | 313 Views
Troisième Partie Chapitre 7 L’organisation des mémoires périphériques et la gestion des fichiers. Physical disk organization Logical to physical mapping DOS & Windows : File Access Table (FAT16) UNIX – LINUX : inode Windows NT : Master File Table Disk directories System calls.
E N D
Troisième Partie Chapitre 7 L’organisation des mémoires périphériques et la gestion des fichiers
Physical disk organization Logical to physical mapping DOS & Windows : File Access Table (FAT16) UNIX – LINUX : inode Windows NT : Master File Table Disk directories System calls Contents
Disk Organization Track Sector Cylinder
What is the optimal size of a disk sector ? Small sectors : good for small disks Reduce slack Large sectors : good for large disks Increase disk throughput Reduce number of bits in sector number It is desirable to have a single sector size for all disks ! Solution : define clusters as groups of sectors with size optimized for each specific disk. Transfer entire clusters instead of sectors Each cluster on disk has a Physical Cluster Number (PCN) Clusters vs. Sectors
Format of 3.5” diskettes for PC’s. Double Density High density 2 Tracks/cylinder 2 Cylinders 80 80 Sectors/track 9 18 Bytes/sector 512 512 Total Capacity(in bytes) 737 280 1 474 560 Sectors/Cluster 2 1
Tracks/cylinder Cylinders Sectors/track Bytes/sector Total Capacity(in bytes) Format of 428 MBytes Hard Disk. 15 899 62 512 428 067 840 Sectors/Cluster 16
File/disc mapping Logical file structure Physical Disc Structure
10 5 12 13 11 14 LCN = 0 1 2 3 MS/DOS : the FAT 16 Stream a 1 2 9 0 Stream b 3 4 Stream c 8 ... Stream d 15 16 17 18 19 ... PCN ... Free 6 7
File Access Table(MS/DOS) Cluster x FAT One entry per Physical Cluster Number Cluster 0 DISK Two copies of the FAT are stored on track 0.
Minimum Cluster Size (with a 16 bit FAT) When cluster numbers have only 16 bit, no more than 65536 clusters can be defined on any disk, this implies very large clusters on large disks Disk Size 128 MB 256 MB 512 MB 1 GB 2 GB 4 GB 8 GB Sectors/Cluster 4 8 16 32 64 128 256 Cluster Size 2 kB 4 kB 8 kB 16 kB 32 kB 64 kB 128 KB
UNIX/LINUX inode 10 Logical clusters of data on disk 256 256 256 ... ... ... Logical clusters of data on disk (up to 256) 256 256 ... ... 256 256 ... ... Logical clusters of data on disk (up to 256*256) 256 256 256 256 ... ... ... ... Logical clusters of data on disk (up to 256*256*256)
0 1355 4 4 1588 5 LCN to PCN mapping in MS/NT starting LCN starting PCN no.of clusters 4 5 6 7 8 0 1 2 3 LCN= 1588 1589 1590 1591 1592 1355 1356 1357 1358 PCN=
Directory Tree \ info ex 1b 2b acs 3E \info\ex\3E
Attributes 1 byte bit 0: read only bit 1: hidden bit 2: system file bit 3: volume label bit 4: subdirectory bit 5: archive bit MS/DOS Directory Entry Base Name 8 bytes Extension 3 bytes Time of creation 2 bytes Date of creation 2 bytes Starting FAT entry 2 bytes File size 4 bytes
Unix Directories \ info txt ex new 3E \info\ex\3E \txt\new
File Name Standard Information Security Descriptor Data 1,2 or 4 KBytes MS/NT Master File Table
MS/NT Data Files Small file: File Name Standard Information Security Descriptor Actual Data Large file: File Name Standard Information Security Descriptor LCN to PCN mappings 4 5 6 7 8 0 1 2 3 LCN= 1588 1589 1590 1591 1592 1355 1356 1357 1358 PCN=
LCN= PCN= MS/NT Directories Small directory: File Name Standard Information Security Descriptor Index of files in MFT f1,f2,f3 Large directory (organized as a Btree): File Name Standard Information Security Descriptor LCN to PCN mappings + bitmap f3 f7 0 1 2 3 4 5 6 7 8 9 10 11 f6 f1 f2 f4 f5 f8 f9 1355 1356 1357 1358 1588 1589 1590 1591 1648 1649 1650 1651
create file, delete file open, close read, write, reposition get file attributes, set file attributes System CallsFile Manipulation