Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: stuck in bringing the userland shell on a latest ARM core



On Wed, 25 Mar 2009, newbie wrote:

> 
> Hi All,
> 
> I am trying to bring up NetBSD-5 on a latest ARM Core (which is not yet 
> natively supported by NetBSD/arm port) as part of learning NetBSD.
> 
> I do not have any previous practical exposure on NetBSD or for that 
> matter on any other Unix-like OSes.
> 
> I am able to bring up the kernel in a couple of weeks (although not in a 
> clean way), but I am stuck in brining up the userland.
> 
> First I ran into nbmakefs toolset problem in building the ramdisk under 
> cygwin development environment. Then I bumped into version mismatch 
> between the userland and kernel.
> 
> With the right ramdisk matching kernel version(got from Mr.Ken 
> Hornstein), My serial console output is as below:
> 

[snip dmesg]

> init: copying out flags `-s' 3
> 
> init: copying out path `/sbin/init' 11
> 
> -sh: media_constructor: File exists
> 
> ------------- Console Outpupt End -----------------------------------------
> 
> When I intercept the system calls on the kernel side, the shell 
> (/bin/sh) is exiting (sys_exit: 2.1 exiting with signal 0, exit code 1).
> 
> Also there is a sys_execve call with exec path as "/bin/sh" and a single 
> argument "-sh". After this, the shell is printing output "-sh: 
> media_constructor: File exists" and exiting with exit code 1.
> 
> Why is the shell (/bin/sh) exiting with exit code 1?
> 
> While refering to the /sbin/init source code, ideally I should see the 
> printf "Enter pathname of shell or RETURN for %s: " before the shell 
> (/bin/sh) is execved.
> 
> Why am I not able to see this message on the console before the shell is 
> started?

That only happens if the system is booted in single usermode - whatever
bootstrap your using has to set RB_SINGLE in boothowto for -s to be passed
to init. (see sys/kern/init_main.c)

> Whart are the mandatory kernel options (compile and run time) to enable 
> a serial port terminal for the userland?

If you have a serial console then you have a serial console for both
userland and kernel, you don't need a 2nd one.

"-sh: media_constructor: File exists" line looks like it's from userland -
from ifconfig?!? (see: sbin/ifconfig/media.c) presumably your ramdisk is
populated with a crunchgen'd system?

the "File exists" thing is missleading btw, it's EEXIST from
sbin/ifconfig/ifconfig.c:flag_is_registered but i'm not sure whats causing
that at all.

So it looks as if userland is working, but either the scripts it's trying to
run, or somwhere in init it's self it's getting confused.

> I wish I could debug the userland, but I do not have any spare debugging 
> transport (ethernet/serial port) on the target as of now. All that I 
> have is a single serial port, which I am already using as a serial 
> console.

P.S. http://nxr.netbsd.org/source/ is awesome.

-- 
[http://pointless.net/]                                   [0x2ECA0975]


Home | Main Index | Thread Index | Old Index