From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1H9lpP-0003kd-4Y for mharc-grub-devel@gnu.org; Wed, 24 Jan 2007 12:22:31 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1H9lpO-0003kH-3k for grub-devel@gnu.org; Wed, 24 Jan 2007 12:22:30 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1H9lpK-0003eE-Rc for grub-devel@gnu.org; Wed, 24 Jan 2007 12:22:29 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1H9lpK-0003dw-Ol for grub-devel@gnu.org; Wed, 24 Jan 2007 12:22:26 -0500 Received: from 245.red-80-24-127.staticip.rima-tde.net ([80.24.127.245] helo=manazas.ensanjose.net) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1H9lpJ-0004Jc-Ei for grub-devel@gnu.org; Wed, 24 Jan 2007 12:22:26 -0500 Received: from localhost (manazas.ensanjose.net [127.0.0.1]) by manazas.ensanjose.net (Postfix) with ESMTP id 9F478D445E for ; Wed, 24 Jan 2007 18:22:16 +0100 (CET) Received: from manazas.ensanjose.net ([127.0.0.1]) by localhost (manazas.ensanjose.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08141-03 for ; Wed, 24 Jan 2007 18:22:16 +0100 (CET) Received: from [192.168.1.5] (235.Red-88-12-228.dynamicIP.rima-tde.net [88.12.228.235]) by manazas.ensanjose.net (Postfix) with ESMTP id C1C20D4457 for ; Wed, 24 Jan 2007 18:22:13 +0100 (CET) Message-ID: <45B795C2.3030804@raulete.net> Date: Wed, 24 Jan 2007 18:22:10 +0100 From: adrian15 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: grub-devel@gnu.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-detected-kernel: Linux 2.4-2.6 Subject: int13 and non-reboot drives mapping 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: Wed, 24 Jan 2007 17:22:30 -0000 This is about the drive shift that I wrote the other day about grub2 sci-fi and all. I've finally decided that this usbshift command should be run as a normal command not anything inside a preset menu. I've seen that we have to boot into the usb drive again to make effective changes of mapping drives. It is very annoying! And, of course, I do not want to boot into the pendrive once booted into it. I've studied grub legacy's root command source code (check at the email bottom) and I ask myself if I could write a command that only will do this part of the code I suppose that without the gateA20(0) (I've read something related to high memory but I think it is not useful for mapping.) but as I am not very sure I need your advice if you do not mind. My idea is that the usbshift command should first shift the drives thanks to map command and then run the mentioned piece of code. My AdamLGrub's variable: grub_device (that represents grub device) should be set to (hd4,0) if it was to set to (hd0,0) and there are 5 hard disks (including the usb drive). And then the next command to run is a configfile to somewhere like: configfile $(grub_device)/boot/sgd/menu.lst this will update the grub legacy's variables concerning to where grub is working like: saved_drive and saved_partition... As long as menu.lst files are run from the RAM there should not be any problem like there would be with a function trying to read from a hard disk. If you do not like the configfile idea you could also set them inside the usbshift command calling to root command so that it accepts as an argument (NEWUSBHD,OLDPART) such as: (hd4,0). I suppose that BIOS ints are better handled (more elegant) in grub2 and it should be easier for you to do that. Any idea, mistake, advice? adrian15 /* Check if we should set the int13 handler. */ if (bios_drive_map[0] != 0) { int i; /* Search for SAVED_DRIVE. */ for (i = 0; i < DRIVE_MAP_SIZE; i++) { if (! bios_drive_map[i]) break; else if ((bios_drive_map[i] & 0xFF) == saved_drive) { /* Exchage SAVED_DRIVE with the mapped drive. */ saved_drive = (bios_drive_map[i] >> 8) & 0xFF; break; } } /* Set the handler. This is somewhat dangerous. */ set_int13_handler (bios_drive_map); } gateA20 (0); boot_drive = saved_drive; chain_stage1 (0, BOOTSEC_LOCATION, boot_part_addr); break;