From owner-freebsd-mips@FreeBSD.ORG Sun Nov 21 14:28:58 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344671065670; Sun, 21 Nov 2010 14:28:58 +0000 (UTC) (envelope-from ray@ddteam.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 96B238FC14; Sun, 21 Nov 2010 14:28:57 +0000 (UTC) Received: by fxm19 with SMTP id 19so4269240fxm.13 for ; Sun, 21 Nov 2010 06:28:56 -0800 (PST) Received: by 10.223.74.198 with SMTP id v6mr4134155faj.4.1290347916367; Sun, 21 Nov 2010 05:58:36 -0800 (PST) Received: from rnote.ddteam.net (68-13-133-95.pool.ukrtel.net [95.133.13.68]) by mx.google.com with ESMTPS id e6sm1045563fav.8.2010.11.21.05.58.33 (version=SSLv3 cipher=RC4-MD5); Sun, 21 Nov 2010 05:58:34 -0800 (PST) Date: Sun, 21 Nov 2010 15:58:10 +0200 From: Aleksandr Rybalko To: Adrian Chadd Message-Id: <20101121155810.e615d4ad.ray@ddteam.net> In-Reply-To: References: <201011191201.47230.freebsd-mips@dino.sk> X-Mailer: Sylpheed 3.0.3 (GTK+ 2.20.1; i386-portbld-freebsd8.1) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-mips@freebsd.org Subject: Re: First RSPRO deployed ! X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Nov 2010 14:28:58 -0000 Hi, On Sun, 21 Nov 2010 15:18:45 +0800 Adrian Chadd wrote: > Nah, the problem is: > > * the large, fixed blocksize that the current flash code has; > * ffs isn't really optimised for this kind of flash; > * this kind of flash is will not like constant 4k erase cycles, which > is unfortunately what you'll end up with. > > My current path forward is: > > * aim to get geom_ulzma into the base :-) No problem to add geom_ulzma into base, problem with lzma. LZMA decoder currently stored in geom_ulzma.c, this one has style(9) problems. Another one decoder live in libarchive, this one inaccessible by kernel. So we need something middle, like zlib in kernel code (why it in net subdir, but uses with many parts) > * modify it a bit so it exports two GEOM devices - a read-only device > with the lzma'ed FS in it, and a read-write'able "rest"; For what? flash splited by parts by geom_map (old name geom_mtd, loos@ name geom_flash IIRC), that parts rw, parts where stored ulzma compressed data handled by GEOM_ULZMA, that RO. I also use small hack enabled writing for overlapped parts. Biggest part named "upgrade" overlapped with "kernel" part and "rootfs", so we can upgrade box when "kernel" and "rootfs" are opened. > * modify GEOM to pass through disk parameters from the provider, so > the flash device can export attributes (read size, write sizes, etc); > * modify the flash driver to have a small default block size (say, 128 > bytes) so small transactions don't require huge amounts of SPI bus > access; I use BS=4, since I know many devices that map their FS not to block boundary. > * experiment with a simple append-only flash FS, which mounts on top > of a read-only base filesystem. > > This mirrors what the flash device/fs stuff in linux does to some > extent. The "rootfs" partition has a read only bit. Any filesystem > modifications happen in the read-write part -after- that. If the user > wants, they can simply erase the rootfs part -after- the read-only > lzma'ed FFS partition, giving them a clean "default" system. > > If someone else wants to give this a go, be my guest. :-) > > > Adrian > > On 19 November 2010 19:06, Monthadar Al Jaberi > wrote: > > On Fri, Nov 19, 2010 at 12:01 PM, Milan Obuch > > wrote: > >> On Thursday 18 November 2010 13:43:51 Monthadar Al Jaberi wrote: > >>> OMG, thank you Luiz for the file.... Adrian forgot to mention > >>> that you need to add kern_memstart field to the fw_layout_data > >>> structure!!! > >>> > >>> Its works...so I guess to boot from flash we need to play with the > >>> flash driver and ffs... thats a totally different story though :P > >>> > >> > >> Well, with mkfwimage it is possible to write FreeBSD into flash on > >> RSPRO and boot from it. I just verified this. Using it the way > >> it's used in mkflash script has one drawback, I think - your setup > >> is static and you are not using whole flash to its best potential > >> as well. Actually, with patches you are able to read flash > >> (verified) and probably write to it, too, so the 'only' remaining > >> part is ffs tuned to use it... > > > > mm, as I understood it it should be easy for ffs2 to work, just need > > to fix some macros so that the code that probes for the superblock > > work... > > reading/writting to flash with correct sectorsize is no problem.... > > > >> > >> Regards, > >> Milan > >> > > > > > > > > -- > > //Monthadar Al Jaberi > > _______________________________________________ > > freebsd-mips@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > > To unsubscribe, send any mail to > > "freebsd-mips-unsubscribe@freebsd.org" > > > _______________________________________________ > freebsd-mips@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-mips > To unsubscribe, send any mail to > "freebsd-mips-unsubscribe@freebsd.org" -- Aleksandr Rybalko