How to partition the embedded system? This method saves time and effort

The partitioning scheme of the embedded system is very important, which determines the stability, security and flexibility of the system to some extent. This article talks about the mainstream partitioning scheme for embedded systems.

One of the simplest and most straightforward partitioning schemes is usually composed of u-boot, env environment variables, kernel, and rootfs. The layout is as follows:

640?wx_fmt=png&wxfrom=5&wx_lazy=1

The shortcomings of this kind of scheme are very obvious. It is not easy to implement the online upgrade of the system. For the online upgrade of the system, we should reserve the upgrade partition.

640?wx_fmt=png&wxfrom=5&wx_lazy=1

In this partitioning scheme, Kernel and Rootfs are respectively configured for A and B partitions, and the Kernel and Rootfs can be upgraded online, which is more flexible and flexible than the first scheme.

Of course, on this basis, we can also perform more detailed re-partitioning of Rootfs, such as separately planning system applications and data partitioning. In terms of security and stability, the system application partition can be formatted as a read-only file system. Type, format the data partition as a readable and writable file system type. For emmc type storage devices, the file system type is the same as that of our PC. There is no difference. However, flash storage devices are much more complicated. In the introduction of the flash memory and file system, we know that the file system of the flash storage device is built on top of the MTD, so the underlying partition of the flash is an MTD partition. We also know that the current mainstream file system for flash storage devices (especially larger than 128MB) is UBIFS, UBIFS and UBI always appear in pairs, because UBIFS is built on UBI, and UBI is built on MTD. Above.

640?wx_fmt=png&wxfrom=5&wx_lazy=1

The main function of UBI is wear leveling, so the UBIFS file system is different from the JFFS2 file system in that it implements layering of wear leveling and file system. Note that UBI is wear leveling for the entire storage space rather than a single partition, which greatly increases the life of the flash. The following figure is a good illustration of UBI's wear leveling function. We can see the wear of Volume 1 and Volume 2. The leveling range is the entire MTD.

640?wx_fmt=png&wxfrom=5&wx_lazy=1

In addition, UBI can also implement LVM-like volume management functions - Volume Management, which can create multiple logical partitions on top of the MTD partition. For a single volume, you can dynamically adjust the volume size, or you can choose to set it as a static volume (read only). . It should be noted here that U-Boot and env cannot be placed in the UBI Volume logical partition and need to be placed directly on the MTD partition. Usually Kernel is also placed directly on the MTD partition.

640?wx_fmt=png&wxfrom=5&wx_lazy=1

Of course, we can also reserve the upgrade partition as before. In addition, we can build different file systems on different MTD partitions of a flash. For example, UBIFS and CRAMFS, JFFS2, etc. can coexist on one flash to make full use of different file systems. The combined advantage of the type.

summary

The partitioning scheme of the embedded system usually considers the reserved upgrade partition. The file system type of emmc is the same as that of the hard disk of the PC, and the operation is similar. For the flash storage device, the mainstream is the partitioning scheme of UBIFS and UBI.

Relay Control Voltage Regulator

PC-TM series Relay Control Voltage Stabilizer has the low energy consumption,the over voltage protection,the low voltage protection,the over-current protection,the over-loading protection,the over-temperature protection and so on.It boasts for many kinds of protections,the collection energy conservation and the environmental protection ect.This is a brand-new concept product which possess many new technologies!This series products simultaneously ha applied for many technical monopolies

We already applied many kinds of this products patent, and the technical patent NO: 200720036394.1 and Appearance paten NO: 200730025909.3

2. Use for equipment:

Computer

Test equipment

Light system

Safe alarm system

Ray equipment

Medical equipment

Copy machine

Stereo equipment

Numerical control machine tools

Industrial automation equipment

Color and drying equipment

Test equipment

Hi-Fi equipment

PCTM

Relay Control Voltage Regulator ,Voltage Regulator For Ac,3000Va Voltage Regulator,Wall Mount Voltage Stabilzier

zhejiang ttn electric co.,ltd , https://www.ttnpower.com

This entry was posted in on