[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 02:45:00 +0800
User-agent: Mutt/1.5.13 (2006-08-11)

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.

Bean <address@hidden>

reply via email to

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