Page 1 of 1

Fat boot sector

Posted: Thu Sep 07, 2006 12:28 am
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?

Re:Fat boot sector

Posted: Thu Sep 07, 2006 2:33 am
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...

Re:Fat boot sector

Posted: Thu Sep 07, 2006 4:13 am
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

Re:Fat boot sector

Posted: Thu Sep 07, 2006 5:42 pm
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.

Re:Fat boot sector

Posted: Thu Sep 07, 2006 7:40 pm
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