Root file system in Embedded Linux-rootfs

Source: Internet
Author: User
The root file system of Embedded Linux-rootfs-general Linux technology-Linux programming and kernel information. The following is a detailed description. Flash, the main storage medium in embedded systems, is a rare resource, and a few RAM resources are also used. In the development of embedded systems, developers cherish these two types of resources and have come up with many solutions to the shortage of resources.

In Linux, rootfs is essential. Ramdisk and direct mounting of the root file system on HD (hard disk) are mainly implemented on the PC. in embedded systems, it is generally started from Flash instead of HD, the simplest method is to load rootfs to RAM's RAMDisk. The more complex method is to directly read Cramfs from Flash, and more complicated is to partition on Flash and build file systems such as JFFS2.

RAMDisk compresses the created rootfs and writes it to Flash. during startup, the Bootloader loads it to RAM, decompress it, And then mounts it /. This method is simple, but the file system in RAM is not compressed, so it needs to occupy a lot of rare resources in embedded systems RAM.

Initrd is the RAMDisk format. Before kernel 2.4 was image-initrd, Kernel 2.5 introduced cpio-initrd, which greatly simplified the Linux Startup Process and included the basic philosophy of Linux: Keep itsimple, stupid (KISS ). however, cpio-initrd, as a new format, has not been extensively tested. image-initrd is mainly used in embedded Linux.

Cramfs is a simple file system written by Linus. It has a good compression ratio and can be run directly from Flash without being loaded into RAM, thus saving RAM. However, Cramfs is read-only and inconvenient for directories (such as/etc,/var,/tmp) that need to be modified during runtime. Therefore, these directories are generally made into writable fs such as ramfs.

SquashFS is an enhancement to Cramfs. It breaks through some Cramfs restrictions and also has advantages in Flash and RAM usage. However, according to developers, the performance may be inferior to that of Cramfs. This is also a new method. More tests are required before embedded systems are used.

XIP (exece-in-place) is a technology that can run without the need to load the application to RAM, which can undoubtedly reduce the use of RAM. However, I have not used this technology in embedded systems.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.