From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HxmD2-00026X-SO for mharc-grub-devel@gnu.org; Mon, 11 Jun 2007 11:53:36 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HxmD1-000260-8o for grub-devel@gnu.org; Mon, 11 Jun 2007 11:53:35 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HxmCy-00025C-9v for grub-devel@gnu.org; Mon, 11 Jun 2007 11:53:34 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HxmCy-000259-4V for grub-devel@gnu.org; Mon, 11 Jun 2007 11:53:32 -0400 Received: from relay.udl.es ([193.144.10.29] helo=relay2.udl.es) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HxmCx-0005nr-GF for grub-devel@gnu.org; Mon, 11 Jun 2007 11:53:31 -0400 Received: from jupiter.udl.net (jupiter.udl.net [172.16.2.2]) by relay2.udl.es (8.13.7/8.13.7) with ESMTP id l5BFr6IC014737 for ; Mon, 11 Jun 2007 17:53:16 +0200 Received: from [172.16.51.7] (PL-CAP007.udl.net [172.16.51.7]) by jupiter.udl.net (8.11.7p1+Sun/8.11.6) with ESMTP id l5BFlXq13438 for ; Mon, 11 Jun 2007 17:47:38 +0200 (MET DST) Message-ID: <466D6014.7090205@raulete.net> Date: Mon, 11 Jun 2007 16:45:40 +0200 From: adrian15 User-Agent: Thunderbird 1.5.0.8 (X11/20061107) MIME-Version: 1.0 To: The development of GRUB 2 References: <4668259D.9090701@raulete.net> In-Reply-To: <4668259D.9090701@raulete.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (relay2.udl.es [10.69.4.19]); Mon, 11 Jun 2007 17:53:16 +0200 (CEST) X-Virus-Scanned: ClamAV 0.88.7/3399/Mon Jun 11 09:27:52 2007 on relay2.udl.es X-Virus-Status: Clean Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by relay2.udl.es id l5BFr6IC014737 X-detected-kernel: Linux 2.6 (newer, 2) 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: Mon, 11 Jun 2007 15:53:35 -0000 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 >=20 > If I mimic the grub legacy map command I need to save an array with= the > map definitions. >=20 > static unsigned short bios_drive_map[DRIVE_MAP_SIZE + 1]; > =20 > So that each time I call something like: > map (hd0) (hd1) > it modifies this vector. >=20 > Any example on where should I define this vector so that I can use it > from each command ? I ask the question again. I've begun to implement commands/i386/pc/map.c (I suppose the map.c is pc specific althought I am not sure). The question is how do I get the bios number for a given hard disk? Thank you. You know hd0 is usually 0x80, that's the number that I want. Here is the source code written so far which I have not compiled. adrian15 static grub_err_t grub_cmd_map (struct grub_arg_list *state __attribute__ ((unused)), int argc, char **args) { grub_disk_t map_disk_1,map_disk_2; if (argc !=3D 2) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Two devices required"); map_disk_1 =3D grub_disk_open (args[0]); if (! map_disk_1) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown 1st disk"); map_disk_2 =3D grub_disk_open (args[1]); if (! map_disk_2) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown 2nd disk"); /* How do I get the BIOS number for a given disk */