From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1KEVkx-0000Dk-Ii for mharc-grub-devel@gnu.org; Thu, 03 Jul 2008 16:50:19 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KEVku-0000DJ-Rv for grub-devel@gnu.org; Thu, 03 Jul 2008 16:50:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KEVks-0000C0-B0 for grub-devel@gnu.org; Thu, 03 Jul 2008 16:50:15 -0400 Received: from [199.232.76.173] (port=52598 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KEVks-0000Bm-6W for grub-devel@gnu.org; Thu, 03 Jul 2008 16:50:14 -0400 Received: from c60.cesmail.net ([216.154.195.49]:39511) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.60) (envelope-from ) id 1KEVkr-0004Wn-Tq for grub-devel@gnu.org; Thu, 03 Jul 2008 16:50:14 -0400 Received: from unknown (HELO relay.cesmail.net) ([192.168.1.81]) by c60.cesmail.net with ESMTP; 03 Jul 2008 16:50:12 -0400 Received: from [192.168.0.21] (static-72-92-88-10.phlapa.fios.verizon.net [72.92.88.10]) by relay.cesmail.net (Postfix) with ESMTP id 4BBC2618F22 for ; Thu, 3 Jul 2008 16:50:12 -0400 (EDT) From: Pavel Roskin To: The development of GRUB 2 In-Reply-To: <87lk0i6cxo.fsf@xs4all.nl> References: <20080703001716.13881.1754.stgit@dv.roinet.com> <87lk0i6cxo.fsf@xs4all.nl> Content-Type: text/plain Date: Thu, 03 Jul 2008 16:50:11 -0400 Message-Id: <1215118211.2734.8.camel@dv> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 (2.22.2-2.fc9) Content-Transfer-Encoding: 7bit X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Enable writing to ATA devices, fix several bugs 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: Thu, 03 Jul 2008 20:50:17 -0000 On Thu, 2008-07-03 at 20:27 +0200, Marco Gerards wrote: > The more patches I get, the better ;-) > > > ChangeLog: > > > > * disk/ata.c (grub_ata_pio_write): Check status before writing, > > like we do in grub_ata_pio_read(). > > > > (grub_ata_readwrite): Always write individual sectors. Fix the > > sector count for the remainder. > > Why? Because we do it elsewhere. I assume you forgot to convert the code for writing, but you meant to do it: r1335 | marco_g | 2007-11-03 08:25:19 -0400 (Sat, 03 Nov 2007) | 6 lines 2007-11-03 Marco Gerards * disk/ata.c (grub_ata_readwrite): Call grub_ata_pio_read and grub_ata_pio_write once for every single sector, instead of for multiple sectors. I guess it's safer. We can explore some optimization, but first we should make it reliable. > > (grub_ata_write): Enable writing to ATA devices. Correctly > > report error for ATAPI devices. > Great! Did you test this? Yes, I tested this part. env_save didn't report any error originally, so I introduced grub_error(), and env_save started reporting the error. Then I enabled writing and tested it in qemu. I cannot get the ata module to recognize the hard drive on my test machine, so more work is needed to test it on the real hardware. > If you can fix Roberts comment, it would be great! Can you commit it > afterwards? Sure. If you check Linux include/linux/ata.h, 1 is ATA_ERR, and we really need ata_ok(), which checks multiple flags. So it's clearly material for a separate patch. -- Regards, Pavel Roskin