固化固化RAMDISK到NAND FLASH中: "upsafefs=" "tftp 30008000 safefs.img;" \ "nand erase clean 00400000 $filesize;" \ "nand write.jffs2 30008000 00400000 $filesize\0" \ 其实不用固化RANDISK到NAND中,直接从U盘加载即可。 加载从NAND FLASH加载RAMDISK: 到RAM中,地址为0x31800000,大小16M nand read.jffs2 31800000 00400000 1000000 从U盘加载RAMDISK: usb start setenv dev 0:1 fatload usb $dev 0x31800000 ramdisk.img 或者 fatload usb 0:1 0x31800000 ramdisk.img 参数U-Boot启动参数: setenv bootargs "root=/dev/ram rw initrd=0x31800000,16M console=tty0 console=ttySAC0,115200" 进入安全模式首先输入命令,进行启动参数设置 : U-Boot$ setenv bootargs "root=/dev/ram rw initrd=0x31800000,16M console=ttySAC0,115200" 然后输入加载ramdisk和加载内核并启动的命令: U-Boot$ run loadramdisk;run yboot 奇怪的是,如果将设置参数的命令和加载RAM盘以及内核的命令合成一条命令,会出现错误(红色标志) Starting kernel ... Uncompressing Linux................................................................................................................................. done, booting the kernel. Linux version 2.6.28 (root@localhost.localdomain) (gcc version 3.4.1) #117 Wed Mar 11 13:02:33 CST 2009 CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177 CPU: VIVT data cache, VIVT instruction cache Machine: ABING2440 Memory policy: ECC disabled, Data cache writeback INITRD: 0x31800000+0x04000000 extends beyond physical memory - disabling initrd CPU S3C2440A (id 0x32440001) ...... yaffs: dev is 1048576 name is "ram0" yaffs: passed flags "" yaffs: Attempting MTD mount on 1.0, "ram0" yaffs: dev is 1048576 name is "ram0" yaffs: passed flags "" yaffs: Attempting MTD mount on 1.0, "ram0" List of all partitions: 1f00 32768 mtdblock0 (driver?) 1f01 225280 mtdblock1 (driver?) No filesystem could mount root, tried: ext2 vfat msdos iso9660 yaffs yaffs2 Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(1,0) 出错信息是从文件arch/arm/mm/init.c里面打印出来的,从错误信息来看,应该是phys_initrd_size的值传递错了,传递为实际RAM的大小了,本应该是radisk的大小的。 文件:arch/arm/mm/init.c static int __init check_initrd(struct meminfo *mi) { int initrd_node = -2; #ifdef CONFIG_BLK_DEV_INITRD unsigned long end = phys_initrd_start + phys_initrd_size; /* * Make sure that the initrd is within a valid area of * memory. */ if (phys_initrd_size) { unsigned int i; initrd_node = -1; for (i = 0; i < mi->nr_banks; i++) { struct membank *bank = &mi->bank[i]; if (bank_phys_start(bank) <= phys_initrd_start && end <= bank_phys_end(bank)) initrd_node = bank->node; } } if (initrd_node == -1) { printk(KERN_ERR "INITRD: 0x%08lx+0x%08lx extends beyond " "physical memory - disabling initrd\n", phys_initrd_start, phys_initrd_size); phys_initrd_start = phys_initrd_size = 0; } #endif return initrd_node; } 最后发现是默认命令的RAMDISK大小写错了,应该是16M的,却写成了64M。 |