From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jl4W0-0000yx-9F for mharc-grub-devel@gnu.org; Sun, 13 Apr 2008 11:53:12 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jl4Vz-0000xs-1J for grub-devel@gnu.org; Sun, 13 Apr 2008 11:53:11 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jl4Vx-0000wY-3z for grub-devel@gnu.org; Sun, 13 Apr 2008 11:53:10 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jl4Vw-0000wN-UN for grub-devel@gnu.org; Sun, 13 Apr 2008 11:53:09 -0400 Received: from aybabtu.com ([69.60.117.155]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Jl4Vw-0005pQ-O9 for grub-devel@gnu.org; Sun, 13 Apr 2008 11:53:08 -0400 Received: from [192.168.10.6] (helo=thorin) by aybabtu.com with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1Jl4Vv-0006hT-1Y for grub-devel@gnu.org; Sun, 13 Apr 2008 17:53:07 +0200 Received: from rmh by thorin with local (Exim 4.63) (envelope-from ) id 1Jl4Va-0007Pv-Mn for grub-devel@gnu.org; Sun, 13 Apr 2008 17:52:46 +0200 Date: Sun, 13 Apr 2008 17:52:46 +0200 From: Robert Millan To: The development of GRUB 2 Message-ID: <20080413155246.GA28261@thorin> References: <20080413114144.GD20737@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: free as in freedom X-Message-Flag: Worried about Outlook viruses? Switch to Thunderbird! www.mozilla.com/thunderbird X-Debbugs-No-Ack: true User-Agent: Mutt/1.5.13 (2006-08-11) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. Subject: Re: [PATCH] Linux loader for OLPC 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: Sun, 13 Apr 2008 15:53:11 -0000 On Sun, Apr 13, 2008 at 11:18:31PM +0800, Bean wrote: > > /* OLPC / XO laptops have three kinds of storage devices: > > > > - NAND flash. These are accessible via OFW callbacks, but: > > - Follow strange semantics, imposed by hardware constraints. > > - Its ABI is undocumented, and not stable. > > They lack "device_type" property, which conveniently makes GRUB > > skip them. > > > > - USB drives. Not accessible, because OFW shuts down the controller > > in order to prevent collisions with applications accessing it > > directly. Even worse, attempts to access it will NOT return > > control to the caller, so we have to avoid probing them. > > > > - SD cards. These work fine. > > > > To avoid brekage, we only need to skip USB probing. However, > > since detecting SD cards is more reliable, we do that instead. > > */ > > > > grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY); > > } > > > > but your patch doesn't seem to disable the GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY > > hack. > > > > Also, I'm not sure how stable this will be. Perhaps it breaks in the future > > with firmware updates :-( > > nand access is different from normal disk, it uses pio-read to read a > page which is normally 2048 bytes. > > : pio-read ( adr len page# offset -- ) I see. As for the "strange semantics" I mentioned, IIRC they're applicable to write operations. It might turn out to produce funny effects when writing, but fortunately we don't do that too often :-) > as for GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY, perhaps we can rename it > GRUB_IEEE1275_FLAG_OLPC to indicate OLPC platform, we might need to > use it for other things. Using flags to describe specific problems has the advantage that if they're fixed in a more recent version of the firmware, we just need to check for that in grub_ieee1275_find_options() (the SmartFirmware check there is a nice example of how nasty it gets). -- Robert Millan I know my rights; I want my phone call! What use is a phone call… if you are unable to speak? (as seen on /.)