通过 tftp 启动内核和 Rootfs

Kernel and Rootfs booting through tftp

任务:加载内核和rootfs镜像并执行到ram中而不存储到spi flash

我加载了可刷新映像(zimage 位于 0x200000)和可刷新 rootfs(jffs2 位于 0x200000+offset)

tftp zimage 0x200000 tftp jffs2 0x200000+offset bootm 0x200000 0x200000+offset

给我这个错误:

Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "ram0" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00        256 mtdblock0 (driver?)
1f01        256 mtdblock1 (driver?)
1f02       2048 mtdblock2 (driver?)
1f03      13824 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)

有时: 错误的幻数

任何帮助将不胜感激

根据您在评论中提供的 bootargs 使用

root=/dev/ram0 rootfstype=jffs2 rw initrd=0x200000+offset,16M console=ttyMCS mem=64M@0x0

这里XM是initrd的大小,如果是8MB就给8M

你没有在引导命令中提供 initrd 的偏移量,因为内核找不到 ramdisk 映像并给出 not syncing: VFS:。只需像上面那样添加 initrd=0x200000+offset,16M

@sawdust,你是对的。 jffs2 不能像 initrd 或 initramfs 一样在 RAM 中使用。

我成功地将两个图像加载到 ram 上并基于 EXT2 文件系统在 ram 上执行。

引导程序:setenv bootargs root=/dev/ram0 console=ttyMCS mem=64M@0x0 init=/bin/sh