[Original] Implementation of Windows CE 5.0 mult-xip bin mode (fully open)

Source: Internet
Author: User

 [Original] Implementation of Windows CE 5.0 mult-xip bin mode (fully open)

Description: Figure 1.
Image:
Description: Figure 2.
Image:
Windows CE 5.0 mult-xip bin mode implementation
What is xip? Microsoft says:
Execute-in-place (xip) regions are areas where an application can execute code directly from Rom rather than loading it from Ram. windows CE allows you to construct multiple xip regions in a single system. there are several reasons for using multiple xip regions instead of a single region:
• You can break applications into functional subsets and install them separately from the core of the Operating System (OS ).
• You do not need to replace the whole run-time image to add new features.
• You do not need to replace the whole run-time image to fix a bug.
• The user can update the run-time image.
• Updates to the run-time images are permanent and not vulnerable to cold resets.
The growing popularity of flash memory as a replacement for masked Rom is one of the technologies that enables multiple xip regions. in the Help topics that discuss multiple xip regions, Rom refers to the flash memory where the system image resides.
Multiple xip regions divide the ROM image into discrete, upgradeable units. as you decide how to divide the xip image, consider the owner of the modules and files in the region and the functionality of the modules and files in that region.
Note xip cannot span should SS physically discontiguous regions. although always Ally contiguous, some devices can hang when executed in place on code processing SS physical regions. also, uncompressed file and module should SS regions can be direct mapped or accessed directly without copying, but the kernel only handles the case where the file is physically contiguous.
If you do not know English, you may suffer. Check it out.
In fact, xip bin is not a new technology and is useful in many operating systems. For example, in Linux, many experts have mastered it for a long time. In Windows CE, many people are using it, mostly relying on nor flash, because we used nor flash for boot in the early stage. Until recently, we began to gradually abandon nor flash, and began to streamline hardware and reduce costs. More and more solutions were using NAND Flash as boot. This transformation makes it impossible for xip to be used on NAND Flash.
From a certain point of view, it is impossible, but what our programmers are talking about is to turn the impossible into a possibility. Therefore, more and more comrades are devoted to xip research. Of course, experts are pulling together. For example, zhengshijie, harktrip, Simula, wenzai, oxox and other experts actively posted personal suggestions in the Forum and answered our later siblings positively, which is really helpful.
Now I will talk about my implementation methods.
First, let me provide my implementation: (Note: My memory size is 64 MB)

Figure 1

Figure 2

Figure 3

I saw the drool, so hurry up and do it with me.

1. Build a project. Do not drop the selected component.

2. Add hive support. For this part, refer:
Http://www.armsystem.com.cn/article/ARM9-article/example/20061232117590.html
(Link provided by wenzai)

3. Add imgmultibin = 1 to the environment variable set in setting. This is the support for xip bin and must be added.

4. Modify the config. bib file:
The general settings are as follows:
Memory
Pdwxiploc 00000000 803ff000 fixupvar
Xipkernel 80200000 001ff000 ramimage
Chain 803ff000 00001000 Reserved
NK 80400000 01e00000 nandimage
Ram 80400000 07c00000 Ram
Flash 92000000 00100000 Reserved

Config
Autosize = on
Compression = on
Dlladdr_autosize = on
Kernelfixups = on
Profile = off
Ram_autosize = off
Romflags = 0
; Romsize = 01e00000
; Romstart = 800b8000
; Romwidth = 32
Rom_autosize = off
Xipschain = 803ff000
(Thanks to Simula for providing parameter configuration)

Fifth, plan the xipkernel to package the minimum system kernel.
The system must load the following components:
Modules
; Name path memory type
;----------------------------------------------------------------------
Nk.exe D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/kern.exe xipkernel sh
Coredll. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/coredll. dll xipkernel sh
Filesys.exe D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/filesys.exe xipkernel sh
Fatfsd. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/fatfsd. dll xipkernel sh
Diskcache. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/diskcache. dll xipkernel sh
Fatutil. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/fatutil. dll xipkernel sh
Binfs. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/binfs. dll xipkernel sh
Fsdmgr. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/fsdmgr. dll xipkernel sh
Mspart. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/mspart. dll xipkernel sh
Ceddk. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/ceddk. dll xipkernel sh
Smflash. dll D:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/smflash. dll xipkernel sh

Files
Boot. hv d:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/boot. HV xipkernel sh
Default. hv d:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/Default. HV xipkernel sh
User. hv d:/wince500/pbworkspaces/smdk2440/reldir/smdk2440_armv4i_release/user. HV xipkernel sh
(Thanks to zhengshijie for providing xipkernel Information)

6. After these settings are complete, the rest of the work is to add a binfs partition in platform. Reg. My settings are as follows:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Support binfs Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Add binfs to partition table
[HKEY_LOCAL_MACHINE/system/storagemanager/partitiontable]
"21" = "binfs"

[HKEY_LOCAL_MACHINE/system/storagemanager/binfs]
"Folder" = "binfs"
"Friendlyname" = "bin filesystem"
"DLL" = "binfs. dll"
; Mountflags:
; 0x10 specifies that this file system is to be mounted as an external
; Rom filesystem shadowing the/Windows Directory
; 0x1 specifies that the mountpoint/binfs is to be hidden
;
"Mountflags" = DWORD: 10
"Bootphase" = DWORD: 0
Remember, this registration information must be included in
; Hive boot section
; End hive boot section
In this way, binfs information can be packaged into boot. HV. Otherwise, your xip implementation will be depressing. (I am so depressed for 3 days, compare dishes)
After completing the settings, you can start the xip journey.
The following is a supplement for prawns,
Zhengshijie:
I also summarized it and compared it.
3. Add imgmultibin = 1 to the environment variable set in setting. This is the support for xip bin and must be added.
This step can be avoided. You are affected by the help document because it is for the cepc configuration, because config. bib in the cepc configuration determines this amount.
We do not need to make this judgment for our config. bib, so we do not need to generate xip. bin to check whether your memory has more than one image and chain statement.

For the definition of the memory part in the bib file, you can find the answer in the help document and search for the memory section.
Name address size type
Memory region name start address region space memory type

The values of memory types include fixupvar, nandimage, Ram, ramimage, and reserved.
You can pay special attention to the explanation of nandimage.
Specifies that Ram shoshould overlap these regions when building an run-time

Image that uses binfs.
The overlapping regions are stored in NAND but are fixed up to conform ally

Appear as though they do not overlap.

When the kernel accesses these regions, binfs responds by intercepting

The request. binfs accesses NAND and returns the proper data to

Kernel.

This enables a device with nand to execute in place out of NAND, freeing

Up RAM for use by the system.

Romimage generates one binary (. Bin) file for each nandimage entry.

Nandimage sections must be page aligned.

Zhengshijie:
Another practice shows that the Minimum File Inclusion in the kernel subset can be removed by three more files. In practice, it is learned that the previously emphasized call of initromchain () can be removed instead of using oemiinit ().
The following files are required:
"Nk.exe ",
"Coredll. dll ",
"Filesys.exe ",
"Fatfsd. dll ",
"Diskcache. dll ",
"Fatutil. dll ",
"Binfs. dll ",
"Fsdmgr. dll ",
"Mspart. dll ",
"Smflash. dll ",

"Boot. HV ",

Related Article

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.