[Reprinted] transplantation of the embedded operating system Windows CE. net on the S3C2410 Platform

Source: Internet
Author: User

ArticleHttp://www.cedn.cn /? Uid-816-action-viewspace-itemid-1900

Because of the environment requirements of the embedded system, the embedded operating system generally needs to provide the addition or reduction of the kernel and other functions, so that users can configure as needed. at present, there are many types of embedded microprocessor, and the embedded operating system must support as many processors as possible, which requires customization of the operating system for different processors.
This article analyzes the characteristics of the embedded operating system Windows CE. net, and customizes it on the ARM920T-core S3C2410 processor by using the tool platform builder 4.2.

1. Windows CE system and platform builder 4.2
Windows CE is a 32-bit, multi-thread, and multi-task embedded operating system launched by Microsoft, it is an embedded modular operating system specially designed by Microsoft for information devices, mobile applications, and embedded applications. you can select, combine, and configure Windows CE.. Net modules and components to create a user version of the operating system.
Windows CE. net is a successor to Windows CE 3.0. Its system composition is 1. windows CE. NET provides a good real-time operating system for the rapid establishment of the next generation of smart mobile devices and small memory usage. It has a complete Operating System feature set and an end-to-end development environment, it also includes everything required for custom devices, such as networking capabilities, real-time performance, small memory usage, multimedia and web browsing functions.
platform builder 4.2 is provided to Windows CE by Microsoft. NET developers Based on Windows CE.. NET platform embedded operating system customized integrated development environment. it allows you to design, create, compile, test, and debug Windows CE.. Net operating system platform tools. developers can design and customize the kernel, select system features, and compile and debug the system in an interactive environment. at the same time, developers can also use platform builder to develop Programs and application projects.

2 hardware platform
HHARM9-EDU development platform is developed by huaheng company for embedded system teaching platform, which consists of core board and bottom board. the core board is integrated with Samsung S3C2410 processor, 16 M Flash and 64 m sdram. samsung's S3C2410 processor is a cost-effective, low-power, small-size, high-performance, high-integration microprocessor, which uses a 203 MHz ARM920T kernel, it integrates 16 KB Instruction Cache and 16 KB data cache, and uses MMU to manage virtual memory. The LCD Controller supports the STN screen or FTT screen and NAND Flash. the functional modules of the core board are shown in figure 2.
 

3. Port Windows CE. net
3.1 Migration Process
Basically, Windows CE.. NET is the process of rewriting BSP. BSP, also known as the board-level support package, is a software package that includes the Startup Program, OEM Adaptation Layer Program (oal), Standard Development Board (SDB) and drivers of related hardware devices. BSP is based on Windows CE.. NET platform system. to port the operating system, follow these steps:
1) cut down the operating system, configure various components, and modify relevant configuration files;
2) Develop device drivers on the target device system and create customized CE operating system image files;
3) download the target file to the target device for debugging;
4) After customizing the operating system kernel, export the Platform SDK for developing upper-layer application software in Embedded Visual C ++.
See figure 3.

The development tool platform Builder provides BSP for multiple target boards. if the target board is the same as that provided by platform builder, you only need to re-compile the system image and download it to the target board. however, the actual situation is that the processor is the same, while the peripheral device interfaces on the board are different. In this case, only the BSP of the same or similar processor in platform builder is modified to generate a new BSP, in this way, the R & D cycle of BSP can be greatly reduced.

3.2 BSP development based on S3C2410 board
BSP development mainly includes the development of bootloader, oal, local driver, and some file configurations.
1) bootloader is a small program that runs before the operating system kernel runs. through this applet, You can initialize hardware devices and create a map of memory space to bring the system's hardware and software environment to a suitable state, in order to prepare the correct environment for the final call to the operating system kernel. it is stored in non-volatile storage media of the target platform, such as Rom or flash. this article uses the ppcboot provided by huaheng.
2) oal is a device vendor Adaptation Layer located between the Windows CE kernel and the target hardware platform. Code Layer. The purpose of oal development is to achieve the communication between the Windows CE. Net kernel and the target hardware, including handling interruptions and timers.
3) Device Drivers (driver) is a piece of software module that can manage virtual or physical devices, protocols, services, etc. The operating system directly deals with hardware through the driver. the specific steps of Device Driver Design are to create a new platform through platform builder, and then insert and remove the driver according to the needs of the hardware platform. The files to be modified include platform. bib, platform. reg and drivers Source code The following uses the LCD driver source code as an example. According to huaheng's reference materials, we need to modify the original driver of Pb as follows:
Word tempbuffer [241] [320]; // the size of the buffer after modification
S3c2410disp: s3c2410disp (void)
{
Retailmsg (0, (text ("++ s3c2410disp: s3c2410disp ")));
// Setup up display mode related Constants
M_nscreenwidth = 240; // The Screen width is changed from 480 to 240.
M_nscreenheight = 320; // The screen height is changed from 640 to 320.
M_colordepth = 16;
M_cbscanlinelength = m_nscreenwidth * 2;
M_framebuffersize = m_nscreenheight * m_cbscanlinelength;
// Memory map register access window, frame buffer, and program LCD controller initializehardware ();
The register settings are set by the initdisplay function in D: wince420platformsmdk2410kernelhalcfw. C. The driver obtains the framebuffer address by reading the corresponding key values in the registry.
[Hkey_local_machinedrivers3c2410config]
"Displaydll" = "s3c2410disp. dll"
"Lcdvirtualframebase" = DWORD: ac100000
"Lcdphysicalframebase" = DWORD: 30100000
4) platform file configuration. the configuration file includes the source code configuration file and the operating system image configuration file. the source code configuration file mainly refers to the path required by the build tool, the source files of C or visual C ++, and the types of binary files generated, including dirs, sources, and makefile files. the operating system image configuration file is mainly used to generate an operating system image for makeimag tool, including. bib (Binary Image File ),. reg (Registry file ),. dat (File System Description file ),. dB (database file ). in this article, the source code configuration file only modifies the configuration file.
Use the BSP generated above to create a new platform through platform builder. This article selects the mobile handheld platform directly, and then selects it as needed. finally, obtain NK under wince42opublicplatformreldirsamsung_smdk2410_armv4release. bin, compress it, and burn it into flash. at the same time, export the Platform SDK for developing applications on EVC.

3.3 debug the operating system image on the target device
The Development Board and PC can download the operating system image through the serial pie line port, Ethernet and JTAG/BDM. in this article, the Development Board is connected to the network cable and Serial Line with the PC, set the Super Terminal, and finally the system runs on the Development Board.

4 Conclusion
This article briefly introduces Windows CE. net porting process in the HHARM9-EDU, for other processor platform, also has reference value. windows CE. net port on different hardware platforms is mainly based on the corresponding hardware modification BSP process, the design of the driver is one of the key to build BSP, without new peripherals, the driver design can be modified based on the source code provided by Pb. if a new hardware device is available, you need to rewrite it.

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.