Fat 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
omin0us

Fat boot sector

Post by omin0us »

ok, i have been looking at the specs from http://osdever.net/documents/fatgen103.pdf?the_id=40

and it says the first sector should have all the information about the filesystem.

well, when i read it in.
the jump boot code is there, and the OEM id is there, but after that, everything appears to be wrong. its reporting 258bytes per sector, and 0 fats. but i dont think it is actually messed up, because grub loads things perfectly fine from the floppy image, and when i mount it in linux i can manipulate the filesystem. which i wouldn't figure i could do if it was really all messed up.

i have double checked my struture in my code, and it follows the documentation exactly. and have even looked at other example code and it matches.

any insight as to why this all looks this way?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Fat boot sector

Post by Pype.Clicker »

omin0us wrote: its reporting 258bytes per sector, and 0 fats.
doh! it must be diet floppy ;D

nah, seriously, with a look at your code, it'd be easier to point something wrong ... when you say "it reports", that's code in the bootsector or some other code?

If that's C code reporting the stuff, i'd first make sure the sizeof(BPB) is indeed the expected size...
Habbit

Re:Fat boot sector

Post by Habbit »

Pype.Clicker wrote: doh! it must be diet floppy ;D
A diet floppy with a fat bootsector is a very bad combination: the floppy goes mad seeing the bootsector eat all day round, and one day, when it's in the drive, it just loses its mind and spins out of its case, beheading anyone near the computer :o
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:Fat boot sector

Post by Candy »

Pype.Clicker wrote:
omin0us wrote: its reporting 258bytes per sector, and 0 fats.
doh! it must be diet floppy ;D

nah, seriously, with a look at your code, it'd be easier to point something wrong ... when you say "it reports", that's code in the bootsector or some other code?

If that's C code reporting the stuff, i'd first make sure the sizeof(BPB) is indeed the expected size...
I'm with Pype, you're probably having a bit of fat around the edges of your BPB. Ehm, padding.
evincarofautumn

Re:Fat boot sector

Post by evincarofautumn »

With only a few extra bytes per serving, the fat-free filesystem might just transform your fat floppy into a firm one. If you're not completely satisfied with the results...

;D
Post Reply