[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: map command for grub2 draft
From: |
Bean |
Subject: |
Re: map command for grub2 draft |
Date: |
Sat, 16 Jun 2007 03:10:04 +0800 |
User-agent: |
Mutt/1.5.13 (2006-08-11) |
On Fri, Jun 15, 2007 at 08:56:00PM +0200, Marco Gerards wrote:
> Bean <address@hidden> writes:
>
> > On Fri, Jun 15, 2007 at 08:22:16PM +0200, Marco Gerards wrote:
> >> adrian15 <address@hidden> 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 <address@hidden>