Skip to content

Commit c53aa92

Browse files
Fix FAT12 table and update comment
The fix provide a better understanding of the FAT12 table
1 parent c2f94c2 commit c53aa92

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

examples/MassStorage/msc_ramdisk/ramdisk.h

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,14 @@ uint8_t msc_disk[DISK_BLOCK_NUM][DISK_BLOCK_SIZE] = {
9090

9191
//------------- Block1: FAT12 Table -------------//
9292
{
93-
0xF8, 0xFF, 0xFF, 0xFF, 0x0F // // first 2 entries must be F8FF, third
94-
// entry is cluster end of readme file
93+
0xF8, 0xFF, 0x00, // The first 2 12bit entries of the FAT linked list are reserved. Therefore the first 3 bytes are reserved.
94+
// The 2 12 bit values must be 0xF8 and 0xFF
95+
96+
// [Entry2 | Entry3]
97+
0xFF, 0x0F, 0x00 // <<< These 3 bytes represents the 12 bit entries 2 and 3 of the FAT linked list.
98+
// The README.TXT file first block is 2 (see line 112), therefore to find the next block, we go to this section Entry[2]
99+
// to read the address of the next block. Since the size of the README.TXT is 65 bytes and less then one sector (512) byte.
100+
// There is no next block to read therefore the Entry[2] contains the value 0xFFF, which is the EOF.
95101
},
96102

97103
//------------- Block2: Root Directory -------------//

0 commit comments

Comments
 (0)