On Sun, Jun 24, 2007 at 01:00:13AM -0400, Alex Roman wrote: > On 24/06/07, Bean <[EMAIL PROTECTED]> wrote: > >Maybe the image overwrites code in statrt.S after it's copied to 0x7c00. To > >verify, you can print the address of function like grub_eltorito_boot, > >grub_gate_a20 and prot_to_real, see if they're within range of 0x7c00 to > >0x7c00 + image length. > > I don't have access from C code to grub_gate_a20 or prot_to_real > (unless I don't include the right header files)... However > grub_eltorito_boot ends up being at address 0x872c > > I happen to copy 4 sectors, 2048 bytes each, so it would definitely > overwrite the code for grub_eltorito_boot. > > So, what do I do in this case? The eltorito specs say the code should > reside at segment 7c0h...
Here is a possible solution. First, copy the image to 0x7c00 + N, when N is large enough so that the image wouldn't overwrite any necessary function in startup.S. After transition to real mode with prot_to_real, copy a trunk funtion to somewhere below 0x7C00, and jump to that function. Then, copy image from 0x7c00+N back to 0x7c00, and finally jump to 0x7c00. -- Bean <[EMAIL PROTECTED]> _______________________________________________ Grub-devel mailing list Grub-devel@gnu.org http://lists.gnu.org/mailman/listinfo/grub-devel