Subject: Re: Tests of mdsetimage -s
To: Brian Rose <>
From: Marcin Jessa <>
List: tech-embed
Date: 04/02/2005 10:59:43
Hi Brian, guys.

On Fri, 01 Apr 2005 21:38:08 -0500
Brian Rose <> wrote:

> init needs to set up STDIN, STDOUT, and STDERR so that your printf's are 
> connected to the console. I usually build init with the smallprog define 
> and then make a custom /bin/sh which is what init will call.
> Someone once provided me with a custom init that just does this, but I 
> found the SMALLPROG define to be much more convenient.
> For more info look at my embedded netbsd article near the bottom of page 1.

I read that paper a couple of times and created the init binary dropping to /bin/sh
# cd /usr/src/sbin/init ; make -D SMALLPROG
I still have the same problem with init not being executed by the kernel..

You do 
# cp /sbin/init files/init 

Why not cp /sbin/init files/sbin/init ?
Is that a typo or init must be placed to the root of the ramdisk ?

I do not do crunching, all the binaries are dynamically linked to libraries. 
I thought this could be the source of my problem but then I also copied over the crunched init file from the NetBSD boot floppies and it still did not get executed.

But when I use the NetBSD ramdisk-big with my custom kernel, it works!
# cp /usr/src/distrib/i386/floppies/ramdisk-big/obj/ramdisk-big.fs /home/yazzy/wifibsd/
# cd /home/yazzy/wifibsd/
# mdsetimage -v -s netbsd ramdisk-big.fs
# gzip -f -9 netbsd ; mv netbsd.gz netbsd
# dd if=/dev/zero of=wifibsd.bin bs=1k count=15000
# vnconfig -v -c vnd0 wifibsd.bin
# disklabel -R -r vnd0 disklabel.proto
# newfs -m 0 vnd0a ; newfs -m 0 vnd0d
# /usr/sbin/installboot -v -m i386 -o timeout=3,console=com0 -t ffs /dev/rvnd0a /usr/mdec/bootxx_ffsv1
# mount /dev/vnd0a /mnt
# cp /usr/mdec/boot /mnt/ ; cp netbsd /mnt/
# umount /mnt
# vnconfig -u vnd0

Then I dd'd my wifibsd.bin to my CF, rebooted and It worked fine...

M. Jessa