简体   繁体   English

磁盘上的嵌入式Linux根文件系统

[英]embedded linux root filesystem on disk

I would like to know how to create a root file system for an embedded Linux system that is stored on a hard drive. 我想知道如何为存储在硬盘上的嵌入式Linux系统创建根文件系统。 Would this be the same procedure if it was on a flash card? 如果它在闪存卡上,会是同样的过程吗?

No, your boot loader would need to know how to initialize the hard drive. 不,您的引导加载程序将需要知道如何初始化硬盘驱动器。 With flash cards the boot loader initializes as an MTD and can understand the file system. 使用闪存卡,引导加载程序将初始化为MTD,并且可以理解文件系统。

You might be able to make progress with an IDE HD and IDE support in the boot loader. 您可能能够在引导加载程序中使用IDE HD和IDE支持取得进展。

On a regular computer (eg, PC) the BIOS takes care of initializing all peripherals, like a primary HD. 在常规计算机(例如PC)上,BIOS负责初始化所有外围设备,例如主HD。

Typically Linux embedded system is not operate directly in disk based filesystem, but use a mechanism to load the OS from a persistent storage (hard drive, flash card or memory, etc.) to volatile memory space (RAM). 通常,Linux嵌入式系统不是直接在基于磁盘的文件系统中运行,而是使用一种机制将OS从持久性存储(硬盘,闪存卡或内存等)加载到易失性存储空间(RAM)。 In general, these OS's file (commonly called as firmware) are kernel image file and a initrd (Initial RAM Disk) file, the initrd file contains root filesystem's files and any system's related files, upon boot the initrd will be uncompressed and deployed into a RAM based filesystem such as tmpfs , once completed, the system will use the tmpfs filesystem just like any disk based filesystem (ext3, btrfs), for example to run init program or script to do system initialization. 通常,这些操作系统的文件(通常称为固件)是内核映像文件和initrd (初始RAM磁盘)文件,initrd文件包含根文件系统的文件以及任何与系统相关的文件,在启动时,initrd将被解压缩并部署到基于RAM的文件系统(例如tmpfs )一旦完成,系统将像使用任何基于磁盘的文件系统(ext3,btrfs)一样使用tmpfs文件系统,例如运行init程序或脚本来进行系统初始化。 Embedded system is tend to minimize I/O on persistent storage for some advantages: reliability, speed and cost. 嵌入式系统倾向于将持久性存储上的I / O最小化,以实现一些优势:可靠性,速度和成本。

You can learn how to accomplish this by learning any general Linux distribution on how to create and modify a initrd file. 您可以通过学习有关如何创建和修改initrd文件的任何常规Linux发行版来学习如何实现此目的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM