I'm working with a Nios II design with an MMU, on a Nios II Development Kit, Cyclone II Edition board (EP2C35).
I'm trying to figure out how to get to a system that boots with some sort of root filesystem stored in flash.
With help from hippo's wiki page (
http://www.nioswiki.com/linux) (
http://www.nioswiki.com/linux%29), I can now:
- Build a kernel
- Download it with nios2-download
- Connect with nios2-terminal
- Get a Linux Command Prompt
I have also ported U-Boot (starting from the U-Boot code included in the nios-linux tarball from the above-mentioned wiki page). I can burn a kernel to flash, and have U-Boot boot that kernel. I can TFTP a vmImage file, and boot from that (though the system hangs due to lack of a root filesystem).
The "bootargs" variable isn't passed from U-Boot to the Linux Kernel. To work around this, I compile the kernel command line arguments into the kernel (CONFIG_COMMANDLINE).
By compiling in the kernel command-line arguments, I can boot with root=/dev/nfs. After adding a few devices to uClinux-Dist/romfs/dev, I was able to get a command prompt.
Now, I want to boot without using NFS.
Here are the files in my uClinux-dist/images directory:
-rwxrwxr-x 1 pinta pinta 4442546 2009-09-28 15:21 linux.initramfs.gz
-rw-rw-r-- 1 pinta pinta 2478080 2009-09-28 15:20 rootfs.initramfs
-rw-rw-r-- 1 pinta pinta 15997 2009-09-28 15:20 rootfs.initramfs.contents
-rw-rw-r-- 1 pinta pinta 1059759 2009-09-28 15:20 rootfs.initramfs.gz
-rw-r--r-- 1 pinta pinta 579226 2009-09-28 15:21 System.map.initramfs.gz
-rw-r--r-- 1 pinta pinta 1221552 2009-09-28 15:20 vmImage
-rwxrwxr-x 1 pinta pinta 3383298 2009-09-28 15:20 vmlinux
-rwxrwxr-x 1 pinta pinta 2296861 2009-09-28 15:21 zImage.initramfs.gz
linux.initramfs.gz is the file I download with nios2-download.
vmImage is the file I use to boot Linux from U-Boot.
According to the nioswiki Linux page, rootfs.initramfs.gz is compressed initramfs to be used as initrd by u-boot.
How do I use rootfs.initramfs.gz? Specifically:
1) How do I pass it to U-Boot?
2) What (if any) kernel command-line arguments should I compile into the Linux Kernel?
Pinta