Customized Windows CE system

Source: Internet
Author: User

Embedded systems are increasingly widely used in various aspects. The biggest feature of embedded systems is their simplification and timeliness. Recently, the company appointed me to take charge of a new embedded system project. because it is a small device, the first problem I faced was to find a small one, but it is very flexible to add external interfaces to embedded systems.

First, two solutions were proposed. The first was to crop the entire system, and the second was to directly install the kernel, boot script, and other files on the disk to achieve the minimum system. After thinking twice, among the many embedded operating systems, I chose Windows CE as the operating system platform and customized a suitable embedded system by cropping Windows CE.

1. What is Windows CE cropping and customization?

(1) Development Bottleneck of Embedded Systems

Embedded systems generally include hardware and software. The hardware platform includes CPU, memory, and I/O Ports. The software includes embedded operating systems and applications that support real-time and multi-task operations. Applications control the operation and behavior of the system, while the operating system controls the interaction between applications and hardware.

With a large number of low-cost, small-sized CPUs and stable and reliable peripheral hardware, the bottleneck restricting the development of embedded systems is highlighted in the software aspect. For upper-layer application developers, embedded systems require a highly concise, user-friendly, reliable, easy to develop, multi-task, and inexpensive operating system. Therefore, once the embedded processor and peripheral hardware are selected, the most active part will be the selection and development of embedded software. The embedded operating system and application software of embedded software are becoming increasingly important. The embedded operating system is closely related to the application environment. From the application scope, it can be roughly divided into two types of Embedded Operating Systems: general type and dedicated type.

(2) What is a Windows CE. Net custom system?

In principle, the embedded operating system is still an operating system, therefore, it also provides basic functions of the operating system in process management, storage management, device management, processor management, and input/output management. Because the hardware platform and application environment are different from the general desktop operating system, the biggest feature of the hardware platform is that it can be tailored and customized, that is, it can provide configurable or customizable kernel functions and other functions, and provide or do not provide certain functions as needed to reduce system overhead.

Embedded operating systems are closely linked with embedded operating system customization or configuration tools, forming an integrated development environment for Embedded operating systems. For Windows CE, we cannot buy the Windows CE operating system. We bought the platform builder for CE.. Net integrated development environment (PB for short), which can be used to crop and customize a Windows CE.. Net operating system. Therefore, the Windows CE. Net operating system generally needs to be tailored and customized, including advanced creation, system debugging, Board creation support packages, driver development, and so on. Therefore, Windows
The CE system is actually completely customized by itself, which is the biggest feature of the embedded operating system.

Embedded Application software usually refers to software running on an embedded operating system. Because such software is not developed for conventional operating systems, many development tools such as VB and VC ++ are inconvenient to use, therefore, there is a dedicated SDK or integrated development environment to provide such development needs. For Windows
Ce application software development, Microsoft provides Embedded Visual Basic (EVB), embedded VisualC ++ (
EVC), Visual Studio. NET and other development tools for Embedded operating systems.

(3) Windows CE customized PLATFORM Builder

An embedded system consists of four layers: applications, embedded operating system images (OS images), board-level support packages (BSP), and hardware platforms. The customization process of Windows CE can also be said to be the process of writing BSP for different CPUs and different target boards. On the hardware platform, Windows CE supports multiple processor families, including x86, XScale, arm, MIPS, and SH series. It allows developers to select the most ideal hardware. In the operating system image (OS
Image), Windows CE. net is customized by platform builder. Platform Builder provides a variety of configuration files and debugging tools that can generate the kernel together with the embedded operating system and applications, or only generate Windows CE.. Net Operating System, and relevant modules can be tailored according to functional requirements.

Windows CE has a very small core package, which basically only contains scheduling, memory management, and kernel API. They constitute a complete individual, most of the other functions are completed in a separate module. The cropping and configuration of the system are completed in platform builder. The configuration file includes four file types: Binary Image File generation. bib, registry file. reg, directory and file configuration table file. dat, database files. DB. By modifying these configuration files, you can crop and optimize Windows CE. Flexible use of the platform builder configuration files. Reg,. bib,. dat,. DB is customized for the target platform windows
The key to the CE operating system.

In addition, all. when you merge DAT files to modify the configuration file, you must pay attention to CE. bib, reginit. INI, initobj. dat, initdb. INI is an intermediate file. You cannot configure Windows CE to modify these files. The configurable secret is hidden in the process of constructing an operating system image file. This image file includes the operating system's kernel, memory file system, stored programs, and files, system configuration files and registry databases. The entire construction process can be divided into four stages: cesysgen, BSP, buildrel, and makeimg.

Ii. Windows CE kernel customization process

Embedded development involves many problems, including kernel customization of operating systems, writing of drivers, and R & D of applications. For our developers, mastering embedded kernel customization is conducive to improving efficiency. Windows CE kernel customization is a focus of R & D. It is different from general application R & D because it involves hardware. Kernel customization includes customized board-level support packages BSP, customized system modules, customized Original equipment vendor adaptation layer (oal), device drivers, and other programs. Windows CE kernel customization is completed in platform builder. It is a professional software provided by Microsoft and can obtain evaluation boards from the official website.

(1) construct the platform Builder Environment

The integrated R & D environment of Microsoft platform builder contains a series of R & D tools. The configuration documents and debugging tools provided by Microsoft can be used to quickly customize the Windows CE operating system suitable for the target platform, you only need to modify and configure the configuration document of platform builder to crop and add related components and configure various device drivers.

Platform builder allows you to create and debug Windows ce nk ing NK. bin integrated development environment, such as Wizard and toolbar, supports the activity Template Library (ATL), Microsoft basic class library (MFC) and Visual Basic, provides compilers, kernel debuggers, and various remote debugging tools for supported processor families. Through network communication, we can download the Windows CE operating system image file NK. bin to the target platform, and then let windows
CE is started on the target platform. You can also use the debugging tool provided by platform builder to view the running status of Windows CE.

(2) Customization of board-level support packages (BSP)

BSP mainly includes the development of Bootloader and OAL. Compiling bootloader is the first and key step for customizing the Windows CE system. Only a stable loader program can further develop the Windows ce bsp. Bootloader is a separate program code, which is stored in the non-Easy loss storage media of the target platform, such as Rom or flash. It is mainly used to start hardware and download NK. bin to the target board, and has a certain monitoring effect.

In general, the functions of bootloader are not strictly defined and vary greatly in different scenarios. For example, on a PC hardware platform, bootloader does not need to perform initialization after CPU power-on because the hardware is not started through bootloader (but through BIOS; on a general embedded R & D platform, bootloader is the first program to be executed, so it must include the power-on initialization program. Generally, bootloader must include the function of downloading ce image documents. Because bootloader involves basic hardware operations, such as the CPU Structure and commands, as well as Ethernet download protocol and image document format. Therefore, it takes a long process to implement from scratch. The common practice is to use a bootloader routine of a standard R & D board provided by Microsoft for each type of CPU.

The oal (OEM Adaptation Layer) is an OEM adaptation layer, which is located between the Windows CE kernel and hardware. After the code of each oal module is compiled (. link to other kernel libraries to form the Windows CE kernel executable document NK. EXE. The Windows CE kernel can use a large number of functions and global variables on the oal layer, with these functions and global variables, OEMs can write interrupt processing, RTC, power management, debugging ports, and general I/O control code. Generally, the subdirectory of the Windows CE installation directory contains part of the oal source code. In most cases, the Development Engineer only needs to modify the oal without any modification.

(3) driver development and platform documentation Configuration

In Windows CE, any driver exists as a DLL. DLL files can be developed using EVC and Pb. The Platform documentation configuration includes four types of documents: Binary Image Generation documentation. bib, registry documentation. Reg, directory and documentation Allocation Table documentation. dat, and database documentation. DB. By modifying these configuration documents, you can crop and optimize Windows CE. you can create your own configuration documents as needed.

(4) SDK export and kernel download

The development of bootloader will generate documents such as eboot. nb0, and the kernel compilation will generate documents such as NK. nb0 and NK. Bin. Makeimg.exe combines the target module and file into a unique Windows CE image file NK. Bin using all the configuration files. To download the NK. BIN file, download the file "eboot.nb0" from jflash.exeto flash, and then download the file" NK. bin "Through eshell.exe. Then restart the system to run the customized Windows CE. Generating the image file NK. Bin is the last step in the platform creation process and the final goal of Windows CE configuration. After the kernel is compiled, you can export a platform SDK
Develop upper-layer software in EVC or vs.net.


Iii. Tips for customizing Windows CE

(1) select an appropriate hardware platform

Windows CE. net supports a variety of microprocessor families and simulation technologies. Selecting the appropriate CPU and standard development motherboard (SDB) can save development time more efficiently, which is also the first step to customize Windows CE.

(2) Use the BSP package provided by the system

The porting process of Windows CE is basically the process of writing BSP for the CPU and target board of different hardware platforms. The development tool platform Builder provides BSP for multiple target boards. If the target board and platform builder provide the same, you only need to re-compile the corresponding system. However, the actual situation is that the general processor is the same, but the peripheral hardware interfaces on the Development Board are different. In this case, you can modify the BSP of the same or similar processor in platform builder to complete a new BSP. Therefore, developers embedded in the system should use the motherboard support package (BSP) included in Windows CE. Net to shorten the time required for hardware development.

(3) Accelerate driver development by referencing specimen programs

Another important step for customizing the Windows CE system is to develop drivers for peripheral devices. The common practice is to find the specimen program closest to the hardware platform from these peripheral driver routines, and then make corresponding changes from the selected hardware platform, some new peripheral devices should use third-party vendors to provide drivers to accelerate development and release embedded products as soon as possible.

 

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.