grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: map command for grub2 draft


From: Marco Gerards
Subject: Re: map command for grub2 draft
Date: Fri, 15 Jun 2007 20:56:00 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

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.

I think the main issue here is how to hook this into GRUB 2 so that
the hook becomes effective just before booting.

--
Marco





reply via email to

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