Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1K1vba-0002uk-CV for mharc-grub-devel@gnu.org; Thu, 29 May 2008 23:48:38 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K1vbY-0002uS-UX for grub-devel@gnu.org; Thu, 29 May 2008 23:48:36 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K1vbX-0002tt-AZ for grub-devel@gnu.org; Thu, 29 May 2008 23:48:36 -0400 Received: from [199.232.76.173] (port=36334 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K1vbX-0002tq-8O for grub-devel@gnu.org; Thu, 29 May 2008 23:48:35 -0400 Received: from c60.cesmail.net ([216.154.195.49]:53867) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1K1vbX-0001Y9-2Z for grub-devel@gnu.org; Thu, 29 May 2008 23:48:35 -0400 Received: from unknown (HELO delta2) ([192.168.1.50]) by c60.cesmail.net with ESMTP; 29 May 2008 23:48:34 -0400 Received: from pool-71-185-134-182.phlapa.east.verizon.net (pool-71-185-134-182.phlapa.east.verizon.net [71.185.134.182]) by webmail.spamcop.net (Horde MIME library) with HTTP; Thu, 29 May 2008 23:48:33 -0400 Message-ID: <20080529234833.j9uz97o7kckw04sw-cebfxv@fcnzpbc.arg@webmail.spamcop.net> Date: Thu, 29 May 2008 23:48:33 -0400 From: Pavel Roskin To: The development of GRUB 2 , Javier =?iso-8859-1?b?TWFydO1u?= References: <1211903962.29738.21.camel@dv> <20080528142438.GK26495@thorin> <1212108905.4265.59.camel@dv> <1212113587.27442.7.camel@localhost> In-Reply-To: <1212113587.27442.7.camel@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable User-Agent: Internet Messaging Program (IMP) H3 (4.1.4) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Cc: 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: Fri, 30 May 2008 03:48:37 -0000 Quoting Javier Mart=EDn : > Then "drivemap" it is. I've already been delving into the depths of The > Source, though I'd have preferred it to be commented a bit more > exhaustively. Some times it's difficult to guess which methods to call, > and it took me a bit to realize that I had to check with the disk > "device" to see if it was a BIOS drive. Seems I had the wrong conception > of what the disk "device" should be. I suggest a simple approach starting from what can be done. There =20 will be a small resident piece of code installed to intercept =20 interrupt 0x13 and replace the driver number according to the map. We =20 should keep that code simple. The resident code should go through the list of the mapped drives, and =20 if there is an entry in the table, replace the drive number. That's =20 two bytes for an entry. I think the user interface should operate directly on that =20 unidirectional map rather that with some complex swap rules that are =20 translated to the map. Sure, it won't be nice if some device is seen =20 as two devices, especially if the OS uses BIOS. But GRUB cannot =20 prevent all stupid actions by users. > By the way, floppies are usually also "BIOS drives". Should the command > filter them out as sources for mapping? I think so, because OS loaders > usually have different code for reading floppies and HDs. Concretely, > floppy code usually makes some assumptions about drive geometry, uses > only old CHS-like interfaces, and some things more I cannot remember > now... it's been long since I wrote anything distantly similar to a > bootloader. We may still want to map a hard drive as a floppy. I can imagine that =20 some floppy readers may be seen as hard drives by the BIOS. I think it's not the most important thing at the moment. If there is =20 a substantial risk of data corruption due to floppy-to-hdd remapping =20 or duplicate drives, we can introduce extra safety checks. --=20 Regards, Pavel Roskin