Forum Discussion
Altera_Forum
Honored Contributor
20 years ago/bin/init hangs
hi all,
I am trying to boot uclinux on 2s60 board. where my kernel is hanging moment it calls /bin/init. I have build uclinux with changed memory layout where base addresses and irq number differs then default memory layout .sof and .ptf files given by microtronix. Also I have remover support for compact flash in my case. I can boot uclinux build from microtronix .sof and .ptf file on the board with similarly generated file system. I tried "root=/dev/mtdblock0 ro" as well as nfs boot with root=/dev/nfs ro, and seems fine (nfs boot init gives error with init: execv failed, but get login and prompt ok) . But when I give my memory layout sof and ptf file the compilation is successful but kernel get hangs when he calls /bin/init. Any one has any idea why it is happing so??? Do I need to build new busybox ??? Is it not possible to boot uclinux with custom memory layout on Altera boards ?? Do I need to change my quartus-II 4.2 and nios-II 1.1 versions ??? Any suggestion where I am going wrong ??? If any one need I can post my sof, ptf and nios2_system.h files. thanks in advance Ankur13 Replies
- Altera_Forum
Honored Contributor
try the buildroot guide and work on a Linux box, it is easier to use and customize.
http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174) - Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- But when I give my memory layout sof[/b] --- Quote End --- What dose it mean ? Could you post your *.ptf here? If kernel starts up and gives log messages, It seems your hardware(sof) is OK, so maybe there are mistakes in kernel config and rootfs. - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by mountain8848@May 4 2006, 09:48 AM <div class='quotetop'>quote--- quote end ---
--- quote start ---
but when i give my memory layout sof --- Quote End --- What dose it meaning ? Could you post your *.ptf here? If kernel starts up and gives log messages, It seems your hardware(sof) is OK, so maybe there are mistakes in kernel config and rootfs. <div align='right'><{post_snapback}> (index.php?act=findpost&pid=15022)</div> [/b] --- Quote End --- It might be problem in mtd maps. That's why, I would prefer using initramfs as a beginning. You can't success on nios2 uClinux without Linux knowhow. I realy feel it is totally wrong to develope Linux/uClinux on Windows.
- Altera_Forum
Honored Contributor
<div class='quotetop'>QUOTE </div>
--- Quote Start --- But when I give my memory layout sof and ptf file the compilation is successful but kernel get hangs when he calls /bin/init.[/b] --- Quote End --- What is the last message of init? check etc/inittab in your rootfs. or you can used the sample inittab attached build0411.zip of buildroot guide. - Altera_Forum
Honored Contributor
Hi all,
It seems I have a similar problem with my 2c35 board. It's about one week I try to find a solution ... please HELP !!!! :-) The boot screen looks like that: Linux version 2.6.11-uc0 (fleconte@FRMTG01D57967) (gcc version 3.4.1 (Altera Ni s II 5.1 b73))# 12 Wed May 3 15:48:40 2006 uClinux/Nios II Altera Nios II support © 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: root=/dev/mtdblock0 ro PID hash table entries: 256 (order: 8, 4096 bytes) Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) Memory available: 30592k/32768k RAM, 0k/0k ROM (1531k kernel code, 302k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) NET: Registered protocol family 16 JFFS2 version 2.2. © 2001-2003 Red Hat, Inc. Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x822208b0 (irq = 1) is a jtag_uart io scheduler noop registered io scheduler anticipatory registered io scheduler deadline registered io scheduler cfq registered RAMDISK driver initialized: 16 RAM disks of 4096K size 1024 blocksize smc_probe: 85000 Khz Nios SMSC LAN91C111 Driver (v2.1), (Linux Kernel 2.6) eth0: SMC91C11xFD(rev:2) at 0x82210300 IRQ:6 MEMSIZE:8192b NOWAIT:0 ADDR: 00:07 ed:0f:07:74 smc_probe: 85000 Khz Nios Altera NDK flash (AMD): Found 1 x16 devices at 0x0 in 8-bit bank Amd/Fujitsu Extended Query Table at 0x0040 Altera NDK flash (AMD): CFI does not contain boot bank location. Assuming top. number of CFI chips: 1 cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness. cmdlinepart partition parsing not available RedBoot partition parsing not available Using Altera NDK partition definition Creating 4 MTD partitions on "Altera NDK flash (AMD)": 0x00400000-0x00c00000 : "romfs/jffs2" 0x00000000-0x00400000 : "loader/kernel" 0x00c00000-0x00d00000 : "User configuration" 0x00d00000-0x01000000 : "safe configuration" NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP established hash table entries: 2048 (order: 2, 16384 bytes) TCP bind hash table entries: 2048 (order: 1, 8192 bytes) TCP: Hash tables configured (established 2048 bind 2048) NET: Registered protocol family 1 NET: Registered protocol family 17 VFS: Mounted root (romfs filesystem) readonly. Freeing unused kernel memory: 60k freed (0x41aa000 - 0x41b8000) Kernel panic - not syncing: No init found. Try passing init= option to kernel. - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by lefred@May 4 2006, 07:53 PM hi all,it seems i have a similar problem with my 2c35 board.
it's about one week i try to find a solution ... please help !!!! :-)
the boot screen looks like that:
linux version 2.6.11-uc0 (fleconte@frmtg01d57967) (gcc version 3.4.1 (altera ni
s ii 5.1 b73))# 12 wed may 3 15:48:40 2006
uclinux/nios ii
altera nios ii support © 2004 microtronix datacom ltd.
built 1 zonelists
kernel command line: root=/dev/mtdblock0 ro
pid hash table entries: 256 (order: 8, 4096 bytes)
dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
memory available: 30592k/32768k ram, 0k/0k rom (1531k kernel code, 302k data)
mount-cache hash table entries: 512 (order: 0, 4096 bytes)
net: registered protocol family 16
jffs2 version 2.2. © 2001-2003 red hat, inc.
serial: jtag uart driver $revision: 1.4 $
ttyj0 at mmio 0x822208b0 (irq = 1) is a jtag_uart
io scheduler noop registered
io scheduler anticipatory registered
io scheduler deadline registered
io scheduler cfq registered
ramdisk driver initialized: 16 ram disks of 4096k size 1024 blocksize
smc_probe: 85000 khz nios
smsc lan91c111 driver (v2.1), (linux kernel 2.6)
eth0: smc91c11xfd(rev:2) at 0x82210300 irq:6 memsize:8192b nowait:0 addr: 00:07
ed:0f:07:74
smc_probe: 85000 khz nios
altera ndk flash (amd): found 1 x16 devices at 0x0 in 8-bit bank
amd/fujitsu extended query table at 0x0040
altera ndk flash (amd): cfi does not contain boot bank location. assuming top.
number of cfi chips: 1
cfi_cmdset_0002: disabling erase-suspend-program due to code brokenness.
cmdlinepart partition parsing not available
redboot partition parsing not available
using altera ndk partition definition
creating 4 mtd partitions on "altera ndk flash (amd)":
0x00400000-0x00c00000 : "romfs/jffs2"
0x00000000-0x00400000 : "loader/kernel"
0x00c00000-0x00d00000 : "user configuration"
0x00d00000-0x01000000 : "safe configuration"
net: registered protocol family 2
ip: routing cache hash table of 512 buckets, 4kbytes
tcp established hash table entries: 2048 (order: 2, 16384 bytes)
tcp bind hash table entries: 2048 (order: 1, 8192 bytes)
tcp: hash tables configured (established 2048 bind 2048)
net: registered protocol family 1
net: registered protocol family 17
vfs: mounted root (romfs filesystem) readonly.
freeing unused kernel memory: 60k freed (0x41aa000 - 0x41b8000)
kernel panic - not syncing: no init found. try passing init= option to kernel.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15036)
--- quote end ---
--- Quote End --- The best suggestion, try the buildroot guide and work on a Linux box, it is easier to use and customize. http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174)
- Altera_Forum
Honored Contributor
hi hippo, lefred and all,
I saw lefred linux boot dump which is different than mine. In my case I get these prints... VFS: Mounted root (nfs filesystem) Freeing unused kernel memory: 64k freed (0xxxxxx - 0xxxxxx)# I am able to get prompt "#" and it gets hang, i.e. Counter on seven segment display get stop and led glow freezes. But before going into some more discussion first let us try buildroot !!! thanks Ankur - Altera_Forum
Honored Contributor
Some suggestions:
1. Sometimes the kernel can't necessarily detect what the filesystem type is on flash so you might add rootfstype=jffs2 or whatever filesystem type you are using to the kernel commandline. 2. You may not have compiled in the block driver for flash so you need to have at the very least the CONFIG_MTD_BLOCK=y in your .config file. 3. The kernel also needs to have the filesystem type used compiled into it. - Altera_Forum
Honored Contributor
hi hippo and all,
I am facing some issues while running ./build script for buildroot. looks like nios2-linux-uclinux-gcc is missing in my case. I can't make out where I went wrong, could you please just have look over the error print and kindly help me out of this problem.
----------------------------------------------------------------------------------------------- Is there any thing else I need to download for running buildroot ??? I have downloaded all the packages (snapshots) from my windows m/c as I am not familier with wget [my sys wget is not able to resolve web addr !!!].... etc. thanks ankurcp toolchain/uClibc/uClibc.config /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config /mnt/hdb/package/buildroot/toolchain_build_nios2/bin/sed -i -e 's,^CROSS_COMPILER_PREFIX=.*,CROSS_COMPILER_PREFIX="/mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-",g' -e 's,# TARGET_nios2 is not set,TARGET_nios2=y,g' -e 's,^TARGET_ARCH="none",TARGET_ARCH=\"nios2\",g' -e 's,^KERNEL_SOURCE=.*,KERNEL_SOURCE=\"/mnt/hdb/package/buildroot/toolchain_build_nios2/linux\",g' -e 's,^RUNTIME_PREFIX=.*,RUNTIME_PREFIX=\"/\",g' -e 's,^DEVEL_PREFIX=.*,DEVEL_PREFIX=\"/usr/\",g' -e 's,^SHARED_LIB_LOADER_PREFIX=.*,SHARED_LIB_LOADER_PREFIX=\"/lib\",g' /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config /mnt/hdb/package/buildroot/toolchain_build_nios2/bin/sed -i -e 's,^.*UCLIBC_HAS_LFS.*,UCLIBC_HAS_LFS=y,g' /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config /mnt/hdb/package/buildroot/toolchain_build_nios2/bin/sed -i -e 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y,g' /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config /mnt/hdb/package/buildroot/toolchain_build_nios2/bin/sed -i -e 's,# UCLIBC_HAS_THREADS is not set,UCLIBC_HAS_THREADS=y,g' /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config /mnt/hdb/package/buildroot/toolchain_build_nios2/bin/sed -i -e 's,# PTHREADS_DEBUG_SUPPORT is not set,PTHREADS_DEBUG_SUPPORT=y,g' /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config /mnt/hdb/package/buildroot/toolchain_build_nios2/bin/sed -i -e 's,# LINUXTHREADS_OLD is not set,LINUXTHREADS_OLD=y,g' /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.config mkdir -p /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc_dev/usr/include mkdir -p /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc_dev/usr/lib mkdir -p /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc_dev/lib make -C /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc PREFIX=/mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc_dev/ DEVEL_PREFIX=/usr/ RUNTIME_PREFIX=/mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc_dev/ HOSTCC="gcc" pregen install_dev && touch /mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc/.configured /bin/sh: line 1: /mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc: No such file or directory make: /mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc: Command not found make: Entering directory `/mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc' make: /mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc: Command not found HB¸0make -C extra/config conf /bin/sh: line 1: /mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc: No such file or directory make: /mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc: Command not found HB¨make: /mnt/hdb/package/buildroot/build_nios2/staging_dir/bin/nios2-linux-uclibc-gcc: Command not found `B`Bmake: *** No rule to make target `|', needed by `../../extra/config/conf.o'. Stop. make: *** Error 2 make: Leaving directory `/mnt/hdb/package/buildroot/toolchain_build_nios2/uClibc' make: *** Error 2 - Altera_Forum
Honored Contributor
which linux distro do you use?
check your buildroot/build_nios2/staging_dir/bin, are there the cross gcc? I would suggest you put the buildroot dir in your home dir as user. ie ~/buildroot . please try, rm -rf ~/buildroot/toolchain_build_nios2 and make again.