Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HzGrY-0004n8-2n for mharc-grub-devel@gnu.org; Fri, 15 Jun 2007 14:49:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HzGrW-0004mX-Cz for grub-devel@gnu.org; Fri, 15 Jun 2007 14:49:34 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HzGrT-0004lX-UP for grub-devel@gnu.org; Fri, 15 Jun 2007 14:49:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HzGrT-0004lT-M0 for grub-devel@gnu.org; Fri, 15 Jun 2007 14:49:31 -0400 Received: from smtp-vbr17.xs4all.nl ([194.109.24.37]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HzGrT-0007a7-2l for grub-devel@gnu.org; Fri, 15 Jun 2007 14:49:31 -0400 Received: from localhost.localdomain (249-174.surfsnel.dsl.internl.net [145.99.174.249]) by smtp-vbr17.xs4all.nl (8.13.8/8.13.8) with ESMTP id l5FInT1S014768 for ; Fri, 15 Jun 2007 20:49:30 +0200 (CEST) (envelope-from mgerards@xs4all.nl) From: Marco Gerards To: The development of GRUB 2 References: <4668259D.9090701@raulete.net> <466D6014.7090205@raulete.net> <87ps3xt6w7.fsf@xs4all.nl> <20070615184500.GA609@ws3.vdp.com> Mail-Copies-To: mgerards@xs4all.nl Date: Fri, 15 Jun 2007 20:56:00 +0200 In-Reply-To: <20070615184500.GA609@ws3.vdp.com> (bean123@126.com's message of "Sat, 16 Jun 2007 02:45:00 +0800") Message-ID: <87hcp9t5bz.fsf@xs4all.nl> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: by XS4ALL Virus Scanner X-detected-kernel: FreeBSD 4.6-4.9 Subject: Re: map command for grub2 draft X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2007 18:49:34 -0000 Bean writes: > On Fri, Jun 15, 2007 at 08:22:16PM +0200, Marco Gerards wrote: >> adrian15 writes: >>=20 >> > adrian15 escribi=F3: >> >> 1st) Where to save an array? >> >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D >> >> >> >> If I mimic the grub legacy map command I need to save an array wi= th 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. >>=20 >> What is this vector supposed to do? Do you really need it outside >> map.c? >>=20 >> 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 handl= er > 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