FAT12: calculating the root directory location

If you are new to OS Development, plan on spending some time here first before going into the other forums.

Moderator:Moderators

Post Reply
CodeVisio
Posts:4
Joined:Sun Sep 02, 2012 7:19 am
FAT12: calculating the root directory location

Post by CodeVisio » Tue Jul 18, 2017 1:53 pm

Hi,

I've been following your OS series development.

On "Operating Systems Development - Bootloaders 4" page, under the sections "Step 2: Get start of root directory" and "Root Directory - Complete example",
you show assembly code to calculate the position, as number of sectors, of the FAT12 root directory .

In particular you do:
(number of FATs) * (number of sector per FAT) + (number of reserved sectors)
2 * 9 + 1 = 19

Shouldn't it be:
(number of FATs) * (number of sector per FAT) + (number of reserved sectors) + boot sector
2 * 9 + 1 + 1 = 20

?


Thanks

CodeVisio
Posts:4
Joined:Sun Sep 02, 2012 7:19 am

Re: FAT12: calculating the root directory location

Post by CodeVisio » Fri Jul 21, 2017 8:38 pm

Hi again,

I'm going to answer myself, should someone else run into the same misunderstanding.

As those first sectors are layout on the OS Development tutorial causes misunderstanding, because the reserved-sectors sector comes right after the boot sector, forcing to think is something separated and different from the boot sector.

According to Wikipedia*, the number of reserved sectors includes, by definition, the boot sector as well.

Anyway, a big thanks to Mike for his effort in making this tutorial.



* https://en.wikipedia.org/wiki/Design_of ... ile_system

supriyala
Posts:3
Joined:Mon Feb 04, 2019 6:51 am

Re: FAT12: calculating the root directory location

Post by supriyala » Wed Feb 06, 2019 5:41 am

I was searching the answer for same question. Excellent answer by CodeVisio. Thank you.

Post Reply