Now that mystery is solved. And start.S in the stage2 directory has the courtesy of saying that one of its data sections will be filled in by the 'install' command. Though it does do this:
/* restore %ax */Hmm.... Now what was %ax, again? It would be nice to know. What's the point of a comment like that? I spent a minute tracking down the push to figure out what %ax was when it was pushed--the number of sectors loaded. Sheesh!
popw %ax
Oh, and I learned the point of the .mode byte in stage1.S. It is to tell the next stage if it can use LBA mode or has to use CHS mode.
So--my path from here is clear. I need to make sure the part of stage1 that gets patched by the grub utility with 'nop; nop;' doesn't hold code. I'll replace that whole chunk of code with 'nop; nop;" so the patch is rendered useless. The second thing I'll do is make sure it lets me into LBA mode with the bit7 unset. That's a little 2 line snippet of code that checks the bit and jumps to the CHS section if it is set. That will be excised. I'll load it up and see what happens. And in order to really confirm that I'm getting to my own stage 1_5 start sector, I'll modify it to spew the notification string to the screen in an endless loop. That'll be the acid test.
No comments:
Post a Comment