[U-Boot-Users] mkimage parameters for cramfs.img

Hi, u-boot users,
I use uClinux with cramfs filesystem. The uClinux works when zImage is put at 0x8000 and cramfs.img is put at 0x02000000.
For uClinux kernel, I create linux.bin.gz and make uImage by mkimage. mkimage -A arm -O linux -T kernel -C gzip -a 0x8000 -e 0x8000 -n "uClinux 2.6.5 Kernel Image" -d linux.bin.gz uImage Image Name: uClinux 2.6.5 Kernel Image Created: Fri May 6 12:30:15 2005 Image Type: ARM Linux Kernel Image (gzip compressed) Data Size: 547132 Bytes = 534.31 kB = 0.52 MB Load Address: 0x00008000 Entry Point: 0x00008000
uClinux filesystem is encapsulated with mkimage. mkimage -A arm -O linux -T ramdisk -C none -n "Cramfs Image" -a 0x02000000 -d cramfs.img ucramfs Image Name: Cramfs Image Created: Fri May 6 12:31:51 2005 Image Type: ARM Linux RAMDisk Image (uncompressed) Data Size: 655360 Bytes = 640.00 kB = 0.62 MB Load Address: 0x02000000 Entry Point: 0x02000000
I copy uImage and ucramfs to 0x00400000 and 0x00500000. After bootm 0x00400000 and 0x00500000, the uClinux kernel is launched. However, the uClinux kernel cannot find the filesystem to mount.
The message is as follows, RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize loop: loaded (max 8 devices) NET: Registered protocol family 2 IP: routing cache hash table of 512 buckets, 4Kbytes TCP: Hash tables configured (established 4096 bind 4096) NET: Registered protocol family 1 NET: Registered protocol family 17 RAMDISK: Couldn't find valid RAM disk image starting at 0. Kernel panic: VFS: Unable to mount root fs on ram0
What is the correct mkimage parameters for cramfs.img ?
Thanks. Wayne

In message 200505060449.j464nU8R011009@ismp.csie.ncku.edu.tw you wrote:
mkimage -A arm -O linux -T ramdisk -C none -n "Cramfs Image" -a 0x02000000 -d cramfs.img ucramfs Image Name: Cramfs Image Created: Fri May 6 12:31:51 2005 Image Type: ARM Linux RAMDisk Image (uncompressed)
^^^^^^^^
This makes no sense. A cramfs image should go directly to flash, and be accessed through the Linux kernel's MTD layer. Treating it as a ramdisk is not a good idea.
However, the uClinux kernel cannot find the filesystem to mount.
Don't do this, then.
What is the correct mkimage parameters for cramfs.img ?
There is none. Only "initial ramdisks" are wrapped by mkimage; all other filesystem images go directly to flash. Use MTD to access these.
Best regards,
Wolfgang Denk

Yes, WD,
After u-boot places the cramfs image to the expected location without wrapped by mkimage, the filesystem is mounted. (My uClinux port does not use MTD driver. Instead, it uses ramdisk driver to load cramfs image to ram. Hence, I now use u-boot cp command to copy cramfs image from flash to ram directly.) Originally, I hope to use mkimage to add header to cramfs image to gain crc32 check protection. Whatever, it is good to have one solution at least.
Thanks. Wayne
-----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Friday, May 06, 2005 3:43 PM To: Wayne Lee Cc: 'u-boot-users' Subject: Re: [U-Boot-Users] mkimage parameters for cramfs.img
In message 200505060449.j464nU8R011009@ismp.csie.ncku.edu.tw you wrote:
mkimage -A arm -O linux -T ramdisk -C none -n "Cramfs Image" -a 0x02000000 -d cramfs.img ucramfs Image Name: Cramfs Image Created: Fri May 6 12:31:51 2005 Image Type: ARM Linux RAMDisk Image (uncompressed)
^^^^^^^^
This makes no sense. A cramfs image should go directly to flash, and be accessed through the Linux kernel's MTD layer. Treating it as a ramdisk is not a good idea.
However, the uClinux kernel cannot find the filesystem to mount.
Don't do this, then.
What is the correct mkimage parameters for cramfs.img ?
There is none. Only "initial ramdisks" are wrapped by mkimage; all other filesystem images go directly to flash. Use MTD to access these.
Best regards,
Wolfgang Denk

In message 200505060859.j468wv8R013906@ismp.csie.ncku.edu.tw you wrote:
After u-boot places the cramfs image to the expected location without wrapped by mkimage, the filesystem is mounted.
Then you know now that you have been passing bad addresses.
(My uClinux port does not use MTD driver. Instead, it uses ramdisk driver to load cramfs image to ram. Hence, I now use u-boot cp command to copy cramfs image from flash to ram directly.)
Did you compare the memory consumption of this solution against using a standard ramdisk? IMHO cramfs makes only sense when used in a MTD flash partition (so that you only load the needed components to RAM); when you load the whole image anyway your're usually more efficient with a plain ramdisk.
Originally, I hope to use mkimage to add header to cramfs image to gain crc32 check protection.
You can do that, with a ramdisk image. Seems that in your case the address passed to the Linux kernel was wrong, though.
Best regards,
Wolfgang Denk

For uClinux, there is a precious introduction written by David McCullough. (http://www.linuxjournal.com/article/7221) This article mentioned that the guaranteed (root) filesystem format subject to uClinux constraints is romfs.
Of course, the romfs can be programmed into flash and be mounted by Linux kernel MTD driver. On the other hand, romfs can be mounted in ramdisk way.
For the memory consumption comparison issue, your conclusion is right. We also can find the explanation in section 8.1.2 of "Building Embedded Linux Systems".
Thanks. Wayne
-----Original Message----- From: u-boot-users-admin@lists.sourceforge.net [mailto:u-boot-users-admin@lists.sourceforge.net] On Behalf Of Wolfgang Denk Sent: Friday, May 06, 2005 5:59 PM To: Wayne Lee Cc: 'u-boot-users' Subject: Re: [U-Boot-Users] mkimage parameters for cramfs.img
In message 200505060859.j468wv8R013906@ismp.csie.ncku.edu.tw you wrote:
After u-boot places the cramfs image to the expected location without wrapped by mkimage, the filesystem is mounted.
Then you know now that you have been passing bad addresses.
(My uClinux port does not use MTD driver. Instead, it uses ramdisk driver
to
load cramfs image to ram. Hence, I now use u-boot cp command to copy
cramfs
image from flash to ram directly.)
Did you compare the memory consumption of this solution against using a standard ramdisk? IMHO cramfs makes only sense when used in a MTD flash partition (so that you only load the needed components to RAM); when you load the whole image anyway your're usually more efficient with a plain ramdisk.
Originally, I hope to use mkimage to add header to cramfs image to gain crc32 check protection.
You can do that, with a ramdisk image. Seems that in your case the address passed to the Linux kernel was wrong, though.
Best regards,
Wolfgang Denk
participants (2)
-
Wayne Lee
-
Wolfgang Denk