Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Jl40Q-0007gN-0k for mharc-grub-devel@gnu.org; Sun, 13 Apr 2008 11:20:34 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jl40O-0007fC-8Q for grub-devel@gnu.org; Sun, 13 Apr 2008 11:20:32 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jl40N-0007ea-NT for grub-devel@gnu.org; Sun, 13 Apr 2008 11:20:31 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jl40N-0007eQ-9n for grub-devel@gnu.org; Sun, 13 Apr 2008 11:20:31 -0400 Received: from ti-out-0910.google.com ([209.85.142.190]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jl3yk-0007n9-VD for grub-devel@gnu.org; Sun, 13 Apr 2008 11:20:31 -0400 Received: by ti-out-0910.google.com with SMTP id a20so392532tia.10 for ; Sun, 13 Apr 2008 08:18:31 -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=8wYJz+5LWGmpCbE2/RdRodXOhgIRpHocEWVLZJC/PtM=; b=YthbHVkTvWW7io6teuKPaJ58Vy/0CxUcbSof9IAaJhjjCK0EZnK8XGutbqhisniRTz7n2BQzI0t6czIaJQFJKY6PW29WeF/RoXkmOwzxOiEfGjfvqYLtJppdGtr0YZd4ZZGlzSBzRFymbo9YubK6RMRyfHWwJ9W/bvNd9ZP08IA= 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=JGbSSgYHNJaQH8GGwbwGlneA854vT+0FZmmi91ScknapwdwKVXBSdefFZA5o7gjFNPUnonbAYFPTp1ek8B5p3znvGTAI19qezUJX7m2p27Bp/l9gucJA/j+VxGKuHCSAnu2UFlLfAia+uFCMTJwS6kinHMynrmmnBvYirLvzzas= Received: by 10.110.42.13 with SMTP id p13mr376045tip.31.1208099911471; Sun, 13 Apr 2008 08:18:31 -0700 (PDT) Received: by 10.110.62.19 with HTTP; Sun, 13 Apr 2008 08:18:31 -0700 (PDT) Message-ID: Date: Sun, 13 Apr 2008 23:18:31 +0800 From: Bean To: "The development of GRUB 2" In-Reply-To: <20080413114144.GD20737@thorin> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20080413114144.GD20737@thorin> X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:20:32 -0000 On Sun, Apr 13, 2008 at 7:41 PM, Robert Millan wrote: > On Thu, Apr 03, 2008 at 11:19:32PM +0800, Bean wrote: > > Hi, > > > > The new patch add support for the nand flash device in OLPC. However, > > the flash use jffs2 file system, so you can't list file in it yet, but > > you can dump the disk with hexdump. > > > > This patch also include an improvement for hexdump that would allow it > > to dump device as well as file, for example: > > > > hexdump (nand) > > I'm surprised that the nand works via ieee1275 calls. See my comment in > cmain.c: > > if (is_olpc) > { > /* 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 -- ) nand device doesn't have device_type property, it won't be detected by ofdisk.c, so i put it in a separate module nand.c. 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. > > > > I also add a new function grub_getcrc32 in kern/misc.c, this function > > is useful in many places, for example, jffs2 use it to verify data. A > > new command crc is also included that would allow user to calculate > > the crc checksum of file. > > That sounds very useful. But I'm not sure if it's a good idea to put it in > kernel. Perhaps a "crypt" module would be better? (so that we can add more > crypto-related functions when we support LUKS, etc). That's a good idea. -- Bean