|
|
|
Re: Problem with init call | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
|
Wan ZongShun wrote:
> 2009/3/17 Zachár Balázs <bzachar@xxxxxxxxxxxxxx>
>> Wan ZongShun wrote:
>>> Can you find this console file in rootfs/dev/? Sure the UART driver
>>> works well?
>> My kernel param is:
>> console=ttyS1,115200
>>
>> devel:~# ll /boardnfs/root/dev/ttyS1
>> crw-rw---- 1 root dialout 4, 65 2009-02-20 11:10 /boardnfs/root/dev/ttyS1
>>
>> I think the UART driver is working properly, because if I use the "old" (orig) rootfilesystem to boot up with the new kernel, it works...
>>
>> In my new rootfilesystem there is only /sbin/init (Hello world) and /dev/ttyS1 and the directory structure, should I use anything else to boot up the hello world init??
> re: You must be put console file in your new /boardnfs/root/dev/, you
> can make it by "mknod console c 5 1".
I make the console file (copy it from the old rootfs with cp -a) but still get the error message (but the warning : Warning: unable to open an initial console. perhaps disappeared)
> Using busybox? If so,you can add /etc/init.d/rcS and boot your
> first app program by rcS.
Yes, I want to use Busybox but it didn't work too(same error like with "Hello World!" init), thats why I try the Hello World:
http://www.busybox.net/FAQ.html#init
>
>>
>>> There are a lot of reasons for this Warning!
>>> 2009/3/17 Zachár Balázs <bzachar@xxxxxxxxxxxxxx
>>> <mailto:bzachar@xxxxxxxxxxxxxx>>
>>>
>>> Hi,
>>>
>>> I have a pxa270 based board, and I would like to renew the system on
>>> it...
>>>
>>> I am using the emdebian's stable gnueabi cross-toolchain.
>>> I have already recompile the kernel (both latest stable (2.6.28.7)
>>> and testing (2.6.29-rc8)) and it works (boot up) now...
>>> I make a single init code:
>>> devel:/opt/rootfs# cat test_init.c
>>> #include <stdio.h>
>>>
>>> int main()
>>> {
>>> printf("Hello world!\n");
>>> while(1);
>>> return 0;
>>> }
>>>
>>> I compiled it with the toolchain to static and move it to the
>>> ${nfsserver}/root/sbin/init place
>>>
>>> But when I got this error message when I trying to boot:
>>>
>>> Looking up port of RPC 100003/2 on 10.10.10.1
>>> Looking up port of RPC 100005/1 on 10.10.10.1
>>> VFS: Mounted root (nfs filesystem) on device 0:11.
>>> Freeing init memory: 96K
>>> Warning: unable to open an initial console.
>>> Kernel panic - not syncing: Attempted to kill init!
>>>
>>>
>>> (I have console= in the kernel params so I ignore the warning
>>> message...)
>>> I put some printk to the arch/arm/kernel/sys_arm.c's kernel_execve
>>> function to see where is the problem:
>>> int kernel_execve(const char *filename, char *const argv[], char
>>> *const envp[])
>>> {
>>> struct pt_regs regs;
>>> int ret;
>>>
>>> printk("Before memset.\n");
>>> memset(®s, 0, sizeof(struct pt_regs));
>>> printk("After memset, before do_execve.\n");
>>> ret = do_execve((char *)filename, (char __user * __user *)argv,
>>> (char __user * __user *)envp, ®s);
>>> printk("After do_execve, return value: %d\n",ret);
>>> if (ret < 0)
>>> goto out;
>>> /*
>>> * Save argc to the register structure for userspace.
>>> */
>>> regs.ARM_r0 = ret;
>>>
>>> /*
>>> * We were successful. We won't be returning to our caller, but
>>> * instead to user space by manipulating the kernel stack.
>>> */
>>> printk("Before asm code.\n");
>>> asm(<-->"add<-->r0, %0, %1\n\t"
>>> "mov<-->r1, %2\n\t"
>>> "mov<-->r2, %3\n\t"
>>> "bl<--->memmove\n\t"<-->/* copy regs to top of stack */
>>> "mov<-->r8, #0\n\t"<--->/* not a syscall */
>>> "mov<-->r9, %0\n\t"<--->/* thread structure */
>>> "mov<-->sp, r0\n\t"<--->/* reposition stack pointer */
>>> "b<---->ret_to_user"
>>> :
>>> : "r" (current_thread_info()),
>>> "Ir" (THREAD_START_SP - sizeof(regs)),
>>> "r" (®s),
>>> "Ir" (sizeof(regs))
>>> : "r0", "r1", "r2", "r3", "ip", "lr", "memory");
>>> printk("After asm code.\n");
>>> out:
>>> return ret;
>>> }
>>>
>>>
>>> And I got this output at boot:
>>> Freeing init memory: 96K
>>> Warning: unable to open an initial console.
>>> Before memset.
>>> After memset, before do_execve.
>>> After do_execve, return value: 0
>>> Before asm code.
>>> Kernel panic - not syncing: Attempted to kill init!
>>>
>>>
>>>
>>> It looks like when it use the asm code, it crash (no "After asm
>>> code." message)...
>>>
>>> Any Idea what am I doing wrong?
>>>
>>> regards,
>>> Balázs Zachár
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------------
>>> List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
>>> FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
>>> Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
>>>
>>>
>>>
>>>
>>> --
>>> embedded forum
>>> http://mcuos.com
>
>
>
> --
> embedded forum
> http://mcuos.com
-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm
FAQ: http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette: http://www.arm.linux.org.uk/mailinglists/etiquette.php
[Linux ARM] [Linux ARM MSM] [Linux ARM Kernel] [Fedora ARM] [IETF Annouce] [Security] [Bugtraq] [Linux] [Linux OMAP] [Linux MIPS] [ECOS] [Asterisk Internet PBX] [Linux API]
![]() |
![]() |