FAT32 Bootloader Problem

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.
tonydemann
Posts: 19
Joined: Mon Dec 03, 2012 8:57 am

Re: FAT32 Bootloader Problem

Post 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 :(
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: FAT32 Bootloader Problem

Post 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
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
User avatar
Yoda
Member
Member
Posts: 255
Joined: Tue Mar 09, 2010 8:57 am
Location: Moscow, Russia

Re: FAT32 Bootloader Problem

Post by Yoda »

What is your purpose?
Yet Other Developer of Architecture.
OS Boot Tools.
Russian national OSDev forum.
Post Reply