Hi Greg, Greg Ungerer wrote, > Hi Waldemar, > > On 22/08/14 06:25, Waldemar Brodkorb wrote: > >>>Do you have a suggestion why I get a segfault after first executed > >>>command? Similar behaviour Thomas Petazzoni have seen, while he was > >>>trying to run buildroot in Qemu/m68k. See here: > >>>http://lists.busybox.net/pipermail/buildroot/2012-April/052585.html > >> > >>No, I haven't seen that behavior. Is it a hush problem? > >>Maybe try a simpler shell to see if you get the same result. > > > >Okay, it seems a problem with my uClibc version or configuration. > >Still investigating. But using the sash from uClinux works fine > >with my own kernel. > > Ok, at least that gives you a working base to go from.
Okay, after further investigation and deeper digging in the uClinux buildsystem I found partially a solution to my problem. uCLinux uses a gcc wrapper and is linking executables with -nostdlib and manually adding the needed C libraries and startup files. I have just used -static, but this pulled in crtbegin.o and crtend.o from gcc. I now use a gcc wrapper with a modified spec file, so that crtbegin.o/crtend.o is not added to my binary. Furthermore I added following patch to my gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54584 Both changes required to create a working BFLT executable. Otherwise elf2flt seems to pick up the data section of crtbegin.o, which ends up with a BFLT file with a wrong data start. I can provide more details and output of readelf of the sh.gdb files, if required. I am not sure if this can be fixed in the linker script used by elf2flt. But I still don't get an interactive shell working. I use simpleinit and sash. The output of Qemu is: Starting Linux (built with OpenADK). Freeing unused kernel memory: 432K (401a0000 - 4020c000) Shell invoked to run file: /etc/rc Command: echo Starting OpenADK Starting OpenADK Command: hostname openadk Command: mount -t proc proc /proc Command: mount -t sysfs sys /sys Command: mkdir -m 755 /dev/pts Command: mount -t devpts devpts /dev/pts Command: mount -t tmpfs -o size=8M tmpfs /tmp Command: chmod 1777 /tmp Command: mkdir -p /var/log Command: mkdir -p /var/run Command: mkdir -p /var/tmp Command: mdev -s Command: mount rootfs on / type rootfs (rw) devtmpfs on /dev type devtmpfs (rw,relatime,mode=0755) proc on /proc type proc (rw,relatime) sys on /sys type sysfs (rw,relatime) devpts on /dev/pts type devpts (rw,relatime,mode=600) tmpfs on /tmp type tmpfs (rw,relatime,size=8M) Command: ifconfig lo 127.0.0.1 up Execution Finished, Exiting openadk login: Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b My inittab is: s0:linux:/sbin/getty -L -n 38400 ttyS0 1:linux:/sbin/getty -L -n 38400 ttyS1 I have taken a look into the coldfire example from qemu.org. They are using simpleinit and busybox msh. I tried busybox hush, instead of sash, but without success. msh seems no longer available in busybox. Does uClinux provide a interactive shell? (need to try the uClinx system with the gdb method. I am just using kernel with initramfs piggyback) > >>>qemu: hardware error: mcf_fec_read: Bad address 0x1c4 > >> > >>Hmmm, yeah, it does stop there. Not sure why. I will need to look > >>more closely at that. > > > >Did you found anything? > > Yep. The problem is that the FEC driver is writing to registers > that don't exist in the FEC hardware module on the ColdFire > family. Support for some of the extended registers used on > the FEC are used on ARM implementations, and they had added > support for those in more recent years. > > I never picked those up on real hardware. Accesses to those > on addresses cause no (visible) problems. > > Anyway, attached is a patch I propose to fix it. I will be > sending this to the linux net-dev list soon. Great! I will test it really soon. Or may be your upcoming patch. thanks Waldemar _______________________________________________ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev