将 ROMFS 附加到 RAM 中意味着什么?
我正在为运行 uClinux 2.4 的 ARM 平台构建内核,并且在 Linux 配置中的“常规设置”下有一个名为“RAM 支持中的 m68knommu-style Attached romfs”的选项”。我的 ARM 汇编技能有些有限,但据我所知,如果我启用此选项,ROMFS 会复制到内核 BSS 的末尾。
这样做的目的是什么?
I'm building a kernel for an ARM platform running uClinux 2.4 and under "General Setup" in the Linux configuration there is an option called "m68knommu-style attached romfs in RAM support". My ARM assembly skills are somewhat limited but as far as I can tell if I enable this option the ROMFS is copied to the end of the kernels BSS.
What is the purpose of this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您所指出的,此选项会导致附加到内核映像的 romfs 重新定位到 .bss 部分的末尾。这允许系统从 romfs 作为其根文件系统启动。
As you rightly indicate, this option causes the romfs attached to the kernel image to be relocated to the end of the .bss section. This allows the system to start from the romfs as its root filesystem.
上面的说法并不完全正确;我相信我确实开发了这个更改,如果没有的话我肯定使用了它。如前所述,此功能提供对连接到内核映像的 romfs 文件系统的支持——两者都放置在 RAM 中。然后,此选项确保 romfs 文件系统将自动评估其大小并移动到 RAM 的保留区域(以及通过 MTD RAM 驱动程序传递用于安装的适当指针)。
如果不进行此更改,仍然可能会耗尽 RAM;您只需要让引导加载程序将其放置在预定位置并传入适当的内核选项即可。此更改添加的重要功能是能够像 Coldfire 构建那样拥有单一、统一的内核+文件系统映像。
请注意,只有在您的 head-platform.S 中进行适当的更改时,它才有效。我记得 - 我认为它可能只适用于 NetSilicon NS7520。
The above isn't exactly correct; I believe I actually developed the change, if not I definitely used it. As noted, this feature offers support for a romfs filesystem concatenated to the kernel image -- both of which are placed in RAM. Then this option ensures the romfs filesystem will automatically have its size evaluated and be moved to a reserved area of RAM (as well as the appropriate pointers passed for mounting via the MTD RAM driver).
Without this change it is still possible to run out of RAM; you merely needed to have your bootloader place it in a predetermined location and pass in the appropriate kernel options. The big feature this change added was the ability to have a single, unified kernel+filesystem image the way the Coldfire builds did.
Note that it only worked if you have the appropriate changes in your head-platform.S, as I recall -- I think it may only be in place on the NetSilicon NS7520.