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

FAT12: calculating the root directory location

Postby 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

Postby 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_the_FAT_file_system
CodeVisio
 
Posts: 4
Joined: Sun Sep 02, 2012 7:19 am


Return to Beginning OS Development

Who is online

Users browsing this forum: No registered users and 3 guests

cron