Subject: RE: mount root file system (memory disk within kernel), sandpoint port
To: None <>
From: Fraser Douglas <>
List: port-powerpc
Date: 04/22/2004 09:44:09
I ran into the same problem and had.
I do not remember the specifics, but I can give you
this much information.

A) You do not need to unpack the MD image.

B) You have to have the proper items in the MD image
for it to do anything rational. I am attaching a shell
script that does that for me, and it works. Your 386 host
has to be running the same (relative) release as your
target (1.6 versus current) Since I am running 1.6 on my
host and build current for my target, I need to build the
current distro so that I can grab MAKEDEV and mknod
from there, so you can change that part of the script.
Other than that, the script encapsulates the minimum
stuff you need to do to get a running MD image.

Good luck


--------------------- mdimage creation shell script =


# Make an embedded disk image to be buried into an MD configured
# kernel and insert it into that kernel.
# most of this needs to be run as root, particularly MAKEDEV.
# the last action, mdsetimage, does not, but it does not hurt.


# create directory tree for our memory disk image
echo "creating mdimage tree"
mkdir mdimage
mkdir mdimage/sbin
mkdir mdimage/bin
mkdir mdimage/rescue
mkdir mdimage/dev
mkdir mdimage/mnt
mkdir mdimage/tmp

# load the software that we want inside the image
# use rescue images since they are statically linked.
echo "copying executables to mdimage tree"
cp destdir.evbppc/rescue/init mdimage/sbin/init
# provide links from init to others
for i in `ls destdir.evbppc/rescue`
ln mdimage/sbin/init mdimage/rescue/$i

# make the device entries needed to support a ramdisk based
# system and to support init
echo "creating needed device entries"
cp ./obj/destdir.i386/dev/MAKEDEV mdimage/dev/MAKEDEV
cd mdimage/dev=20
./MAKEDEV -m ${HEREIS}/obj/destdir.i386/rescue/mknod ramdisk init
cd ../..

# makefs to wrap it all up into a md compatible image
echo "creating file system image"
makefs -s 8m -t ffs -B be -b 4096 -f 1000 memdrive.image mdimage

# mdsetimage to bury it inside the netbsd image.
# NOTE: that netbsd kernel had to be configured for MD (memory disk)
echo "inserting image into MD configured kernel"
mdsetimage netbsd memdrive.image

echo "complete"

-----Original Message-----
[]On Behalf Of netbsd
Sent: Thursday, April 22, 2004 9:14 AM
Subject: mount root file system (memory disk within kernel), sandpoint


during mounting of the root file system I get a trap. Any help yould be=20

-is it enough to copy the kernel into the ram? or do i have to unpack=20
the memory disk fs somehow?

I created the file system as big endian ffs and put it into the kernel=20
with mdsetimage. I have also enabled the following kernel options:

options     MEMORY_DISK_IS_ROOT    # Force root on RAM disk
options     MEMORY_DISK_ROOT_SIZE=3D4096    # 2 MB

pseudo-device    md        1

an extract of the console output:
md0: internal 2048 KB image area
boot device: <unknown>
root on md0a dumps on md0b
mountroot: trying ffs...
trap type 200 at e2834
Press a key to panic.
panic: trap
Stopped in pid 0 (swapper) at      0xd0360:     lwz     r0, r1, 0x14

CPU ppc 750, 400MHz, 64MB RAM, Flashdisk
Netbsd 1.6.2, based on the sandpoint build



This email may contain confidential and privileged material for the sole
use of the intended recipient.  Any review or distribution by others is=20
strictly prohibited.  If you are not the intended recipient please =
the sender and delete all copies.