From: Yoshinori S. <ys...@us...> - 2004-09-08 16:17:08
|
At 06 Sep 2004 09:35:31 +0200, Aleix Badia i Bosch wrote: > Dear all, I've some problems executing uclinux (linux-2.6.7 + uclinux + > h8300 port) using gdb debugger. >=20 > It looks like if there's no kernel initialization problem: > - MTD initialization (RAM) > - FS (romfs) initialization > - console registration > - sys_open /dev/console >=20 > NOTE: I'm using rootimage from uclinux-h8.sourceforge.jp with some /dev > modifications >=20 > crw------- 1 root root 5, 1 gen 1 1970 console > crw------- 1 root root 4, 0 gen 1 1970 tty0 > crw------- 1 root root 4, 64 gen 1 1970 ttySC0 > crw------- 1 root root 4, 65 gen 1 1970 ttySC1 >=20 >=20 > but it fails (or at least it looks like it fail) as there's no ouput, > when trying to execute /bin/init, just like idle task?=BF. I'm not sure if > /bin/init is running but gdb can't trace that process that way, or if > there's really a problem on kernel execve (-> syscall). >=20 >=20 > .... > if (execute_command) > run_init_process(execute_command); >=20 > run_init_process("/sbin/init"); -> fails (OK rootimage->/bin/init) > run_init_process("/etc/init"); -> fails (OK rootimage->/bin/init) > run_init_process("/bin/init"); -> OK (MTD OK, romfs OK) > run_init_process("/bin/sh"); >=20 > panic("No init found. Try passing init=3D option to kernel."); > .... >=20 >=20 > Breakpoint 5, sys_execve (name=3D0x5bb000 "/bin/init", argv=3D0x202004,=20 > envp=3D0x20202c, dummy=3D703605) at arch/h8300/kernel/process.c:256 > 256 error =3D do_execve(filename, argv, envp, regs); > 3: error =3D 6008832 > (gdb) n > 257 putname(filename); > 3: error =3D 0 > (gdb)=20 >=20 >=20 > GDB should show some init starting message (perhaps not the same as > busybox code below and rootimage are extracted from different busybox > versions) >=20 > extern int init_main(int argc, char **argv) > { >=20 > ..=20 > /* Hello world */ > message(MAYBE_CONSOLE | LOG, "init started: %s", > bb_msg_full_version); > ... >=20 > } >=20 > Perhaps bad busybox console initialization ? >=20 >=20 > I've no clear idea about gdb execution and the way console (struct > console) gdb_console, registred as gdb_con, is used by debugger; the > same with /dev/ttySC* or /dev/ttyS* >=20 >=20 > I just insert gdb vmlinux debugging output and attach .config file: >=20 > (gdb) target sim > SCI0 =3D /dev/pts/9 > Connected to the simulator. >=20 > (gdb) load > Loading section .vectors, size 0x100 vma 0x0 > Loading section .text, size 0xb4410 vma 0x100 > Loading section .data, size 0xfc40 vma 0x200000 > Loading section .romfs, size 0xc400 vma 0x218a98 > Start address 0x200 > Transfer rate: 6826624 bits in <1 sec. >=20 > (gdb) r > Starting program: /home/usuari/linux-2.6.7/vmlinux=20 > Linux version 2.6.7-uc0 (usuari@debian) (gcc version 3.1.1) #77 Mon Sep > 6 08:38:01 CEST 2004 >=20 >=20 > uClinux H8/300H > Target Hardware: generic > Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne > H8/300 series support by Yoshinori Sato <ys...@us...> > On node 0 totalpages: 1536 > DMA zone: 0 pages, LIFO batch:1 > Normal zone: 1536 pages, LIFO batch:1 > HighMem zone: 0 pages, LIFO batch:1 > Built 1 zonelists > Kernel command line: console=3DttySC0,38400n81 > PID hash table entries: 16 (order 4: 128 bytes) > Linux version 2.6.7-uc0 (usuari@debian) (gcc version 3.1.1) #77 Mon Sep > 6 08:38:01 CEST 2004 >=20 >=20 > uClinux H8/300H > Target Hardware: generic > Flat model support (C) 1998,1999 Kenneth Albanowski, D. Jeff Dionne > H8/300 series support by Yoshinori Sato <ys...@us...> > On node 0 totalpages: 1536 > DMA zone: 0 pages, LIFO batch:1 > Normal zone: 1536 pages, LIFO batch:1 > HighMem zone: 0 pages, LIFO batch:1 > Built 1 zonelists > Kernel command line: console=3DttySC0,38400n81 > PID hash table entries: 16 (order 4: 128 bytes) > Memory available: 3860k/999k RAM, 0k/0k ROM (720k kernel code, 98k data) > Calibrating delay loop... 5.00 BogoMIPS > Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) > Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) > Mount-cache hash table entries: 512 (order: 0, 4096 bytes) > Linux NoNET1.0 for Linux 2.6 > SuperH SCI(F) driver initialized > ttySC0 at MMIO 0xffffb0 (irq =3D 54) is a sci > ttySC1 at MMIO 0xffffb8 (irq =3D 58) is a sci > ttySC2 at MMIO 0xffffc0 (irq =3D 62) is a sci > Using anticipatory io scheduler > uclinux[mtd]: RAM probe address=3D0x218a98 size=3D0xd000 > Creating 1 MTD partitions on "RAM": > 0x00000000-0x0000d000 : "ROMfs" > uclinux[mtd]: set ROMfs to be root filesystem > VFS: Mounted root (romfs filesystem) readonly. >=20 > Program received signal SIGSEGV, Segmentation fault. > 0x0006c5a4 in L1a5 () at lib/radix-tree.c:756 > 756 } > (gdb)=20 >=20 >=20 > Regards, >=20 I cannot identify a problem in my environment. Will you identify it with new gcc? Can you take a root image if possible? --=20 Yoshinori Sato <ys...@us...> |