From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K11eo-00048m-N0 for mharc-grub-devel@gnu.org; Tue, 27 May 2008 12:04:14 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K11em-00044z-Iv for grub-devel@gnu.org; Tue, 27 May 2008 12:04:12 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K11ek-00042E-44 for grub-devel@gnu.org; Tue, 27 May 2008 12:04:11 -0400 Received: from [199.232.76.173] (port=50913 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K11ej-00041u-Vx for grub-devel@gnu.org; Tue, 27 May 2008 12:04:10 -0400 Received: from mta-out.inet.fi ([195.156.147.13]:49284 helo=jenni1.rokki.sonera.fi) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K11ej-000746-M0 for grub-devel@gnu.org; Tue, 27 May 2008 12:04:10 -0400 Received: from [127.0.0.1] (88.193.32.97) by jenni1.rokki.sonera.fi (8.5.014) id 483BB4A900077E73 for grub-devel@gnu.org; Tue, 27 May 2008 19:04:04 +0300 Message-ID: <483C3103.8080903@nic.fi> Date: Tue, 27 May 2008 19:04:19 +0300 From: =?UTF-8?B?VmVzYSBKw6TDpHNrZWzDpGluZW4=?= User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: The development of GRUB 2 References: In-Reply-To: X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: Quoted-Printable X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 3) Subject: Re: Replacing the legacy "map" command 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: Tue, 27 May 2008 16:04:12 -0000 Hi Javier, Welcome! Javier Mart=C3=ADn wrote: > This message is mainly concerned with "how should I implement it"? > Since this functionality is AFAIK exclusive to the x86/amd64 PC-BIOS > target, it should be confined there, but there are at least two paths > of action that I can think of: > 1.- Given that only the chain OS loader makes use of such a switch, I > could add it as an option to the "chainloader" command. This is the > simplest path, as it would only require modifying > loader/i386/pc/chainloader* and kern/i386/pc/startup.S (where > grub_chainloader_real_boot resides). Such an option would most > probably be named something like "mapdrivefirst", as in "chainloader > --mapdrivefirst (hd1)+1". Do not got to this route. > 2.- The other option would be to add a new command that managed the > BIOS drive mappings (like, "biosdrivesmap", duh), with three main > options: "show", "map" and "reset". I'm still unsure of what files > should be modified for this change, and this might be overkill. > No matter how the UI (the commands) actually ends up, the mappings > would just be stored in a variable, and not applied until the "boot" > command is issued. Thus, actual functionality should probably be > implemented in grub_chainloader_real_boot, and the logic is pretty > simple, with most of it available in the GRUB Legacy code. Well what we actually want is to have support to install interrup=20 service chains for real mode. There are couple of users for this=20 service, one of them being drive mapping (to int 13h) and then El Torito=20 support (to int 13h). So you would have function to install interrupt chain and this would be=20 installed right away, or at point when you are leaving grub. You may=20 want to have those services even if you are not chainloading. In example=20 you have multiboot capable kernel, but you want to still use BIOS service= s. In case of drive mapping it would work in user interface in same way as=20 in GRUB Legacy. But what happens under the hood: 1. You load drive mapping module (map.mod?) 2. User configures mapping with map command (or similar) 3. If even one map command is issued this installs custom software=20 interrupt handler to tweak int13h requests. Map command data is=20 installed to this handler. Thanks, Vesa J=C3=A4=C3=A4skel=C3=A4inen