OSDev.org

The Place to Start for Operating System Developers
It is currently Mon Mar 18, 2024 11:04 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: FAT12 Root Directory Question
PostPosted: Sun Dec 30, 2018 6:09 am 
Offline
Member
Member

Joined: Wed Apr 25, 2018 2:44 pm
Posts: 33
Hi, I've been working on a simple MSDOS style operating system but I'm having issues with the FAT12 File system, specifically the root directory entries. Whenever I add a file such as a PDF file to the disk, the root directory adds the typical 8:3 entry, however, when I add my Kernel.bin file, I notice two entries are added in the root directory. The first entry added is "AK e r n e l". This entry takes up 32 bytes. The second entry is the typical FAT12 entry with the 8:3 file name and the data associated with it. Ive been searching the Internet for days for an answer to this mystery but I can't seem to find anything about it. I even bought the book Modern Operating Systems by tanenbaum yet it doesn't mention this.

My boot code keeps recognising this as the actual kernel entry, so when I check the bytes at 0x0A and 0x0B, the first cluster isn't there and it just jumps into some random location in memory. Can someone explain this to me because its been driving me crazy for ages now.

Thanks for any help you guys can offer.


Top
 Profile  
 
 Post subject: Re: FAT12 Root Directory Question
PostPosted: Sun Dec 30, 2018 7:40 am 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
The thing you're talking about is called a long file name entry. It gets automatically created once you add a file to your FATxx medium.
It is useful because it preserves the entire file name, aka your file name can be longer that 8 letters and have both lower and upper case.
For example:
Short file name: HELLOWOR.TXT
Long file name: Hello World Something Something.txt

_________________
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader


Top
 Profile  
 
 Post subject: Re: FAT12 Root Directory Question
PostPosted: Sun Dec 30, 2018 7:43 am 
Offline
Member
Member

Joined: Wed Apr 25, 2018 2:44 pm
Posts: 33
Oh right, thanks. It's been bothering me for ages.


Top
 Profile  
 
 Post subject: Re: FAT12 Root Directory Question
PostPosted: Sun Dec 30, 2018 9:05 am 
Offline
Member
Member

Joined: Wed Aug 30, 2017 8:24 am
Posts: 1590
If your FAT12 code worked correctly, you would notice that these entries are invalid, since they have the volume label and system bits set.

Anyway, if you're interested, search for VFAT.

_________________
Carpe diem!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group