- 论坛徽章:
- 0
|
原文有2段是这样阐述的:
When the kernel boots, first it detects the presence of the initrd image. Then it copies the compressed binary file from the specified physical location in RAM into a proper kernel ramdisk and mounts it as the root file system。
当内核启动的时候,它首先会检测initrd映像的存在,然后它将这个压缩的二进制文件从RAM里的特定位置拷贝到内核里一个合适的内存磁盘里,并且将它挂载为根文件系统。
the kernel decompresses the compressed initrd image from physical memory and eventually copies the contents of this file into a ramdisk device (/dev/ram). At this point, we have a proper file system on a kernel ramdisk. After the file system has been read into the ramdisk, the kernel effectively mounts this ramdisk device as its root file system. Finally, the kernel spawns a kernel thread to execute the linuxrc file on the initrd image。
内核将压缩的initrd映像从物理内存里解压缩,并且将这个文件的内容全部拷贝进一个ramdisk的设备(/dev/ram)。在这个时候,我们在内核的ramdisk上就有了一个合适的文件系统。当文件系统被读进ramdisk之后,内核有效地将这个ramdisk挂载为它的根文件系统。最后,内核会执行一个内核线程来执行initrd映像里的linuxrc文件。
我就纳闷了,尤其是第二段话,明明这个时候还没有将ramdisk挂载为根的时候,这个/dev/ram究竟是个神马东东?从哪儿冒出来的?连根文件系统都还没有,还怎么挂载呢?
最后一段红字,明明是将/dev/ram挂载为根文件系统之后,再去执行的linuxrc(也就是加载各种驱动)。实际上,加载驱动本身也是在用户空间才能进行的,没有根文件系统的话,也没法执行insmod吧。 |
|