Page 1 of 1

Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 1:31 pm
by me239
I've been searching all over the Internet and found several examples of FAT12 boot loaders, but when I've written my own, nothing works. I've compared each function and BPB space and everything checks out, but alas it fails to boot. Please help

Re: Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 4:52 pm
by Combuster
I count 10 bytes to the start of the actual BPB data, where I expect 11.

Re: Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 5:26 pm
by me239
Thank you for responding. You said you counted 10 bytes to the bpb when it should have been 11. Would this actually affect the boot process if still jumps to the beginning of the boot code?

Re: Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 5:51 pm
by Combuster
It means you either don't have a valid FAT filesystem and that disk image utilities can't read it, or they override your bad attempt at a filesystem which means your code looks for data in the wrong places.

In any case, it isn't a FAT12 bootloader anymore.

Re: Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 6:10 pm
by me239
I made sure it was valid by testing in Windows by putting files on it, taking them off, etc. and everything worked. The tool I used was called 'BOOTABLE.EXE' and it came with MiniDOS from Dex4u. It stated that everything was in order. Is my code itself fine?

Re: Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 8:29 pm
by U238
You're not setting up DI or the loop counter for the root directory search routine. Therefore your bootloader is not searching the root directory, but rather a completely different location in memory, which generates an error because the file is not found.

Code: Select all

mov     CX, word[maxrootentries]
mov     DI, 0x0200
Adding this before the searching routine should fix the problem you've been having.

Hope I helped. - U238

Re: Help with FAT12 bootloader

Posted: Fri Jan 14, 2011 10:11 pm
by me239
thanks, I'll be sure to try it