Page 3 of 3

Re: FAT32 Bootloader Problem

Posted: Thu Dec 13, 2012 4:42 pm
by tonydemann
Isn't there a good tutorial for a FAT32 bootloader? I'm not able to get it running... The only tutorial i found is about loading the first file of a fat32 system (but i want to load a file which can be anywhere on the disk in the root dir) or i found some about fat12, but then my 8gb usb stick would only have about 4mb or so :(

Re: FAT32 Bootloader Problem

Posted: Thu Dec 13, 2012 5:27 pm
by neon
Hello,

If you know how to read fat12 from those tutorials you can easily adjust that knowledge to that of fat16 and fat32 due to their similarity in design. I am not aware of any fat32-specific tutorial but those fat12-specific tutorials can be used for a fundamental understanding of the FAT file systems. Of course there is always the FAT specification that has all the info you'll need.

The invalid command does indeed mean your DAP structure might be malformed. I do encourage using the stack to save space for the DAP here since some of its members are dynamic (like the segment,offset, and sectors.)

Your structure looks a little off. It should look something like the following.

Code: Select all

DAP:
   .addrPacketSize: dw 16 
   .wSectorsToRead: dw 1
   .wOffset: dw 0 
   .wSegment: dw 0x7C00 ; are you sure you want 0x7c00:0?
   .dSectLo32: dd 0 ; can also just do qSect dq 0 here
   .dSectHi32: dd 0

Re: FAT32 Bootloader Problem

Posted: Fri Dec 14, 2012 2:18 am
by Yoda
What is your purpose?