On Fri, Jun 15, 2007 at 08:22:16PM +0200, Marco Gerards wrote:
> adrian15 <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]>



_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to