0 Introduction
Microsoft's Windows CE system is one of the most widely used embedded systems. In product research and development, some embedded operating systems take a long time to start up, and Wind-ows CE is no exception. Due to various factors, in some cases, the startup time even exceeds 1 minute. In actual embedded electronic products, customers need to experience an extremely fast, refreshing and stable system to avoid long waits. Therefore, how to quickly start the Windows CE system is a very important topic. This article will
analyze the startup principle of Windows CE and the reasons that affect its startup speed based on Samsung's S3C2440A processor and Windows CE system, and provide a solution to speed up the startup.
1 Windows CE startup process
The boot process of a general embedded system is shown in Figure 1. The boot loader (BootLoader) is the first code that runs after the system is powered on. It mainly initializes the working mode of the hardware by setting registers, such as setting clocks, interrupt control registers, etc., completing memory mapping, initializing MMU, etc. The second is the initialization of the system execution environment, loading or copying the system kernel and application images from the read-only memory to the system's RAM for execution, completing the loading of the system kernel and the startup of the application.
1.1 BootLoader startup
BootLoader is a small program that runs before the operating system kernel runs. It can initialize hardware devices and establish a mapping map of memory space, thereby bringing the system's hardware and software environment to a suitable state and preparing the environment for calling the operating system kernel. After the boot program completes its task, it transfers control to the kernel. Usually, the boot program is placed at the start address of the non-volatile fast idle memory or the initial value of the PC register when the system is cold started.
1.2 Loading process when the kernel starts
BootLoader can be divided into two categories according to the different Windows CE startup methods: download mode and startup loading mode. When BootLoader decompresses nk.bin to RAM, it hands over CPU control to the Windows CE kernel.
The startup loading mode is the normal loading mode of BootLoader. BootLoader loads the operating system from the storage medium into RAM and starts running the operating system from RAM. There is no user intervention in this process.
The download mode is that the BootLoader downloads the operating system image file from the development workstation to the RAM of the target device, and then writes it to the storage medium such as FLASH of the target device. This process requires downloading files from the host through communication means such as serial port lines or network connections. Therefore, different loading modes will directly affect the kernel startup loading time.
2 Main factors affecting Windows CE startup speed
Factors affecting system startup time can be considered from two aspects: the system itself and the hardware.
2.1 System loading
When the system starts, it involves BootLoader, kernel loading, initialization process, hardware driver and interface program, and application group. Therefore, the Windows CE startup speed is directly related to the boot program initialization time, kernel loading time, hardware driver loading time, application loading time, etc.
2.2 Hardware
Obviously, the frequency and efficiency of the CPU, the size and type of memory, etc. directly affect the startup speed of the system. For example, ARM7 and ARM9 have obviously different speeds for running the system. In addition, the choice of NoR FLASH or NAND FLASH in terms of memory will also have a certain impact on the startup speed.
3 Windows CE fast startup solutions
There are roughly the following solutions for fast startup of Windows CE. Due to the limitation of experimental conditions, this paper mainly discusses the impact of kernel size, use of Multi-bin technology, serial port print output, and different registry forms on the boot speed.
3.1 Use reasonable flash memory and choose the appropriate Windows CE kernel operation mode
The FLASH currently used in embedded systems is mainly divided into two types from the perspective of manufacturing technology: NOR FLASH and NAND FLASH. The feature of NOR is execution in place (XIP), so that the application can run directly in NOR FLASH without reading the code into the system RAM, but the low write and erase speed greatly affects its performance. The NAND structure can provide extremely high cell density, can achieve high storage density, and the write and erase speed is also very fast, but the driver must be written first when using it, and because it cannot write to bad blocks, it is necessary to perform virtual mapping on NAND FLASH from beginning to end, which may incur additional time. Therefore, choosing different flash memories has a certain impact on the boot speed.
Because of the different characteristics of the above two types of flash memory, the operation mode of Windows CE is directly related to them and can be divided into two categories: one is to run directly on NOR FLASH, and the other is to store it in NAND FLASH and then load it into the memory for operation. The former burns the executable image of the kernel to FLASH, which can implement XIP; while the latter first puts the compressed file of the kernel on FLASH, decompresses it at startup, and then executes it. Therefore, running directly on NOR FLASH will be faster. [page]
3.2 Streamlining the size and loading content of Windows CE kernel
During the Windows CE startup process, the time taken to load the kernel and after loading the kernel is different. The former is loading the kernel from NANDFLASH to memory, which takes up the vast majority of the time, while the latter actually only takes up a small part of the time. Therefore, the startup time can be shortened by shortening the time to load the kernel. To do this, you can reduce the kernel size. That is, all components are customized according to what is needed, and all unnecessary components are deleted. Among them, one of the most effective ways is to reduce the font size and remove unnecessary fonts from other countries.
On the other hand, the kernel will have many static and delayed loading dependencies when it starts, especially various security DLLs, which will definitely increase the startup time. Drivers, devices and self-starting programs loaded at startup will also take up a certain amount of time. Therefore, when the device can be started and applied normally, the principle of streamlining should be followed, and the device drivers and startup programs should be loaded in a minimized manner, and the system should be started with the minimum number of components and drivers to reduce unnecessary time delays. For example, the shell program and startup interface on the device can be streamlined.
3.3 Using Multi-bin technology
Windows CE provides the Multi-bin function. Literally, Multi-bin means multiple bins. It divides the entire kernel image into several parts. When Windows CE starts, only the core part can be loaded, which can effectively improve the startup speed of Windows CE. The method is as follows:
First, modify Eboot to support the BinFN (Binary Rom Image File System) file system, support the download and burning of Multi-bin, and add the BinFN partition in the registry platfor-m.reg.
Secondly, modify the configuration file config.bib, set the space and type of each partition according to the actual situation; and plan XIPKERNEL to package the minimized system kernel into it, that is, add the necessary kernel files to the modules and Files in project.bib, for example, the system must load components such as nk.exe, coredll.dll, filesys.exe, fatfsd.dll,
diskcaehe.dll, Fatutil.dll, binfs.dll, fsdmgr.dll, mspart.dll, smFLASH.dll, boot.hv, etc.
Finally, when using Platform Builder to customize the kernel, the system selects the RAM and ROM File System file system, and the registry format selects the Hive-based Registry, which supports permanent storage.
After compilation, the generated xip.bin and XIPKERNEL.bin files are burned under the guidance of EBoot.nb0 to complete the burning of Windows CE and use the Windows CE system.
3.4 Turn off the serial port output
Windows CE outputs a lot of startup information status when it starts. Because it takes a certain amount of time to output and print information such as serial port RETAILMSG, if there is no error in the compilation, turning off the serial port output information can also increase the startup speed. To do this, you can remove the output content of OEMWriteDebugByte() and OEMReadDebugByte() functions in the Debug.c file.
3.5 Choose the appropriate registry method
The registry is divided into two types: RAM-Based Registry and Hive-Based Registry, which are generally used to record the driver information of all applications and hardware peripherals.
The RAM-based registry stores the entire registry as an object storage heap in the system's memory. If the system is cold-started or the system is powered off, all changes to the registry will cause the stored data to be lost. Therefore, the registry implemented based on object storage is generally used in systems with less power outages or systems that generally do not require cold starts. However, if a RAM-based registry is used, it will make the system faster, occupy less space, and the read and write access operations to the registry will become very efficient. System developers should provide a method that enables the system to back up and restore the registry before and after power outages. Usually, the disadvantage of this method of backing up and restoring the registry is that it requires two startups. During the startup process, an additional hot start must be performed to make the restored registry effective, so the efficiency is relatively low.
The registry stored based on the HIVE structure uses files to store registry data, which is independent of the type of file system used by the system. This method eliminates the need to back up and restore registry data before and after the system is powered off, which makes the system faster when cold started.
In short, the RAM-based registry is very efficient on devices that are frequently hot-started, but the performance is disappointing in devices that are frequently cold-started; while the Hive-based registry is very efficient in devices that are frequently cold-started or infrequently hot-started. Therefore, using different types will also affect the startup efficiency of Windows CE. Users should make reasonable choices based on actual conditions.
4 Experiments and Analysis
4.1 Experimental Platform
(1) Hardware Platform. The ARM processor is Samsung's S3C2440A, with a nominal operating frequency of 400 MHz; the memory includes 2 32 MB SDRAMs and 1 64 MB NAND FLASH; the device modules include USB, LCD, and UART.
(2) Software Platform. Bootloader: bootloader VER-5.0; operating system: Windows CE5.0; development tool: Platform Builder 5.0.
4.2 Experimental Conditions
When establishing a PB project, select the Mobile Handheld template, and select other components as shown in Table 1. This will enable a handheld device system that supports MFC programming, text table editing, and MP3 playback. The data in Table 1 are obtained under this system.
[page]
Table 2 is a comparison of the system before and after the MP3 playback function is implemented. The method before the system was streamlined was to select the MobileHandheld template and add MP3 support; the method after the system was streamlined was to select the CustomDevice template and only select MP3 Codec, wMA and MP3Streaming and Windows Media Player to implement MP3 playback without adding any other unnecessary components, thereby reducing the kernel size. The data in Tables 3 and 4 are based on the data obtained under different registry RAM and Hive under the MobileHandheld template.
4.3 Experimental results and analysis
Tables 2 to 4 compare the startup time brought by the corresponding optimization. The time is calculated from the start of startup to the entry into the Windows CE interface. From Table 2, it can be seen that the use of Multi-bin technology can greatly improve the startup speed and shorten the startup time; and the serial port output information also has a certain impact, especially when there is a lot of output information, the time occupied cannot be ignored.
In addition, Table 3 shows that the size of the system composed of kernels, components, etc. also directly affects the startup speed, so the unnecessary kernels and components of the system should be reduced as much as possible.
It can be seen from Table 4 and Table 5 that when the registry is not modified, the speed of using the RAM-based registry is slightly faster than that of the Hive-based registry. However, after the registry is modified, the former usually needs to be started twice, so the speed is slower than the latter.
5 Conclusion
In the development and use of the embedded operating system Windows CE, the system startup speed not only reflects the performance of the device, but also directly affects the user's feelings and experience. This article first introduces the startup process of Windows CE, analyzes the factors that affect the startup speed of Windows CE, and then proposes some solutions to speed up the startup speed. Although the system startup is also related to the specific hardware, it still needs to be considered comprehensively in specific applications. However, the method proposed in this article is also of great guiding significance for optimizing the startup speed of the Windows CE system when using it based on other hardware structures.
Previous article:Design of extended serial port based on S3C2440 and embedded Linux
Next article:Design of DC Motor Speed Control System Based on S3C2440A
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Share: Current status of wireless charging
- [IMX6UL Development FAQ] How to tailor kernel make menuconfig and how to add new devices?
- If the mobile phone signal strength is -90dbm (medium strength), the conversion success rate = 10^-6mw (is the calculation correct?)
- Has Jialichuang started to use routine marketing?
- GaN technology detailed explanation is here
- 【October 15th | Online】5G NR Dynamic Spectrum Sharing (DSS): Overview and Test Challenges
- Why can an oscilloscope probe measure a 20ms period sine wave on a human hand?
- How to tell if an EEPROM chip is bad?
- New pyESP32 development board
- Developing ST BlueNRG-LP projects using Visual Studio