Forum Discussion
Altera_Forum
Honored Contributor
20 years agoupdate to buildroot guide
Dear all,
I have updated the buildroot guide with gcc3.4.6, kernel 2.6.15.6 and new elf2flt.ld, please check out, http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174)27 Replies
- Altera_Forum
Honored Contributor
Thx hippo. Here's another wrinkle (probably unrelated)....
BTW, I do have a binary called 'flthdr' but it reports problems...$ nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox ~/rootfs/bin/busybox bash: nios2-linux-uclibc-flthdr: command not found
Also, I am getting BAD MAGIC errors when busybox tries to start. Any ideas? How do I build nios2-linux-uclibc-flthdr ?~/buildroot/toolchain_build_nios2/elf2flt$ ./flthdr ~/linux-2.6.16/vmlinux Cannot read header of /home/andrew/linux-2.6.16/vmlinux - Altera_Forum
Honored Contributor
Please check build0329.zip,
the latest snapshot have some problems, but I don't have time to check them. we shall freeze the snapshot to 20060320, the last known good snapshot. - Altera_Forum
Honored Contributor
Thanks hippo, I am trying it now.
- Altera_Forum
Honored Contributor
updated to kernel 2.6.16.1
- Altera_Forum
Honored Contributor
Just checked build0329, and buildroot compiled smoothly for me.
I noticed that nios2linux-1.4.zip was missing (ie. not in build0329.zip), however it is available in previous zipfiles. Here's what happens when I try to boot 2.6.16 kernel. I *think* busybox has ELF header not flat.
Any ideas?Uncompressing Linux... Ok, booting the kernel. Linux version 2.6.16 (andrew@ce00205) (gcc version 3.4.6)# 2 PREEMPT Wed Mar 29 16:57:28 EST 2006 uClinux/Nios II Altera Nios II support (C) 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: PID hash table entries: 128 (order: 7, 2048 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Memory available: 14988k/16384k RAM, 0k/0k ROM (742k kernel code, 482k data) Mount-cache hash table entries: 512 io scheduler noop registered io scheduler deadline registered (default) Serial: JTAG UART driver $Revision: 1.4 $ ttyJ0 at MMIO 0x821208b0 (irq = 1) is a jtag_uart Freeing unused kernel memory: 408k freed (0x10c2000 - 0x1127000) BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic Failed to execute /init BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic BINFMT_FLAT: bad header magic Kernel panic - not syncing: No init found. Try passing init= option to kernel. - Altera_Forum
Honored Contributor
Yes, check it with "nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox" .
rebuild busybox with,
nios2linux-1.4.zip was not in previous build.zip, it was too big. Please find it here, http://forum.niosforum.com/downloads/1_4/nios2linux-1.4.zip (http://forum.niosforum.com/downloads/1_4/nios2linux-1.4.zip)cd ~/buildroot make -C build_nios2/busybox clean make# prepare root fs rm -rf ~/rootfs cp -a ~/buildroot/build_nios2/root/* ~/rootfs cd ~/rootfs# remove include and lib to save space# the dev nodes are generated via ~/download/rootfs_list rm -rf dev usr/include usr/lib# you may use this instead of the one from buildroot cp ~/download/inittab etc - Altera_Forum
Honored Contributor
I have verified 2.6.16 (build0329) on EP2S60 board with SMC91111 driver.
Good job hippo http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/biggrin.gif - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by hootsmon@Mar 29 2006, 12:50 PM thx hippo. here's another wrinkle (probably unrelated)....$ nios2-linux-uclibc-flthdr ~/rootfs/bin/busybox ~/rootfs/bin/busybox bash: nios2-linux-uclibc-flthdr: command not foundbtw, i do have a binary called 'flthdr' but it reports problems...
~/buildroot/toolchain_build_nios2/elf2flt$ ./flthdr ~/linux-2.6.16/vmlinux cannot read header of /home/andrew/linux-2.6.16/vmlinuxalso, i am getting bad magic errors when busybox tries to start.
any ideas? how do i build nios2-linux-uclibc-flthdr ?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=13880)</div> --- Quote End --- In answer to my own question, I rebuilt nios2-linux-uclibc-flthdr as follows:
Having installed flthdr utility, kernel boots and busybox runs properly now.cd ~/buildroot/toolchain_build_nios2/elf2flt make clean make make install - Altera_Forum
Honored Contributor
great.
The vmlinux and zImage are ELF. While the busybox , boa and other apps to run on uClinux are FLT. As for flthdr, you may try
You can safely remove stuff in toolchain_build_nios2 and build_nios2 . a top level make will rebuild them.cd ~/buildroot rm -rf toochain_build_nios2/elf2flt make - Altera_Forum
Honored Contributor
Thx hippo, this is good info