Rip apart my boot sector(s)
Posted: Sat May 28, 2005 6:21 pm
I've written a boot sector to boot from a FAT32 hard drive as shown here:
http://www.iualdii.net/boot.asm.html
Don't worry, you don't need to read the whole thing, it's towards the end of the first sector that matters. I have a load of sectors together like that as it allows me to simply copy over a single binary for the whole first load of sectors. The output I get from it is:
Starting boot...
Loading second stage...
Jump error
So basically, it all works fine up til it loads the second stage. It tests the value at the location it loaded it (well... 4 bytes further) and finds the wrong thing there. The code for the checking etc isn't meant to be completely coherent at the moment as once I get it working I'm gonna rewrite it a bit anyway, it's just for testing purposes right now.
My main problem is finding out whether it loads it incorrectly or if it tests the value incorrectly, so I'd be very grateful if someone could help me out there.
Also, what other miscellaneous issues are relatively obvious? It all appears to work up to that point (to be honest, there's not much done up to there), but as it was written from scratch with limited references I'm guessing there will be a lot of bad practices going on.
Thanks for reading this far.
http://www.iualdii.net/boot.asm.html
Don't worry, you don't need to read the whole thing, it's towards the end of the first sector that matters. I have a load of sectors together like that as it allows me to simply copy over a single binary for the whole first load of sectors. The output I get from it is:
Starting boot...
Loading second stage...
Jump error
So basically, it all works fine up til it loads the second stage. It tests the value at the location it loaded it (well... 4 bytes further) and finds the wrong thing there. The code for the checking etc isn't meant to be completely coherent at the moment as once I get it working I'm gonna rewrite it a bit anyway, it's just for testing purposes right now.
My main problem is finding out whether it loads it incorrectly or if it tests the value incorrectly, so I'd be very grateful if someone could help me out there.
Also, what other miscellaneous issues are relatively obvious? It all appears to work up to that point (to be honest, there's not much done up to there), but as it was written from scratch with limited references I'm guessing there will be a lot of bad practices going on.
Thanks for reading this far.