FAT32 Bootloader Problem
-
- Posts: 19
- Joined: Mon Dec 03, 2012 8:57 am
Re: FAT32 Bootloader Problem
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
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.
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();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: FAT32 Bootloader Problem
What is your purpose?
- Load a file from FAT32? Use ready-made boot tools.
- Learn to code in assembler? Use ready-made boot tools and start to develop kernel.
- Learn the FAT32 structure? Download official specs from http://msdn.microsoft.com/en-us/windows ... e/gg463080
- Meditate at FAT32 boot code source? Take one from FreeDOS at http://sourceforge.net/scm/?type=svn&group_id=5109