Subject: Re: NetBSD and root fs
To: Marcin Jessa <>
From: Hubert Feyrer <>
List: tech-embed
Date: 03/31/2005 00:24:56
On Wed, 30 Mar 2005, Marcin Jessa wrote:
> So my question is, is that possible to do with NetBSD?

Yes. I've described you how it works.

> How to load the root file system on memory disk at boot?

It's embedded inside the kernel. No seperate file (after mdsetimage).

At system build time, you make
  * a kernel (with the named options)
  * a filesystem image

You then run mdsetimage to place the filesystem image into the kernel 

Then you boot the resulting kernel (which now contains the filesystem).
It will (should? :) have "root on md0a" or something - boot a normal 
NetBSD install floppy and/to see how it works! :)

> I assume the option MEMORY_DISK_IS_ROOT will be used by kernel once the 
> root-mfs is loaded.

there is no "loading" of the memory filesystem. It's already in RAM when 
the kernel is loaded (because it's embedded into the kernel). This is 
different in NetBSD than in Linux (and you don't need no fiddling with 
kernel modules in NetBSD either - everything's compiled in and good).

I recommend you start building a i386 NetBSD distribution, and look how 
things in src/distrib/i386 work. I'm afraid there's no real good 
documentation available on the framework there, but it's pretty obvious 
once you understand that the filesystem is embedded into the kernel 
(file) that's loaded later.

  - Hubert

NetBSD - Free AND Open!      (And of course secure, portable, yadda yadda)