From: Bean <bean123@126.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: map command for grub2 draft
Date: Sat, 16 Jun 2007 03:10:04 +0800 [thread overview]
Message-ID: <20070615191004.GA644@ws3.vdp.com> (raw)
In-Reply-To: <87hcp9t5bz.fsf@xs4all.nl>
On Fri, Jun 15, 2007 at 08:56:00PM +0200, Marco Gerards wrote:
> Bean <bean123@126.com> writes:
>
> > On Fri, Jun 15, 2007 at 08:22:16PM +0200, Marco Gerards wrote:
> >> adrian15 <adrian15@raulete.net> writes:
> >>
> >> > adrian15 escribió:
> >> >> 1st) Where to save an array?
> >> >> =============================
> >> >>
> >> >> If I mimic the grub legacy map command I need to save an array with the
> >> >> map definitions.
> >> >>
> >> >> static unsigned short bios_drive_map[DRIVE_MAP_SIZE + 1];
> >> >> So that each time I call something like:
> >> >> map (hd0) (hd1)
> >> >> it modifies this vector.
> >> >>
> >> >> Any example on where should I define this vector so that I can use it
> >> >> from each command ?
> >> >
> >> > I ask the question again.
> >>
> >> What is this vector supposed to do? Do you really need it outside
> >> map.c?
> >>
> >> Can you describe the design of the map command?
> >
> > I happen to know something about the map command in GRUB Legacy, it works
> > by hooking INT 13.
> >
> > It first reserves a small range of memory from the top of convensional
> > memory by decreasing value at 0x413, then copy its INT 13 interrupt handler
> > and the drive map to this area. Finally, it modifies the IVT table so that
> > INT 13 points to the new handler.
> >
> > Inside the handler, it uses the drive map to translate the current drive
> > stored in %dl to the real drive, then jump to the original handler.
>
> Right, but the problem Adrian brought up was that he though he needs
> to add a vector which describes the mapping as a global. I do not see
> why this is required. So I wonder what he had in mind.
Yes, it doesn't need to be a global variable.
>
> I think the main issue here is how to hook this into GRUB 2 so that
> the hook becomes effective just before booting.
It can be done in a grub_map_real_boot function in kern/i386/pc/startup.S
--
Bean <bean123@126.com>
next prev parent reply other threads:[~2007-06-15 19:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-07 15:34 map command for grub2 draft adrian15
2007-06-11 14:45 ` adrian15
2007-06-15 18:22 ` Marco Gerards
2007-06-15 18:45 ` Bean
2007-06-15 18:56 ` Marco Gerards
2007-06-15 19:10 ` Bean [this message]
2007-06-16 17:19 ` adrian15
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=20070615191004.GA644@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.