Forum Discussion
Altera_Forum
Honored Contributor
14 years agoProblem booting latest version of nios2 uClinux
I have the latest version of nios2 uClinux using the dts file created from sopcinfo. I never see the "Uncompressing Linux... Ok, booting the kernel." message before the Linux startup. This leads me to believe the file system is not being extracted to the memory. Does anyone know what would be causing this?
Linux version 3.4.0+ (root@server) (gcc version 4.1.2)# 360 PREEMPT Wed May 23 12:29:37 EDT 2012
bootconsole enabled
early_console initialized at 0xf0008d20
On node 0 totalpages: 32768
free_area_init_node: node 0, pgdat c846314c, node_mem_map c8476280
DMA zone: 256 pages used for memmap
DMA zone: 0 pages reserved
DMA zone: 32512 pages, LIFO batch:7
pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
pcpu-alloc: 0
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 32512
Kernel command line: debug console=ttyAL0,115200 init=/bin/init
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
Memory available: 125344k/4557k RAM (1953k kernel code, 2603k data)
NR_IRQS:64
Calibrating delay loop... 30.31 BogoMIPS (lpj=151552)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 512
NET: Registered protocol family 16
bio: create slab <bio-0> at 0
Switching to clocksource timer
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 4096 (order: 3, 32768 bytes)
TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
TCP: Hash tables configured (established 4096 bind 4096)
TCP: reno registered
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
jffs2: version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
io scheduler noop registered
io scheduler deadline registered (default)
ttyAL0 at MMIO 0x10008d20 (irq = 5) is a Altera UART
console enabled, bootconsole disabled
console enabled, bootconsole disabled
spi_altera 10007c00.spi: master is unqueued, this is deprecated
m25p80 spi32766.0: found m25p64, expected m25p80
m25p80 spi32766.0: m25p64 (8192 Kbytes)
spi_altera 10007c00.spi: base f0007c00, irq 4
altera_tse-mdio: probed
eth0: Altera TSE MAC at 0xf0008400 irq 2/1
eth0: Reporting available PHYs:
eth0: PHY with ID 0x20005c7a at 0x1
altera_tse-mdio: probed
eth1: Altera TSE MAC at 0xf0008800 irq 7/6
eth1: Reporting available PHYs:
TCP: cubic registered
NET: Registered protocol family 17
Freeing unused kernel memory: 2308k freed (0xc81ea000 - 0xc842b000)
Failed to execute /init
Failed to execute /bin/init. Attempting defaults...
Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance.14 Replies
- Altera_Forum
Honored Contributor
Hi,
--- Quote Start --- I never see the "Uncompressing Linux... Ok, booting the kernel." message before the Linux startup. This leads me to believe the file system is not being extracted to the memory --- Quote End --- Did you download the compressed kernel with your "Root File System"?
The kernel only says "I can't find 'init' program". Did you confirm that your program includes it? KazuFreeing unused kernel memory: 2308k freed (0xc81ea000 - 0xc842b000) Failed to execute /init Failed to execute /bin/init. Attempting defaults... Kernel panic - not syncing: No init found. Try passing init= option to kernel. See Linux Documentation/init.txt for guidance. - Altera_Forum
Honored Contributor
--- Quote Start --- The kernel only says "I can't find 'init' program". Did you confirm that your program includes it? --- Quote End --- The zImage built from the romfs directory has the init in both the / and the /bin directories. - Altera_Forum
Honored Contributor
Hi,
--- Quote Start --- The zImage built from the romfs directory has the init in both the / and the /bin directories. --- Quote End --- And where did you store those, initrd, initramfs or jffs2 ? Kazu - Altera_Forum
Honored Contributor
--- Quote Start --- And where did you store those, initrd, initramfs or jffs2 ? --- Quote End --- The initramfs files are in the uClinux-dist/linux-2.6.x/usr directory. This directory contains the initramfs_data.cpio which is mountable under linux and shows all the files in the romfs directory. - Altera_Forum
Honored Contributor
Hi,
--- Quote Start --- The initramfs files are in the uClinux-dist/linux-2.6.x/usr directory. This directory contains the initramfs_data.cpio which is mountable under linux and shows all the files in the romfs directory. --- Quote End --- And which file did you download? Maybe, you have many files in your 'Image' directory. And What message does your 'make' say in the last part of build process? Kazu - Altera_Forum
Honored Contributor
--- Quote Start --- And which file did you download? --- Quote End --- There are two files in the images directory. romfs-inst.log (2353 bytes) zImage (3293581 bytes) After uploading the SOF file I upload the zImage file to the FPGA. --- Quote Start --- And What message does your 'make' say in the last part of build process? --- Quote End ---make ARCH=nios2 -C vendors image make: Entering directory `/root/nios2-linux/uClinux-dist/vendors' make -C /root/nios2-linux/uClinux-dist/vendors/Altera/nios2/. dir_v=/root/nios2-linux/uClinux-dist/vendors/Altera/nios2/. -f /root/nios2-linux/uClinux-dist/vendors/vendors-common.mak image make: Entering directory `/root/nios2-linux/uClinux-dist/vendors/Altera/nios2' || mkdir -p /root/nios2-linux/uClinux-dist/images chmod -R +x /root/nios2-linux/uClinux-dist/romfs/bin rm /root/nios2-linux/uClinux-dist/linux-2.6.x/usr/initramfs_data.cpio.gz LDFLAGS="" make ARCH=nios2 CROSS_COMPILE=nios2-linux-gnu- -C /root/nios2-linux/uClinux-dist/../linux-2.6 O=/root/nios2-linux/uClinux-dist/linux-2.6.x zImage make: Entering directory `/root/nios2-linux/linux-2.6' Using /root/nios2-linux/linux-2.6 as source for kernel GEN /root/nios2-linux/uClinux-dist/linux-2.6.x/Makefile CHK include/linux/version.h CHK include/generated/utsrelease.h CALL /root/nios2-linux/linux-2.6/scripts/checksyscalls.sh cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation CHK include/generated/compile.h GEN usr/initramfs_data.cpio.gz AS usr/initramfs_data.o cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation LD usr/built-in.o DTC arch/nios2/boot/system.dtb DTC: dts->dtb on file "/root/nios2-linux/linux-2.6/../linux-2.6/arch/nios2/boards/wim_mmu/wim.dts" AS arch/nios2/boot/linked_dtb.o cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation LD arch/nios2/boot/built-in.o LD vmlinux.o MODPOST vmlinux.o GEN .version CHK include/generated/compile.h UPD include/generated/compile.h CC init/version.o cc1: warning: include location "/usr/local/include" is unsafe for cross-compilation LD init/built-in.o LD vmlinux SYSMAP System.map OBJCOPY arch/nios2/boot/vmlinux.bin GZIP arch/nios2/boot/vmlinux.gz LD arch/nios2/boot/compressed/piggy.o LD arch/nios2/boot/compressed/vmlinux OBJCOPY arch/nios2/boot/zImage Kernel: arch/nios2/boot/zImage is ready make: Leaving directory `/root/nios2-linux/linux-2.6' cp /root/nios2-linux/uClinux-dist/linux-2.6.x/arch/nios2/boot/zImage /root/nios2-linux/uClinux-dist/images/zImage make: Leaving directory `/root/nios2-linux/uClinux-dist/vendors/Altera/nios2' make: Leaving directory `/root/nios2-linux/uClinux-dist/vendors' - Altera_Forum
Honored Contributor
Hi,
Maybe you have uncompressed kernel 'vmlinux' somewhere, please read the elf header by 'nios2-*****-readelf' -a vmlimux > ***. If you see the section '.init.ramfs' etc. and it has enough size, then I think that it's time for 'kernel debuging'. There are several popular method, 'printk' or gdb..... Kazu - Altera_Forum
Honored Contributor
There is no .init.ramfs in the section headers after running the "nios2-linux-gnu-readelf -a vmlinux" command. Is this the problem?
- Altera_Forum
Honored Contributor
Hi,
--- Quote Start --- There is no .init.ramfs in the section headers after running the "nios2-linux-gnu-readelf -a vmlinux" command. Is this the problem? --- Quote End --- Maybe. Please search where your root file system is linked. In general, the linker do this automatically, so please check your 'Makefile' and 'linker script' again. Kazu - Altera_Forum
Honored Contributor
What linker script are you referring to? I do not see any links to the root file system. I also tried uploading the vmlinux file to the FPGA but it gives the same error message as before. Has anyone built the latest version of uClinux for NIOS2 and has it working?