FAT12 Boot Sector

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
chiba

FAT12 Boot Sector

Post by chiba »

Hi all,

The FAT12 filesystem (unlike some others it appears) seems to specify the boot sector (first sector) in some manner. The first instruction jumps over this 62 (??) byte region into the code.

When writing a boot loader for a FAT12 filesystem, is the normal practice to skip this section (hence preserving it) or to just overwrite it and drop your own version of the same data there?

Thanks in advance!
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:FAT12 Boot Sector

Post by kataklinger »

Those ~62 bytes ar BIOS PARAMETAR BLOCK or BPB which holds information about file system, you can overwrite it with your data but be sure what you are doing. If you put wrong data there maybe you won't be able to access file system.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:FAT12 Boot Sector

Post by Candy »

chiba wrote: Hi all,

The FAT12 filesystem (unlike some others it appears) seems to specify the boot sector (first sector) in some manner. The first instruction jumps over this 62 (??) byte region into the code.

When writing a boot loader for a FAT12 filesystem, is the normal practice to skip this section (hence preserving it) or to just overwrite it and drop your own version of the same data there?

Thanks in advance!

If you want to keep it FAT12, it's your own choice. Overwrite it with compatible values and other operating systems will recognise it, overwrite it with others and it might be a different filesystem altogether, so other OSes will refuse to recognise it. Windows is the only one cocky enough to say "I can't read it - it must be noise".
chiba

Re:FAT12 Boot Sector

Post by chiba »

Thanks for the clarification. I'll take note of the existing values and will essentially duplicate them.
User avatar
kataklinger
Member
Member
Posts: 381
Joined: Fri Nov 04, 2005 12:00 am
Location: Serbia

Re:FAT12 Boot Sector

Post by kataklinger »

And before you start read FAT specification: http://www.microsoft.com/whdc/system/pl ... atgen.mspx
Post Reply