Follow these steps to customize the WinCE6 and 0 operating systems for a new hardware device:
1. Create a Board-level Support Package (BSP) for a specific hardware device. The BSP must include the BOOTLOADER and OEM adaptation layers.
Adaptation Layer (OAL) and some necessary drivers.
2. Use the created BSP to customize a system Design ). Create a Platform through VS2005
Builder project. This project can compile and generate the final runtime Image file (Rum-time Image ).
3. Create related drivers for the peripheral devices on the board and add them to BSP.
4. Modify the OS Design by creating a sub-project and Catalog Items.
5. Compile the OS Design and download the compiled runtime image file to the target device. In this case, you can use a remote debugging tool for debugging.
6. After all the debugging work is completed, the SDK (Software Development Kit) corresponding to the runtime image is exported. application developers can write applications for this device based on this SDK.
It can be seen that the migration of BSP is the most basic and key step during the whole transplantation process of the WinCE operating system. The process of creating a BSP mainly includes the following:
1. Create a BOOTLOADER. During development, BOOTLOADER is used to download operating system image files.
2. Create OAL. OAL is eventually linked to the kernel image file, which completes hardware initialization and management.
3. Create a device driver. Device Drivers are software support for peripheral devices on the board.
4. modify the configuration file of the runtime image. Configuration files include BIB, REG, and other files.
The main function of bootloader is to load the operating system runtime image to the memory and jump to the OS Startup Program. Its role is exactly the same as that of nboot described in the previous article. Bootloader can obtain the runtime image (generally the corresponding file name is NK) in two ways. It can be used to download NK from the outside through a wired connection, such as a network (Ethernet), USB, or serial port. It can also be stored from the local memory (flash, hard
Disk) to load NK. Generally, bootloader downloads an operating system image through Ethernet, so it is called eboot. Using eboot during development can improve development efficiency. By using eboot, you can quickly download NK to the target device. However, using flash programming tools or using JTAG for downloading is slow. In the final release of some products, eboot can be removed, but some must also include bootloader, as is the case for x86 platforms.
Based on different hardware designs, bootloader has different boot methods:
Norflash boot:
Generally, when an ARM processor selects 0, it will be connected to norflash. After the arm powers on, the program will be executed from the 0 address, that is, from the 0 address of norflash. Therefore, burn eboot to the place where the norflash address starts from 0. After the instance is powered on, the eboot starts to run. It can be executed in norflash, or it can be copied to the SDRAM for execution. Finally, load wince.
Image and run it.
Nandflash boot with eboot:
Due to the low capacity and high price of norflash, many arm processors now support nandflash boot. The nandflash boot guide varies slightly from manufacturer to manufacturer, depending on datasheet. However, the essence is to first read a small Loader from nandflash to run the loader, then load the eboot from nandflash to the SDRAM for running, and finally load the WinCE
The image is NK. Bin.
Nandflash boot without eboot:
If you do not need eboot during nandflash boot, you do not need eboot. In this way, a small loader is loaded from nandflash after the system is started. The small loader initializes the hardware system and then loads wince directly.
Image, which should be NK. nb0 and then run.
At this point, we have learned about the main features of EBOOT. To implement these features, EBOOT must complete the following tasks:
1. initialize the MCU. Including the initialization of MCU registers, interrupt, watchdog, system clock, memory and MMU. The preceding items are basically the same as NBOOT, but MMU Initialization is added here.
2. Call BootloaderMain () after completing all initialization (). The file corresponding to this function definition in WinCE6 and 0 is C: "WINCE600" PLATFORM "COMMON" SRC "COMMON" BOOT "BLCOMMON" blcommon, c
3. BootloaderMain () mainly calls the following functions in sequence: OEMDebugInit (), OEMPlatformInit (), OEMPreDownload (), and OEMLaunch (). These functions must be implemented by the EBOOT code.
4. Jump to the StartUp of OAL and exe and start the WinCE operating system.
Shows the entire process:
For the EBOOT code, see the C: "WINCE600" PLATFORM "DEVICEEMULATOR" SRC "BOOTLOADER" EBOOT directory. Here are some instructions on EBOOT of S3C2410. As mentioned in the previous article about NBOOT's method of loading EBOOT, NBOOT must put EBOOT at the specified position in the memory, which is determined by EBOOT. Specifically, the memory configurations in boot and bib are embodied in EBOOT, as shown in.
The address from which NBOOT loads EBOOT to the memory must correspond to this address. Because MMU is not used in NBOOT, the actual address used by NBOOT is 0x30021000. Otherwise, the system cannot start properly. Second, if NBOOT is not used to load EBOOT, but EBOOT is directly stored in NOR Flash, the self-loading process must be implemented in the EBOOT code, load all the EBOOT files in NOR Flash into RAM and execute the following code:
;------------------------------------------------------------------------------
; Copy boot loader to memory
Ands r9, pc, #0xFF000000; see if we are in flash or in ram
Bne % f20; go ahead if we are already in ram
; This is the loop that perform copying,
Ldr r0, = 0x21000; offset into the RAM
Add r0, r0, # PHYBASE; add physical base
Mov r1, r0; (r1) copy destination
Ldr r2, = 0x0; (r2) flash started at physical address 0
Ldr r3, = 0x10000; counter (0x40000/4)
10 ldr r4, [r2], #4
Str r4, [r1], #4
Subs r3, r3, #1
Bne % b10
; Restart from the RAM position after copying,
Mov pc, r0
Nop
Nop
Nop
; Shouldn't get here,
B,
We can also extend the functions of EBOOT to implement the necessary functions, such as initializing the LCD, displaying the specific startup screen, and displaying the progress of loading the image.
This article roughly introduces the content of eboot in wince6 and 0, but does not involve specific code implementation. For the relevant code, refer to the directory c: "wince600" Platform "deviceemulator" src "bootloader" eboot. In general, the core function of eboot is to boot the operating system image.