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
--- Quote Start --- originally posted by jdhar@Nov 8 2005, 09:29 AM 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!
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10853)
--- quote end ---
--- Quote End --- no one knows how to do this?
- Altera_Forum
Honored Contributor
I'm gonna bump this too.. haven't run into this problem yet, but it would be good to know if there's a solution
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by rhaikh@Nov 18 2005, 05:26 PM i'm gonna bump this too.. haven't run into this problem yet, but it would be good to know if there's a solution<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11053)
--- quote end ---
--- Quote End --- Well, it's documented how to run the kernel from RAM (check out one of the uClinux docs), but I don't know how to make a filesystem from RAM yet...
- Altera_Forum
Honored Contributor
On a related note, is it possible to boot using NFS? As in if I can get the kernel into RAM, and I have no Flash/non-volatile storage, can I mount NFS as root and then boot that way?
- Altera_Forum
Honored Contributor
UPDATE : This post is out of date. Please follow the new one,
http://forum.niosforum.com/forum/index.php?showtopic=3174 (http://forum.niosforum.com/forum/index.php?showtopic=3174) I have build custom board. http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/laugh.gif You can use Initramfs. It is similar to initrd. It built the root file system into the kernel image. You can use onchip memory as a boot loader, to read and load vmlinux from SD. You can mount your SD later, eg, inittab. So you do not need MTD,romfs,nfs root, etc to mount your root. Just add a dummy CFI interface to your SYSPTF, it is only for hwselect. Delete the dummy CFI in your final hardware design. The CFI class name in hwselect.pl in arch/nios2nommu/scripts is not consistant with NIOS2 v5.0,v5.1. Change it to altera_avalon_cf. To use initramfs, enable it in menuconfig, Device Drivers -> Block Devices -> () Initramfs source files for newer kernel, it is moved General Setups -> Enter the root dir of your root fs, ie old initrd. Then setup the user id and group id map, with your user id. The old RAM disk support is not reqired. The kernel command line is not required, too. Be sure to add a sym link /init --> /sbin/init . The module file format generated by the kernel Makefile is not FLT format, so it can't load. --- Quote Start --- originally posted by jdhar@Nov 8 2005, 10:29 PM 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!
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10853)
--- quote end ---
--- Quote End ---
- Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by hippo@Nov 24 2005, 04:23 AM i have build custom board. http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/laugh.gifyou can use initramfs.
it is similar to initrd.
it built the root file system into the kernel image.
you can use onchip memory as a boot loader, to read and load vmlinux from sd.
you can mount your sd later, eg, inittab.
so you do not need mtd,romfs,nfs root, etc to mount your root.
just add a dummy cfi interface to your sysptf, it is only for hwselect.
delete the dummy cfi in your final hardware design.
the cfi class name in hwselect.pl in arch/nios2nommu/scripts is not consistant with nios2 v5.0,v5.1.
change it to altera_avalon_cf.
to use initramfs, enable it in menuconfig,
device drivers -> block devices -> () initramfs source files
for newer kernel, it is moved
general setups ->
enter the root dir of your root fs, ie old initrd.
then setup the user id and group id map, with your user id.
the old ram disk support is not reqired.
the kernel command line is not required, too.
be sure to add a sym link /init --> /sbin/init .
the module file format generated by the kernel makefile is not flt format, so it can't load.
--- quote start ---
originally posted by jdhar@nov 8 2005, 10:29 pm
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! <div align='right'><{post_snapback}> (index.php?act=findpost&pid=10853) --- Quote End --- [/b] --- Quote End --- <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11123)</div> [/b] --- Quote End --- Wow, thank you, it's good to know someone out there knows how to do this. Unfortunately, I didn't understand everything you said. First, i'm not worried about getting the kernel image into RAM; it's easy enough to write a bootloader that copies from MMC into RAM, so for now, I'm just downloading the kernel image directly to RAM for development. Second, I have a dummy CFI component in there and it works ok; well, as in I can get the kernel booting, but I can't mount yet (that's my problem!). Now, what you said about initrd - you said to use the initramfs() option.. but I don't understand how I'm supposed to enter "source files". Lets say I make another Nios filesystem project with just the essentials... for the initramfs() option, do I just point to the directory? (ie: "../uclinux_fs/" - for example). <div class='quotetop'>QUOTE </div> --- Quote Start --- The module file format generated by the kernel Makefile is not FLT format, so it can't load.[/b] --- Quote End --- I don't quite understand this, could you explain?
- Altera_Forum
Honored Contributor
Did you get the shell prompt? Like this?
Freeing unused kernel memory: 272k freed (0x138000 - 0x17b000) init started: BusyBox v1.00-pre8 (2005.10.28-01:02+0000) multi-call binary Please press Enter to activate this console. BusyBox v1.00-pre8 (2005.10.28-01:02+0000) Built-in shell (msh) Enter 'help' for a list of built-in commands. # The Linux need two parts to boot, the vmlinux and root fs. You already load the vmlinux and boot it. At the end of init process, it need the root fs, it can be on the CF (root=/dev/hda) , MTD, or initrd image on a ram drive. The root fs contain the /, /sbin,/bin,/usr /etc /proc /dev ... You can enter the full path for the initramfs build dir, eg (/usr/src/uclinux_fs) In the kernel build process, it will link the fs into vmilunx. CHK usr/initramfs_list UPD usr/initramfs_list CPIO usr/initramfs_data.cpio GZIP usr/initramfs_data.cpio.gz AS usr/initramfs_data.o LD usr/built-in.o GEN .version CHK include/linux/compile.h UPD include/linux/compile.h CC init/version.o LD init/built-in.o LD vmlinux SYSMAP System.map Building modules, stage 2. MODPOST Remeber, you must have /init for the user space init program. In most case, just ln -s /sbin/init /usr/src/uclinux_fs/sbin/init --- Quote Start --- originally posted by jdhar+nov 24 2005, 10:17 pm--><div class='quotetop'>quote (jdhar @ nov 24 2005, 10:17 pm)</div>--- quote start ---
<!--quotebegin-hippo@Nov 24 2005, 04:23 AM i have build custom board. http://forum.niosforum.com/work2/style_emoticons/<#emo_dir#>/laugh.gif
you can use initramfs.
it is similar to initrd.
it built the root file system into the kernel image.
you can use onchip memory as a boot loader, to read and load vmlinux from sd.
you can mount your sd later, eg, inittab.
so you do not need mtd,romfs,nfs root, etc to mount your root.
just add a dummy cfi interface to your sysptf, it is only for hwselect.
delete the dummy cfi in your final hardware design.
the cfi class name in hwselect.pl in arch/nios2nommu/scripts is not consistant with nios2 v5.0,v5.1.
change it to altera_avalon_cf.
to use initramfs, enable it in menuconfig,
device drivers -> block devices -> () initramfs source files
for newer kernel, it is moved
general setups ->
enter the root dir of your root fs, ie old initrd.
then setup the user id and group id map, with your user id.
the old ram disk support is not reqired.
the kernel command line is not required, too.
be sure to add a sym link /init --> /sbin/init .
the module file format generated by the kernel makefile is not flt format, so it can't load.
--- quote start ---
originally posted by jdhar@nov 8 2005, 10:29 pm
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! <div align='right'><{post_snapback}> (index.php?act=findpost&pid=10853) --- Quote End --- [/b] --- Quote End --- <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11123)</div> [/b] --- Quote End --- Wow, thank you, it's good to know someone out there knows how to do this. Unfortunately, I didn't understand everything you said. First, i'm not worried about getting the kernel image into RAM; it's easy enough to write a bootloader that copies from MMC into RAM, so for now, I'm just downloading the kernel image directly to RAM for development. Second, I have a dummy CFI component in there and it works ok; well, as in I can get the kernel booting, but I can't mount yet (that's my problem!). Now, what you said about initrd - you said to use the initramfs() option.. but I don't understand how I'm supposed to enter "source files". Lets say I make another Nios filesystem project with just the essentials... for the initramfs() option, do I just point to the directory? (ie: "../uclinux_fs/" - for example). <div class='quotetop'>QUOTE </div> --- Quote Start --- The module file format generated by the kernel Makefile is not FLT format, so it can't load.[/b] --- Quote End --- I don't quite understand this, could you explain? <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11136)</div> [/b] --- Quote End --- Sorry I was wrong about module. Please just drop it.
- Altera_Forum
Honored Contributor
Thank you so much for your help, I will try this and let you know!
- Altera_Forum
Honored Contributor
Sorry, the sym link should be, ln -s /sbin/init /usr/src/uclinux_fs/init
The /sbin/init program, linked to busybox, will read /etc/inittab, which is ,eg # Startup the system null::sysinit:/bin/mount -t proc proc /proc null::sysinit:/bin/mount -t sysfs sysfs /sys null::sysinit:/bin/mount -t usbfs none /proc/bus/usb # Set up a couple of getty's ::askfirst:/bin/sh You can remove files in /usr/include and /usr/lib to save space. When we design custom board, most drivers are under construction. The Initramfs need only ram, and a serial/jtag console driver is all that needed to start. When you have tested your custom mmc driver, you may disable Initramfs, and use the MMC/SD as root device, with the kernel command line "root=/dev/mmc0". You will need devfs to use mmc block device. - Altera_Forum
Honored Contributor
--- Quote Start --- originally posted by hippo@Nov 24 2005, 07:43 PM sorry, the sym link should be, ln -s /sbin/init /usr/src/uclinux_fs/initthe /sbin/init program, linked to busybox, will read /etc/inittab, which is ,eg
# startup the system
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -t sysfs sysfs /sys
null::sysinit:/bin/mount -t usbfs none /proc/bus/usb
# set up a couple of getty's
::askfirst:/bin/sh
you can remove files in /usr/include and /usr/lib to save space.
when we design custom board, most drivers are under construction.
the initramfs need only ram, and a serial/jtag console driver is all that needed to start.
when you have tested your custom mmc driver, you may disable initramfs, and use
the mmc/sd as root device, with the kernel command line "root=/dev/mmc0".
you will need devfs to use mmc block device.
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11146)
--- quote end ---
--- Quote End --- So I tried, and it didn't work: this is what I got... <div class='quotetop'>QUOTE </div> --- Quote Start --- uClinux/Nios II Altera Nios II support KERNEL -> TEXT=0x01000000-0x01162af0 DATA=0x01162af0-0x0118c000 BSS=0x012ebbd0-0 x012ebc04 KERNEL -> MEM=0x12ec000-0x2000000 STACK=0x2000000-0x2000000 No Command line passed Setting custom MAC address Setup the hardware addr for ethernet 00 10 20 30 40 50 Done setup_arch 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: 13200k/16384k RAM, 0k/0k ROM (1418k kernel code, 1572k data) Mount-cache hash table entries: 512 (order: 0, 4096 bytes) Kernel panic - not syncing: broken padding[/b] --- Quote End --- I removed the startup command line in the kernel (ie: the root=/dev/mtdblock0), and I pointed Initramfs() source files to the path "/cygdrive/d/hw/ep1c_lwip/software/uclinux_ep1c12_fs/target" . I made a filesytem project in that directory with all the options installed. There is nothing in sbin, only bin.. and they are all exe's. So in the directory ./target, I did "ln -s bin/init.exe ./init.exe" Any idea what I did wrong?