Subject: Re: NetBSD for embedded i386 apps
To: Paul Taylor <ptaylor@ashdown-electronics.co.uk>
From: Luke Mewburn <lukem@wasabisystems.com>
List: netbsd-advocacy
Date: 07/22/2003 22:05:19
On Tue, Jul 22, 2003 at 10:24:12AM +0100, Paul Taylor wrote:
  | I have used Linux for a minimal embedded system running on i386
  | compatible hardware and have come across NetBSD (and FreeBSD +
  | OpenBSD).  I am considering looking at creating a minimal system using
  | NetBSD and would like some basic information.
  | 
  | With Linux I go through the following sequence:
  | (1) Configure/Compile the kernel
  | (2) Compile my library 
  | (3) Compile the bootloader (lilo)
  | (4) Compile Busybox (which gives me commands such as insmod, ls, cat,
  | plus all others I need; and provides init, getty so that I can log in)
  | (5) Make some device nodes in /dev
  | (6) Put some config files in /etc
  | (7) Install everything to my compact flash card and my Linux System
  | boots.
  | 
  | I download the latest versions of the software I use from the internet.
  | 
  | For NetBSD, I would guess the procedure is similar.  Are there any major
  | differences to the procedure described above?

Things are slightly different for NetBSD, but conceptually it's
similar.  Have a peruse through /usr/src/distrib/i386 to see how
the boot floppies/cdroms are built.  It's along the lines of:
	- build a kernel with space reserved for an in-built "ramdisk"
	- build your applications (usually, "crunched" to save space)
	- build an ffs file system containing the OS image and your
	  applications
	- stuff that ffs image into the kernel
	- munge the kernel to boot on your chosen media (provide
	  a bootloader, etc)


  | Are there any advantages to using NetBSD in a minimal configuration over
  | Linux, OpenBSD or FreeBSD.  I would guess that they all would do a
  | pretty good job but I am sure there are some differences between them.

NetBSD has some obvious advantages:

    * portability
	NetBSD runs on more platforms than the other systems,
	all from the one source tree from a single distribution point,
	with a common end-user and system administration platform.

    * build.sh
	Our build framework and its front-end ``./build.sh'' in the top of
	the source tree allows you to cross-build a compile NetBSD system 
	without any special privileges, even from Linux boxes.


Cheers,
Luke.

--
Luke Mewburn  <lukem@wasabisystems.com>  http://www.wasabisystems.com
Luke Mewburn     <lukem@NetBSD.org>      http://www.NetBSD.org
Wasabi Systems - NetBSD hackers for hire
NetBSD - the world's most portable UNIX-like operating system