grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Loading boot image retrieved from CD-ROM


From: Bean
Subject: Re: Loading boot image retrieved from CD-ROM
Date: Sun, 24 Jun 2007 13:26:16 +0800
User-agent: Mutt/1.5.13 (2006-08-11)

On Sun, Jun 24, 2007 at 01:00:13AM -0400, Alex Roman wrote:
> On 24/06/07, Bean <address@hidden> 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 <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]