File I/O: Embedded Systems Interfacing
File I/O: Embedded Systems Interfacing
Overview
DOS Data Structure
File I/O Sectors and Clusters
Master Boot Records/Boot Record
File Allocation Table
Embedded Systems Interfacing Root Directory
Interfacing
Subdirectory File
File IO Module
1 2
Boot Record Disk Type 0:0000 0 N.A. Master Boot Record which contains the Partition table
1:DA00 0ED N.A Boot Record
FAT #1
•MBR, BR, FATs and 1:DC00 0EE N.A File Allocation Table 1 with 16-bit FAT entries
FAT #2 Root not covered by 2:CE00 167 N.A. File Allocation Table 2 with 16-bit FAT entries
3:C000 1E0 N.A. Root Directory with VFAT and directory entries
Root Directory FAT Cluster Numbers
4:0000 200 2 Bill of Right.txt
Code for
0x01BF 1 Byte 0x03 Starting Head (Boot Record)
7
Go to LBA 0x000000ED for Boot Record 8
Media
Standard Information in BIOS Parameter Block
• 512 Bytes/Sector
Read/Executed By B.I.O.S. • 32 Sectors/Cluster
• 1 Reserved Sector
• 2 FATs
• 200 Directory Entries (x 32 Bytes/Entry)
9 10
0x16 2 Bytes 0x0079 Sectors per File Allocation Table (121) 0x0000 Free cluster
0x18 2 Bytes 0x003F Sectors per track (63) 0x0001 Reserved cluster
13 14
15 16
17 18
19 20
23 24
25 26
33 34
37 38
39 40
41 43