Dear all,
I have lock down my problem.

I am sure the /bin/init is launched in kernel by
"run_init_process("/bin/init");".
I found the init program will launch /bin/sh in do_rc() by "rc =
do_command(_PATH_BSHELL, _PATH_RC, 1);" After trace to the detail of
do_command. the problem start from "execve(path, argv, env);" (I am sure the
vfork() is working)
After that syntax the target cause many swi instructions and then PC goes to
strange address, the undefined instruction happened!

Is it make sense that I insert "prink()" into the /bin/init ?
I am now tracing into the execve function, anyone has a good suggestion?

Drag

2008/10/31 Yuan-Lung Li <[EMAIL PROTECTED]>

> Dear DavidM,
> Thank you for your suggestion. Now I am successully mount the romfs. There
> is a new problem: exec the /bin/init
> Seems the program run to strange address after entering do_rc() function.
>
> I have search the previous discussion:"[uClinux-dev] Re: [uClinux-dev]
> problem of execve("/bin/init"...)
> http://mailman.uclinux.org/pipermail/uclinux-dev/2003-January/014303.html";
>
> In that discussion you suggest to prevent the usage of 'setjmp'.
>
> I found there is the setjmp in the sh1.c of '/bin/sh' source on romfs.
> There is a coment "Bruce Evans' fix". How do I fix the problem?
>
> Another question, I have add some low level HW control code in the
> drivers/char/vt.c, thus I can see any message from printk during kernel
> booting. but the "printf" seems not working in the program on user land. I
> have insert the printf in the /bin/init, I will insert printf in the sh.c
> later. Should I set some kernel feature to support the printf working on the
> virtual console?
>
> I am using the uClinux kernel 2.6.x, the original package
> released on 20080808.
>
> Thank you very much.
>
> Drag
>
> 2008/10/15 David McCullough <[EMAIL PROTECTED]>
>
>
>> Jivin Yuan-Lung Li lays it down ...
>> > Sorry for updaing the booting message:
>>
>> Looks close,  couple of things below.
>>
>> > <4>Built 1 zonelists in Zone order, mobility grouping on.  Total pages:
>> 8128
>> > <5>Kernel command line: root=/dev/ram0 rw
>>
>> You can't mount romfs "rw"
>>
>> > [EMAIL PROTECTED],2M keepinitrd nocache
>>
>> You may want to add rootfstype=romfs
>>
>> > <4>PID hash table entries: 128 (order: 7, 512 bytes)
>> > <4>Console: colour dummy device 80x30
>> > <6>console [tty0] enabled
>> > <6>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
>> > <6>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
>> > <6>Memory: 32MB = 32MB total
>> > <5>Memory: 29376KB available (852K code, 133K data, 68K init)
>> > <7>Calibrating delay loop... 49.86 BogoMIPS (lpj=249344)
>> > <4>Mount-cache hash table entries: 512
>> > <6>checking if image is initramfs...it isn't (bad gzip magic numbers);
>> looks
>> > like an initrd
>> > <4>NetWinder Floating Point Emulator V0.97 (double precision)
>> > <4>fuse init (API version 7.9)
>> > <6>io scheduler noop registered
>> > <6>io scheduler anticipatory registered
>> > <6>io scheduler deadline registered
>> > <6>io scheduler cfq registered (default)
>> > <6>brd: module loaded
>> > <5>RAMDISK: romfs filesystem found at block 0
>> > <5>RAMDISK: Loading 801KiB [1 disk] into ram disk...
>> > | / - \ | / - \ | / - \ | / - \ | / - \ | / - \ | / - \ | / - \ | / - \
>> | / - \ | / - \ | / - \ | / - done.
>> > <4>List of all partitions:
>> > <4>0100       4096 ram0 (driver?)
>> > <4>0101       4096 ram1 (driver?)
>> > <4>0102       4096 ram2 (driver?)
>> > <4>0103       4096 ram3 (driver?)
>> > <4>0104       4096 ram4 (driver?)
>> > <4>0105       4096 ram5 (driver?)
>> > <4>0106       4096 ram6 (driver?)
>> > <4>0107       4096 ram7 (driver?)
>> > <4>0108       4096 ram8 (driver?)
>> > <4>0109       4096 ram9 (driver?)
>> > <4>010a       4096 ram10 (driver?)
>> > <4>010b       4096 ram11 (driver?)
>> > <4>010c       4096 ram12 (driver?)
>> > <4>010d       4096 ram13 (driver?)
>> > <4>010e       4096 ram14 (driver?)
>> > <4>010f       4096 ram15 (driver?)
>> > <4>No filesystem could mount root, tried:  fuseblk
>>
>> What filesystems do you have compiled into your kernel ?
>>
>> Cheers,
>> Davidm
>>
>> > <0>Kernel panic - not syncing: VFS: Unable to mount root fs on
>> > unknown-block(1,0)
>> >
>> >
>> > 2008/10/14 Yuan-Lung Li <[EMAIL PROTECTED]>
>> >
>> > >  Dear all,
>> > > I am implementing a virtual platform for running the uClinux. After
>> > > compiling, I put the Image in the virtual ram address 0x4008000 and
>> boot.rom
>> > > put into the 0x4200000.
>> > > The default kernel command line:
>> > > root=/dev/ram0 rw [EMAIL PROTECTED] initrd=0x4200000,2M keepinitrd
>> nocache
>> > >
>> > > The booting message is below(partially):
>> > >
>> > > <4>Built 1 zonelists in Zone order, mobility grouping on.  Total
>> pages:
>> > > 8128
>> > > <5>Kernel command line: root=/dev/ram0 rw [EMAIL PROTECTED],2M
>> keepinitrd nocache
>> > > <4>PID hash table entries: 128 (order: 7, 512 bytes)
>> > > <4>Console: colour dummy device 80x30
>> > > <6>console [tty0] enabled
>> > > <6>Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
>> > > <6>Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
>> > > <6>Memory: 32MB = 32MB total
>> > > <5>Memory: 29376KB available (852K code, 133K data, 68K init)
>> > > <7>Calibrating delay loop... 49.86 BogoMIPS (lpj=249344)
>> > > <4>Mount-cache hash table entries: 512
>> > > <6>checking if image is initramfs...it isn't (bad gzip magic numbers);
>> > > looks like an initrd
>> > > Did I make any mistake? Seems the boot.rom need to be compressed. Or
>> the
>> > > initramfs is not content of boot.rom?
>> > > Thanks.
>> > >
>> > > Drag
>> > >
>>
>> > _______________________________________________
>> > uClinux-dev mailing list
>> > [email protected]
>> > http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
>> > This message was resent by [email protected]
>> > To unsubscribe see:
>> > http://mailman.uclinux.org/mailman/options/uclinux-dev
>>
>> --
>> David McCullough,  [EMAIL PROTECTED],   Ph:+61
>> 734352815
>> Secure Computing - SnapGear  http://www.uCdot.org <http://www.ucdot.org/>
>> http://www.snapgear.com
>>  _______________________________________________
>> uClinux-dev mailing list
>> [email protected]
>> http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
>> This message was resent by [email protected]
>> To unsubscribe see:
>> http://mailman.uclinux.org/mailman/options/uclinux-dev
>>
>
>
_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to