Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1JYkJp-0004dR-62 for mharc-grub-devel@gnu.org; Mon, 10 Mar 2008 11:53:41 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYkJn-0004cu-Ob for grub-devel@gnu.org; Mon, 10 Mar 2008 11:53:39 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYkJm-0004cP-T4 for grub-devel@gnu.org; Mon, 10 Mar 2008 11:53:39 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYkJm-0004cA-KT for grub-devel@gnu.org; Mon, 10 Mar 2008 11:53:38 -0400 Received: from ti-out-0910.google.com ([209.85.142.185]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JYkJl-0003sq-Ay for grub-devel@gnu.org; Mon, 10 Mar 2008 11:53:38 -0400 Received: by ti-out-0910.google.com with SMTP id a20so822943tia.10 for ; Mon, 10 Mar 2008 08:53:32 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=7X4+v3+XtE10hrIeaWxJk+VZO6OHRAEBKriHaG6RZ8E=; b=T7duSFqNJnZzBjICp/Pt7Nd4Q3jbo6amfTF5DVrJF/eNCXCz2IV55ZaJNBzs6JcnZ8jtbhlOkP7EZLyHnV9drBtq55T7Yzx1SeX7iKEcPIuBAucwkZezxKBe8vTANO9jYi5kDBHA8H396EVCFnjKKU5reMzpxcGsRpb+kVRFm6A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=X8YQaKA6fqJUJYOPzzXfcY5j0qx+0qqxiUIM+sXyKX6+2K9D5Lc378q7MiET+7xQsl8BnB7D1imw+bFcuDTbbpf70TQjEeihq3PacaDROdrZc0nZ/dWhVkt+QWq0VKqAR6ECql0wfVKwgnckL31kVGzhYFoBWFBdjeng+6ZqZII= Received: by 10.110.14.12 with SMTP id 12mr1161233tin.1.1205164412569; Mon, 10 Mar 2008 08:53:32 -0700 (PDT) Received: by 10.110.62.19 with HTTP; Mon, 10 Mar 2008 08:53:32 -0700 (PDT) Message-ID: Date: Mon, 10 Mar 2008 23:53:32 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <47D16136.1060705@nic.fi> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) Subject: Re: [PATCH] cdrom access patch 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, 10 Mar 2008 15:53:40 -0000 On Sun, Mar 9, 2008 at 11:33 PM, Bean wrote: > On Fri, Mar 7, 2008 at 11:37 PM, Vesa J=E4=E4skel=E4inen w= rote: > > > > Bean wrote: > > > Hi, > > > > > > This patch use int 13 func 4B01 to detect cdrom. It also change the > > > name of the cd device to (hdN), where N is the bios drive number. > > > > Hi Bean, > > > > Have you tried to use EDD's functions to query for type of device? > > (references are to EDD3 spec) > > > > 8.24 Get Device Parameters (FN 48h) > > 26 DWord Pointer to the Device Parameter Table Extension (DPTE) > > > > 8.24.3 Device Parameter Table Extension (DPTE) > > 10-11 Word BIOS selected hardware specific option flags > > > > Bits 5 and 6; Removable device, ATAPI device. > > > > This FN 48h can also be used to filter out PCI cards from ATA driver = in > > case there is BIOS support for the device already. So use BIOS if the= re > > is BIOS handler for it, otherwise fall back to ATA driver. > > > > I would prefer that CD's would be counted like (cd0) for first CD-ROM > > device, (cd1) for second CD-ROM device, ... and so on. I think it is = OK > > to first allocate BIOS devices for CD's and after that use ATA driver > > for rest of them. Ata driver can of course be accessed with ata name = too. > > Hi, > > after some consideration, i think the best way to detect cdrom is to > check the number of bytes per sector. The handling of cdrom assume > sector size of 4096, cdrom that has other block size would not work. > On the other hand, the device don't even needs to be cdrom, as long as > it has 2048 sector size, the current handling works. Therefore, > checking sector size should be sufficient. > > As for the device name, there are some drawbacks by using (cdN), in > init.c, we need to get the root device from bios drive number. > However, as Christian Franke discovers, the drive number can be: > > 0x82 (old Toshiba Laptop with unknown BIOS) > 0x9f (PC with Phoenix-Award BIOS, VMware) > 0xe0 (VirtualBox) > 0xef (PC with AMI BIOS, VirtualPC) > > It' quite tricky to determine whether a drive is cdrom or harddisk. > > And in the multiboot loader, we need to do the oppisite, map the root > device to bios drive number. As names like (cd0) doesn't suggests the > number at all, we need to ask biosdisk for the number. Therefore, > multiboot loader will be depended on biosdisk, which is not a good > idea. After some testing, i think the new version has some compatible issue, i remember Christian Franke reports that some bios doesn't support int 42 for cdrom, so grub_biosdisk_check_int13_extensions will fail. Would someone check if func 4b01 (the first patch cd.diff) works in such situation ? --=20 Bean