Raw filesystem dump (240 bytes)Super block information (32 bytes)
                      00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
               --------------------------------------------------------------------------
 super block / 000000 08 00 01 00 10 00 08 00  04 00 04 00 FA 00 00 00   ................
             \ 000010 00 00 00 00 00 00 00 00  56 46 53 2D 33 00 00 00   ........VFS-3...

             / 000020 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
dir. entries | 000030 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 000040 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             \ 000050 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
              
         FAT | 000060 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................

             / 000070 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 000080 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 000090 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 0000A0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
   data area | 0000B0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 0000C0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 0000D0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             \ 0000E0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
       Total sectors:   8
 Sectors per cluster:   1
    Bytes per sector:  16
   Available sectors:   8
   Directory entries:   4
Available direntries:   4
     Filesystem type:  FA
            Reserved: 00 00 00 00 00 00 00 00 00 00 00
               Label: 'VFS-3'



Comments:
When a "real" filesystem is created there is no guarantee
that all of the data blocks have been initialized to 0.
What will likely happen is that the values will be whatever
random garbage happens to be on the disk at that
location when the filesystem was created. The directory
area and file allocation table (FAT) will likely be
initialized to 0.


After creating file9.txt:

Raw filesystem dump (240 bytes)Super block information (32 bytes)
                      00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
               --------------------------------------------------------------------------
 super block / 000000 08 00 01 00 10 00 07 00  04 00 03 00 FA 00 00 00   ................
             \ 000010 00 00 00 00 00 00 00 00  56 46 53 2D 33 00 00 00   ........VFS-3...

             / 000020 66 69 6C 65 39 2E 74 78  74 00 00 00 09 00 00 00   file9.txt.......
dir. entries | 000030 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 000040 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             \ 000050 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
              
         FAT | 000060 FF FF 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................

             / 000070 39 20 63 68 61 72 73 2E  0A 00 00 00 00 00 00 00   9 chars.........
             | 000080 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 000090 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 0000A0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
   data area | 0000B0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 0000C0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             | 0000D0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
             \ 0000E0 00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ................
       Total sectors:   8
 Sectors per cluster:   1
    Bytes per sector:  16
   Available sectors:   7
   Directory entries:   4
Available direntries:   3
     Filesystem type:  FA
            Reserved: 00 00 00 00 00 00 00 00 00 00 00
               Label: 'VFS-3'



Comments:
Each new file will decrement the value of Available
direntries. Each block that is consumed by a new
file will decrement the value of Available sectors.

When creating a new file, all four sections will require some modifications:

  1. Superblock - Update available_sectors and available_direntries.
  2. Directory entries - Update a directory entry with the filename, the FAT entry, and the file size.
  3. FAT - Update the corresponding FAT entry.
  4. Data area - Use the block(s) pointed to by the FAT entry/entries.