From: Bean <bean123@126.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: Loading boot image retrieved from CD-ROM
Date: Sun, 24 Jun 2007 13:26:16 +0800 [thread overview]
Message-ID: <20070624052616.GA8516@ws3.vdp.com> (raw)
In-Reply-To: <8c0c43de0706232200h73f5d857t3cb4fae3f655ddbb@mail.gmail.com>
On Sun, Jun 24, 2007 at 01:00:13AM -0400, Alex Roman wrote:
> On 24/06/07, Bean <bean123@126.com> 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 <bean123@126.com>
next prev parent reply other threads:[~2007-06-24 5:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-24 4:31 Loading boot image retrieved from CD-ROM Alex Roman
2007-06-24 4:51 ` Bean
2007-06-24 5:00 ` Alex Roman
2007-06-24 5:26 ` Bean [this message]
2007-06-24 4:55 ` Alex Roman
2007-06-24 7:53 ` Vesa Jääskeläinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070624052616.GA8516@ws3.vdp.com \
--to=bean123@126.com \
--cc=grub-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.