From owner-freebsd-current@FreeBSD.ORG Tue May 30 04:02:23 2006 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4E0EF16A530; Tue, 30 May 2006 04:02:23 +0000 (UTC) (envelope-from jb@what-creek.com) Received: from what-creek.com (what-creek.com [66.111.37.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id EEDF543D4C; Tue, 30 May 2006 04:02:22 +0000 (GMT) (envelope-from jb@what-creek.com) Received: by what-creek.com (Postfix, from userid 102) id 1228B78C1D; Tue, 30 May 2006 04:02:21 +0000 (GMT) Date: Tue, 30 May 2006 04:02:20 +0000 From: John Birrell To: Andrew Atrens Message-ID: <20060530040220.GA59831@what-creek.com> References: <447B6870.8020704@nortel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <447B6870.8020704@nortel.com> User-Agent: Mutt/1.4.2.1i Cc: Alexander Leidinger , Poul-Henning Kamp , James Mansion , current@freebsd.org, small@freebsd.org Subject: Re: FreeBSD's embedded agenda X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 May 2006 04:02:25 -0000 On Mon, May 29, 2006 at 05:32:32PM -0400, Andrew Atrens wrote: > So then we agree - write a driver that makes raw flash look like a CF, > and does wear-levelling, gc, etc, under the hood. Then put whatever > f/s you want on it. it's a start at least. Then build your kick-ass > NAND-aware (or NOR aware or both) fs on top of that that makes use of > some extensions that the driver provides. Okay, that's quite the > arm wave ... I must admit that I don't know so much about the existing > fs<->disk interface... Writing a NAND driver for FreeBSD using geom is a trivial matter. It only takes a few days or a week at the most. I don't really understand what all the fuss is here. I've built FreeBSD embedded systems that are smaller than all the picobsd etc configurations which all rely on choosing programs out of the standard FreeBSD tree and putting them on a 'disk'. The smallest embedded system using FreeBSD consists of just a kernel and a threaded program which runs as 'init'. No other files are required (subject to how you boot, so perhaps include the loader). You most certainly don't need anything all from /etc. You don't need a shell. You don't need shared libraries. Try it! Build a kernel that does nothing other than have devices in it to talk to a console and floppy disk. Boot from floppy using the current loader and write a minimal app that will talk to the console. Tell me how big the kernel and the app is. It won't take you longer to do that to write all the messages you are posting here. Configure your system to mount the root file system read-only and any temporary data that you want to write, do it to a ram disk. Boot the system, check that your 'init' program works and then just turn the power off. It should boot up again next time without any problems. You can make your 'init' program remount the disk in write mode if it needs to change any config data. Then it can remount it again read-only and you're back in fail-safe mode. I've done this with a FreeBSD based video recorder mounted to a race motorcycle in the Australian Formula Xtreme series. When the rider powered up his bike, the embedded FreeBSD system (which is just an embedded board) booted and automatically started recording. When he returned to the pits and turned off his bike, the FreeBSD system detected the fact that the bike was turned off and went through it's shutdown sequence, closing the video file which was on CF (not NAND where the OS was) and then when the buffers were flushed, it toggled an output bit which opened a relay contact and powered itself down. This is all trivial to do with FreeBSD and has been since FreeBSD-4 when I first tried it. You end up with custom software to make your 'init' program have just the features that you want (and FreeBSD's libraries aren't too convenient for that), but it's all do-able without a million emails to a mailing list postulating on how to do it. Just try it with what is in FreeBSD now. Sigh. -- John Birrell