linux内核启动后,会对根文件系统进行加载,但是内核是在哪里对根文件进行加载的?
List of all partitions:
1f00 256 mtdblock0 (driver?)
1f01 64 mtdblock1 (driver?)
1f02 6272 mtdblock2 (driver?)
1f03 1408 mtdblock3 (driver?)
1f04 64 mtdblock4 (driver?)
1f05 64 mtdblock5 (driver?)
1f06 64 mtdblock6 (driver?)
No filesystem could mount root, tried: squashfs
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,2)
上面是串口打印的信息,我对No filesystem could mount root, tried:,这句话进行查找,定位到了mips-linux-2.6.31\init\Do_mounts.c_这个文件中
printk("List of all partitions:\n");
printk_all_partitions();
printk("No filesystem could mount root, tried: ");
for (p = fs_names; *p; p += strlen(p)+1)
printk(" %s", p);
printk("\n");
之后我就看不懂这些了,根文件系统是在哪里加载进来的???
而且我在Uboot下,进行烧写时,是将根文件系统写到0x9f050000这个位置,但是在内核里面是如何指定的??
linux内核本质上是会挂载很大文件系统的。简单的如ext3、ramfs等。无论什么文件系统都是基于vfs的形式存在的。至于带init进程的根root文件系统,其实就是把你boot时指定的分区在start_kernel时mount到/这个目录下,/目录本质在内核里其实是个inode/dentry。
uboot在跳转到内核的时候会给内核传递参数, 那里面就有吧