近来调试 s3c6410, 使用SD/TF卡启动。

已有 rootfs.cramfs  
mount -t cramfs -o loop rootfs.cramfs /mnt

制作cramfs
mkfs.cramfs [-h] [-v] [-b blksize] [-e edition] [-N endian] [-i file] [-n name] dirname outfile
 -h         print this help
 -v         be verbose
 -E         make all warnings errors (non-zero exit status)
 -b blksize use this blocksize, must equal page size
 -e edition set edition number (part of fsid)
 -N endian  set cramfs endianness (big|little|host), default host
 -i file    insert a file image into the filesystem (requires >= 2.4.0)
 -n name    set name of cramfs filesystem
 -p         pad by 512 bytes for boot code
 -s         sort directory entries (old option, ignored)
 -z         make explicit holes (requires >= 2.3.39)
 dirname    root of the filesystem to be compressed
 outfile    output file

usage: mkcramfs [-h] [-b blksize] [-e edition] [-i file] [-n name] dirname outfile
 -h         print this help
 -E         make all warnings errors (non-zero exit status)
 -b blksize blocksize to use
 -e edition set edition number (part of fsid)
 -i file    insert a file image into the filesystem (requires >= 2.4.0)
 -n name    set name of cramfs filesystem
 -p         pad by 512 bytes for boot code
 -s         sort directory entries (old option, ignored)
 -v         be more verbose
 -z         make explicit holes (requires >= 2.3.39)
 dirname    root of the directory tree to be compressed
 outfile    output file

当bootloader中, 把 kernel / rootfs 从 TF 卡读到 RAM 中后,直接引导内核即可。
"movi read kernel c0008000;movi read rootfs c0800000;bootm c0008000"

内核于rootfs.cramfs 的映射关系可以通过 arch/arm/mach-xxx/Makefile.boot中的initrd_phys-y    := 0xc0800000 参数指定,

或者通过引导命令行
【CONFIG_CMDLINE="mem=32M console=ttySA0,38400n8 initrd=0xc0800000,3M root=/dev/ram"】


#define CONFIG_BOOTARGS_MOVI "root=/dev/ram0 rw initrd=0x50800000,8M console=ttySAC0,115200"
#define CONFIG_BOOTARGS_NAND "root=/dev/sftl2 rootfstype=cramfs console=ttySAC0,115200"



【CONFIG_CMDLINE="console=ttySA0,38400n8 cpufreq=221200 rwroot=/dev/mtdblock2mtdparts=sa1100:512K(boot),1M(kernel),2560K(initrd),4M(root)load_ramdisk=1 prompt_ramdisk=0 mem=32M noinitrd initrd=0xc0800000,3M"】
10-25 14:47
查看更多