Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K0o7W-0007Zz-W5 for mharc-grub-devel@gnu.org; Mon, 26 May 2008 21:36:59 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K0o7U-0007ZX-It for grub-devel@gnu.org; Mon, 26 May 2008 21:36:56 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K0o7T-0007ZL-2w for grub-devel@gnu.org; Mon, 26 May 2008 21:36:55 -0400 Received: from [199.232.76.173] (port=52619 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K0o7S-0007ZI-Tb for grub-devel@gnu.org; Mon, 26 May 2008 21:36:54 -0400 Received: from rv-out-0708.google.com ([209.85.198.240]:22181) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1K0o7S-0002MZ-HN for grub-devel@gnu.org; Mon, 26 May 2008 21:36:54 -0400 Received: by rv-out-0708.google.com with SMTP id k29so2636314rvb.6 for ; Mon, 26 May 2008 18:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=01DX0VLVhAwyo+8gscXoeUBnzU03eM8YwDqAMsM8jR0=; b=uhBk8p91sJDK+VZQ0jNMHRYPIHLy202pN102is51JzNMIwDfjb/TYd43riyUPU9v1D8Td27mfxZP5Wc4oBHgqbkkAqELks4Q7PLul/hHdL6ucMze9kajTKzkq46lLBcrQKbe6wN/5TEpI370eOXuNUpQuUAcKn5q9ORFwse0+7I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=X7kffnydLC5yDBtmsFIQgDjeMgb+ban1U2BOeRU57yMoybaqelM6KHjyhJf0tGj7KLtmHhHITnUvoLt8EAZRvzaVg2Aws2SFK88OwMpMPKxBMLMkYGbImADjCSFUHVwyAi6yLgZ5lbUho08OcXAXhxbH1OslzKS3xm4NVpYUVLE= Received: by 10.141.142.15 with SMTP id u15mr271336rvn.238.1211852209788; Mon, 26 May 2008 18:36:49 -0700 (PDT) Received: by 10.140.162.3 with HTTP; Mon, 26 May 2008 18:36:49 -0700 (PDT) Message-ID: Date: Tue, 27 May 2008 03:36:49 +0200 From: "=?UTF-8?Q?Javier_Mart=C3=ADn?=" To: grub-devel@gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: 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 01:36:56 -0000 First of all, hi there! I'm a 19-old Spanish student and this is my first post in this list. On to GRUB now: I'm interested in reimplementing the "map" command from GRUB legacy, since it may be required by some OSes, specifically M$ Windows, to boot if they are installed on an HD that was the "first drive" (for the BIOS) but that is no longer. In particular, my setup is: SATA channel 1: Samsung 500GB, Windows XP Pro x64 SATA channel 2: Maxtor 300GB, Ubuntu Linux, GRUB installation However, the BIOS is set to boot from the 300GB drive, and thus at boot time the Windows drive becomes (hd1): while in GRUB Legacy I succeeded in booting if I swapped the two BIOS drives with the "map" command, in GRUB 2 the best result I've got is an "Error loading operating system" from the Windows boot sector (confirmed after dding it and grepping for the message). 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". 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. All in all, I'm asking for your thoughts, opinions, advices and whatever, since I'm the new guy here and I'd like to learn from this. I might not be able to start right away, since I'm flooded with exams right now: I could take it as a summer project, though I don't expect it to take too long - an experienced GRUB hacker could even do it in the day, but I'm not included in that set, so I think I could have a testable version within a week if I don't find any problems. Well, if you have read through all this, thanks for your attention and cheers! Habbit