Professional Documents
Culture Documents
Dir Structure
Files
F1 F2 F4
F3
Fn
Directory Structure
Single Level Directory
Tree-Structured Directory
Organization of disk partitions
Directory Table
The structure of an
entry in the directory
table of
MSDOS/WINDOWS
(FAT)
The structure of an
entry in the directory
table of CP/M
The structure of an
entry in the directory
table of UNIX
Continuous memory block allocation
Directory Table
Use one more structure:
linked list
index table
file allocation table
I-Nodes table
Non-continuous memory block allocation - linked
list
Example: A 20M disk, using a cluster of size 1K. To manage this disk, if
the disk is completely empty, how many blocks does the “Linked list”
need (the maximum number of nodes of “Linked list”)?
20M= 20x 210 blocks ~ 215 blocks => use 16 bit=2 byte in order to save a
cluster
=> 1 block =1024 byte can save 511 empty blocks
=> To manage this completely empty disk (20M) , “Linked list” need 20x
210/ 511 ~ 40 blocks
A lot of memory is used for “Linked list” if the disk is completely empty,
but less memory will be spent on “Linked list” if the disk is nearly full.
Manage list of empty blocks using linked lists
Management of empty blocks – Bit vector
Boot Sector
FAT table
ROOT DIR table
Boot Sector
On the first sector, track 0, side 0 of the floppy, for the hard
disk this position is the partition table, then the boot sector
of the first partition, for other partitions the boot sector is
the first sector.
The boot sector contains the BPB disk parameters table
(Bios Parameter Block) and contains the boot code used to
load system files.
On an IBM PC after performing POST (Power On Self
Test), ROM BIOS finds a valid boot sector, reads the boot
sector to 0X7C00, assigns CS = 0000h, IP = 7C00h and
executes the first command in boot sector (JMP command).
FAT table
Located behind the boot sector.
Each FAT entry manages a block of data.
The block size stored in the boot sector is typically
1 to 8 sectors.
There are three types of FAT are FAT 12 (4096
blocks) and FAT 16 (64 K blocks), FAT 32 (4G
blocks per partition).
ROOT DIR
Located right after FAT
Each entry of the DIR table is 32 bytes.
When the system opens a File/Directory, MS-DOS
looks for the File/Directory name in the ROOT
DIR table, gets the first block number assigned to
the File/Directory and looks for the next block
number in the FAT table.
MSDOS/Windows (FAT) file system
- Example