Subject: Re: memory based root filesystem
To: NetBSD-Kernel <tech-kern@netbsd.org>
From: Brian Rose <lists@brianrose.net>
List: tech-kern
Date: 01/12/2005 13:08:54
Kamal R. Prasad wrote:
> Hello,
> 
> I did it as per the link below and got a panic.
> http://www.bsdnewsletter.com/2003/09/Features102.html
> 
> The distro seems to prepare a huge set of files,
> whereas I want a minimal set to get a login prompt.
> Can someone confirm if the article above is not
> misleading?

<snip>
Two questions...
1) Which NetBSD version are you using?
2) What platform are you on?

I wrote that article back in the 1.6.x days, so there very well may have 
been some changes. I'll review it tonight to make sure it is current. I 
also used a i386 machine with a floppy drive to test on. If you are using
a different platform, things might be a bit different. But I can't think of 
  anything right now. If your bootloader is loading the kernel and memory 
is functioning, this _should_ still work.

Also, you will need enough RAM to do the job. You will need enough for the 
uncompressed kernel image and filesystem. I had troubles on a 32M machine 
where I specified a 16M ramdisk. I figured out that if I reduced the 
ramsize to 8M it worked fine. IIRC, you need make sure that your system RAM 
is greater than the uncompressed kernel size (with the RAMDISK) plus 16Meg 
needed for system operation. So if you specified a 16Meg ramdisk on a 32Meg 
machine, you would get problems because the ramdisk+16Meg is 32Meg and that 
does not leave any room for the kernel itself.


> 
> Why does the system panic saying there is no init and
> then stop in init? Do we need an /sbin/oinit and
> /sbin/init.bak too in the crunch file?
> 
> Pasted below is info about the panic.
> -------------------------------
> root on md0a dumps on md0b
> mountroot: trying ffs...
> root file system type: ffs
> cpu_lwp_fork: 0xc0732a1c 0xc2a4207c 0xc0732a1c
> 0xc0732a1c
> l1->procaddr=0xc01ed000 l1->procaddr->u_pcb=0xc01ed000
> pid=1 pmap=0xc07366c8
> l2->procaddr=0xc2a46000 l2->procaddr->u_pcb=0xc2a46000
> pid=0 pmap=0xc07366c8
> cpu_lwp_fork: 0xc0732a1c 0xc2a420f8 0xc0732a1c
> 0xc0732a1c
> l1->procaddr=0xc01ed000 l1->procaddr->u_pcb=0xc01ed000
> pid=1 pmap=0xc07366c8
> l2->procaddr=0xc2a48000 l2->procaddr->u_pcb=0xc2a48000
> pid=0 pmap=0xc07366c8
> cpu_lwp_fork: 0xc0732a1c 0xc2a42174 0xc0732a1c
> 0xc0732a1c
> l1->procaddr=0xc01ed000 l1->procaddr->u_pcb=0xc01ed000
> pid=1 pmap=0xc07366c8
> l2->procaddr=0xc2a4a000 l2->procaddr->u_pcb=0xc2a4a000
> pid=0 pmap=0xc07366c8
> init: copying out flags `-s' 3
> init: copying out path `/sbin/init' 11
> exec /sbin/init: error 8
> init: copying out flags `-s' 3
> init: copying out path `/sbin/oinit' 12
> exec /sbin/oinit: error 2
> init: copying out flags `-s' 3
> init: copying out path `/sbin/init.bak' 15
> exec /sbin/init.bak: error 2
> init: not found
> panic: no init
> Stopped in pid 1.1 (init) at    0xc02d884c:     bx    
>  r14
> db> trace
> 0xc02760bc
>         scp=0xc02760bc rlv=0xc0241498 (0xc0241498)
>         rsp=0xc2a39ed4 rfp=0xc2a39fb0
>         r7=0xbfffffec r6=0x00000000
>         r5=0xc03112bc r4=0xbfffffe8
> 0xc0241264
>         scp=0xc0241264 rlv=0xc02e06a0 (0xc02e06a0)
>         rsp=0xc2a39fb4 rfp=0x00000000
>         r10=0x00000000 r9=0x00000000
>         r8=0x00000000 r7=0x00000000 r6=0x00000000
> r5=0xc2a42000
>         r4=0xc0241258
> ----------------------------------------
> 
> thanks
> -kamal
> 


-- 

Brian