Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8566725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T17:43:16+00:00 2026-06-11T17:43:16+00:00

I’m working on a low-level application which uses a FAT16 file system structure on

  • 0

I’m working on a low-level application which uses a FAT16 file system structure on a resource-constrained microcontroller which necessitates that I write my own custom access code. I’ve already looked into using libraries like Petit FAT and FatFS but unfortunately I don’t think either of these will suite my needs. They have served as useful references for how FAT works, though.

The one area that I’m still having troubles with is sub-directory entries.

According to this, a directory entry is able to point to 1 start cluster. For a data file, this is simply the first data cluster. For a directory, this is the starting cluster of the sub-directory (presumably another directory entry).

This works fine if there’s only 1 directory path from a root directory down to the base file, but I don’t understand how this allows you to branch out to multiple files/directories underneath any given directory.

ex. directory structure:

- root dir 1
    - sub dir 1
        - file 1
    - sub dir 2
        - file 2
- root dir 2
    - sub dir 3

Based on my understanding of the FAT16 structure,

Immediately following the FATs will be the cluster for the first root directory entry, containing information for root dir 1. The first cluster field would then contain the cluster address for sub dir 1, who’s first cluster field would contain the cluster address for file 1, who’s first cluster points to a data cluster.

The second root directory entry would then start at the second cluster after then end of the FATs containing information for root dir 2. Its first cluster would point to the cluster for sub dir 3, who’s first cluster would point to an empty cluster (as marked in the FATs).

What am I missing here? I can’t figure out a way to navigate from a root directory entry down to sub dir 2.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T17:43:17+00:00Added an answer on June 11, 2026 at 5:43 pm

    First, to clear the confusion, one directory entry does not occupy a single cluster. As you can see from your source, a single directory entry is just 32 bytes, where the size of cluster can be something like between 4KB to 64KB, depends on the disk size/version of FAT you’re using. So, what comes after FAT is actually a table of directory entries.

    For subdirectory, you can find the starting cluster of its directory entry table in the parent directory entry. They do not necessarily be packed to the beginning of the disk.

    To explain further, let’s look at a slightly modified version of your original example:

    \ (root)
        - dir 1
            - sub dir 1
                - file 1
            - sub dir 2
                - file 2
        - dir 2
            - sub dir 3
    

    To traverse to sub dir 2:

    1. Locate the root directory entry table, which contains in the cluster right after the FAT;
    2. Look for the entry dir 1 from the root directory entry table, and get its starting cluster;
    3. Load the directory entry table for dir 1 from the cluster you’ve obtained above;
    4. Look for the entry sub dir 2 and get its starting cluster;
    5. Load the cluster obtained above;

    Then you should now have the directory entry table for sub dir 2.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.