Design of an Embedded File System Based on NOR Flash Memory
2026-04-06 07:40:02··#1
Introduction In portable electronic devices, with increasing system complexity and expanding storage capacity, embedded file systems have become an inevitable trend. Flash memory, due to its advantages such as large storage capacity, data retention even when power is off, small size, and rewritable capability, is gradually replacing other semiconductor storage devices and is widely used in portable electronic products. Using a file system in Flash memory allows the storage space to be treated as an intuitive namespace, eliminating the need to use the memory from scratch in each application development, and facilitating communication with the host system using standard interfaces. In this article, we will discuss the implementation of a file system in an embedded handheld mobile terminal, using the WINCE embedded operating system as an example. WINCE File System Structure The WINCE file system adopts a modular design, allowing for custom file systems, filters, and various block device types. The file system and all file-related APIs are managed through the FileSys.exe process. FileSys.exe consists of the following components: · ROM File System · Storage Manager · Object Storage The ROM file system is a ROM-based file system. It is used to store system information. The Storage Manager is responsible for managing the storage devices in the system and the file systems used to access them. The storage manager functionality is implemented by the fsdmgr.dll module in the system. Its main components are the block device driver manager, partition manager, and file system driver manager. The relationship between the storage manager components is shown in Figure 1. Object storage is a memory heap controlled by FileSys.exe. Object storage includes the RAM system registry, RAM file system, and attribute database. These are all optional components of the FileSys.exe module. The RAM file system and attribute database are completely optional and may not exist at all in some systems. The relationship between the components of FileSys.exe is shown in Figure 2. When the operating system starts, NK.exe loads FileSys.exe directly from the ROM file system. Then, FileSys.exe initializes the default registry within the ROM file system. Next, FileSys.exe reads registry entries to launch various applications. We build a self-file system based on the WINCE file structure. The hardware structure of the embedded handheld device based on the PXA272 memory is shown in Figure 3. It mainly consists of an embedded microcontroller PXA272, a data acquisition unit, a display unit, a storage unit, a communication module, and a power supply unit. The Intel PXA272 processor is a 32-bit, high-performance embedded chip based on the Xscale architecture, launched by Intel. It operates at 512MHz and integrates 64Mb of NOR Flash. We build our own file system on the NOR Flash based on the WinCE file structure. The Flash is divided into three parts: the first part stores EBOOT and a 512K configuration file; the second part stores a 32M NK.BIN file; and the last part is a 32M file system, as shown in Figure 4. PSM (Persistent Storage Manager) is a proprietary Intel technology specifically designed for WinCE systems. It provides a unified device interface for various Flash storage devices and supports Intel's CPU architecture. We use PSM as the storage manager and Microsoft-provided Flash drivers to build the file system, supporting FAT format files. Its system architecture is shown in Figure 5. Finally, the file system configuration file is a set of registry values used to define information about the block device and how it should be used in the system. The configuration files are located under the registry key HKEY_LOCAL_MACHINE\System\StorageManager\Profiles. Each configuration file is located under a base configuration file key, identified by its configuration file name. For example, we utilize Intel's PSM file system, whose configuration file is located under the registry key HKEY_LOCAL_MACHINE\System\StorageManager\Profiles\PSMFSD. The Flash driver configuration file is located under the registry key HKEY_LOCAL_MACHINE\Drivers\BuiltIn\StrataFMD. In this file system, we use Microsoft's built-in Flash driver. Conclusion This file system has been applied on handheld mobile terminals and has been integrated with the upper-layer database system. After multiple tests, this file system is stable, reliable, and performs well. It can be used to store large amounts of data and meet various needs. Compared to the TrueFFS file system, the improvements in reliability and system resource consumption are considerable, especially when combined with Intel's Flash.