Forum Discussion
uClinux without Flash (again)
I decided to give uClinux a try on my custom board, but I only have an SD card slot, no CFI. When reading the install guide for uClinux, and when trying it, it won't let me build a kernel project without a CFI device present? Is there any way to get around this? It seems odd that I can't build the kernel and run from DRAM, and then write to the SD Card if I wish to boot...
Thx!58 Replies
- Altera_Forum
Honored Contributor
now it's giving me this message:
Kernel panic - not syncing: junk in compressed archive I removed some files from the tree, and that's what it gavem e... it seems like it's corrupting the kernel image somehow? - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by jdhar@Nov 24 2005, 09:40 PM now it's giving me this message:kernel panic - not syncing: junk in compressed archive
i removed some files from the tree, and that's what it gavem e... it seems like it's corrupting the kernel image somehow?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11148)
--- quote end ---
--- Quote End --- Oh, here are some more messages, and a warning that may be a problem? I'm not sure why it's there tho: HOSTCC usr/gen_init_cpio usr/.gen_init_cpio.d: done. CHK usr/initramfs_list UPD usr/initramfs_list CPIO usr/initramfs_data.cpio GZIP usr/initramfs_data.cpio.gz AS usr/initramfs_data.o /cygdrive/c/altera/kits/nios2_51/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/usr/initramfs_data.S: Assembler messages: /cygdrive/c/altera/kits/nios2_51/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/usr/initramfs_data.S:29: Warning: truncated file `usr/initramfs_data.cpio.gz', 387063 of 387069 bytes read usr/.initramfs_data.o.d: done.
- Altera_Forum
Honored Contributor
It seems error in building the initramfs data.
Please try remove more drivers in kernel, more files in the root fs. Check the Makefile and link script to find out what wrong. Maybe dos2unix cause the problem. Are you using Windows/Cygwin? I build the tools chains and run under Linux, and Windows/quartus is used for hardware design only. I use a Samba server to share the files. --- Quote Start --- originally posted by jdhar+nov 25 2005, 01:37 pm--><div class='quotetop'>quote (jdhar @ nov 25 2005, 01:37 pm)</div>--- quote start ---
<!--quotebegin-jdhar@Nov 24 2005, 09:40 PM now it's giving me this message:
kernel panic - not syncing: junk in compressed archive
i removed some files from the tree, and that's what it gavem e... it seems like it's corrupting the kernel image somehow?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11148)
--- quote end ---
--- Quote End --- Oh, here are some more messages, and a warning that may be a problem? I'm not sure why it's there tho: HOSTCC usr/gen_init_cpio usr/.gen_init_cpio.d: done. CHK usr/initramfs_list UPD usr/initramfs_list CPIO usr/initramfs_data.cpio GZIP usr/initramfs_data.cpio.gz AS usr/initramfs_data.o /cygdrive/c/altera/kits/nios2_51/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/usr/initramfs_data.S: Assembler messages: /cygdrive/c/altera/kits/nios2_51/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/usr/initramfs_data.S:29: Warning: truncated file `usr/initramfs_data.cpio.gz', 387063 of 387069 bytes read usr/.initramfs_data.o.d: done. <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11150)</div> [/b] --- Quote End ---
- Altera_Forum
Honored Contributor
Add a debug line to init/initramfs.c
static char * __init unpack_to_rootfs(char *buf, unsigned len, int check_only) { int written; + printk("unpack_to_rootfs %x+%x check %d\n",(unsigned)buf,len,check_only); dry_run = check_only; You will see uClinux/Nios II Altera Nios II support © 2004 Microtronix Datacom Ltd. Built 1 zonelists Kernel command line: PID hash table entries: 512 (order: 9, 8192 bytes) Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) Memory available: 63232k/65536k RAM, 0k/0k ROM (1215k kernel code, 390k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) unpack_to_rootfs 14eaa4+36738 check 0 So it is trying to unzip the initramfs image, but the data is corrupted. That is confirmed by the warning in the kernel building. - Altera_Forum
Honored Contributor
Please try, in the kernel Makefile, remove the dos2unix line.
# execute the command and also postprocess generated .d dependencies # file # cygwhack: when generating dependencies with gcc 2.95.3, lines seem to be # terminated with CR/LFs reqardless of how directories are mounted. "newer" gcc versions # do not seem to exhibit this anomaly but we are stuck with the current version until # Altera upgrades their distribution. hence we dos2unix the .d file for fixdep... if_changed_dep = $(if $(strip $? $(filter-out FORCE $(wildcard $^),$^) $(filter-out $(cmd_$(1)),$(cmd_$@)) $(filter-out $(cmd_$@),$(cmd_$(1)))), $(Q)set -e; $(if $($(quiet)cmd_$(1)),echo ' $(subst ','\'',$($(quiet)cmd_$(1)))';) $(cmd_$(1)); - dos2unix $(depfile); scripts/basic/fixdep $(depfile) $@ '$(subst $$,$$$$,$(subst ','\'',$(cmd_$(1))))' > $(@D)/.$(@F).tmp; rm -f $(depfile); mv -f $(@D)/.$(@F).tmp $(@D)/.$(@F).cmd) - Altera_Forum
Honored Contributor
How do you do the build under linux, and what part exactly do you do in linux. I am using cygwin/windows - could that be a reason why it's bad? I can use a linux machine no problem... just need to know what tool chain to use
- Altera_Forum
Honored Contributor
I just grabbed the GNUBIN.TGZ file from the NIOS II CD in the linux directory; it seems to have all the binaries needed to build the kernel, however, I have no idea how to setup my environment to run that makefile... I will try messing around with it, but there is no way to get this working in windows I take it?
I also found this site: http://scorpius.homelinux.org/~marc/nios2.html (http://scorpius.homelinux.org/~marc/nios2.html) It describes a process for building a linux toolchain - is this something I should follow, because it doesn't seem to use the microtronix kernel. - Altera_Forum
Honored Contributor
You can follow the marc's page.As I did it.
You can't use gcc4 to build the tools chain. I am using Fedora Core 4, and have to install the gcc32. And in /usr/bin, mv gcc gcc4,then ln -s gcc32 gcc. You are close, and you don't need to do it right now. You can do it later. I think removing the line of dos2unix in the top level kernel Makefile will solve the problem. - Altera_Forum
Honored Contributor
I have MMC/SD sockets on some of my boards.
And I am going to try out. The NIOS SPI is not good for MMC/SD. I am using PIO ports instead. I think using "root=/dev/mmc" is not a good idea. After the system boot, the mmc/sd card may be unplug, and another be plug in later. So I am going to keep Initramfs as root fs. The devfs was obsolete, and will be replaced by udev. I am going to mknod mmc with fixed device number. I will also check mmc driver from newer kernel. - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by hippo@Nov 26 2005, 06:53 AM i have mmc/sd sockets on some of my boards.and i am going to try out.
the nios spi is not good for mmc/sd.
i am using pio ports instead.
i think using "root=/dev/mmc" is not a good idea.
after the system boot, the mmc/sd card may be unplug, and another be plug in later.
so i am going to keep initramfs as root fs.
the devfs was obsolete, and will be replaced by udev.
i am going to mknod mmc with fixed device number.
i will also check mmc driver from newer kernel.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11174)
--- quote end ---
--- Quote End --- I'm moving away from SD/MMC, because it doesn't seem too supported - on a new version of the board, I will use CF instead, and no CFI since I think it's a waste to have on-board flash. If I can get this initramfs working, then I can just boot from RAM and then mount CF after init. I will try this with windows, but if not, then linux - I am using slackware, so I am only at GCC 3.3.4 - I need to understand the toolchain better first. If I remove that dos2unix line altogether, this is what I get: ------------------------------------------------ Microtronix Linux Extensions Version 1.4, Built June 20, 2005 ------------------------------------------------ make: Entering directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x' no emulation specific options. /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/Makefile:1265: *** commands commence before first target. Stop. make: *** [_all] Error 2 make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x' if I jsut comment it out with a '#' in front of it, I still get the truncated file warning, and the build fails with: LD .tmp_vmlinux1 KSYM .tmp_kallsyms1.S /cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x/Makefile:703: *** unterminated call to function `if': missing `)'. Stop. make: *** [_all] Error 2 make: Leaving directory `/cygdrive/c/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.kernel_1.4.0/linux-2.6.x' Have you tried doing this in windows yourself? Adding the debug statement you told me shows this: unpack_to_rootfs 118ed98+bd813 check 0 Out of curiosity, are those linux binaries that comes with the NIOS II distribution any good? Aren't those part of the toolchain? nios2-elf-gcc for xample..