Implementation of multi bin wince 5.0 and smdk2440

Source: Internet
Author: User
Tags builtin

I was about to post a post for a long time, but I have been hesitant to post a post from king_sundi. In contrast, my summary is more practical, basically, you can follow this step. I have tried it for a few of my friends who can solve this problem at first.
Summary of xip implementation.
Step 1: Modify the config. bib file. The size of the kernel subset xipkernel is adjusted according to the actual size of xipkernel. Bin compiled by yourself,
Xipkernel base = 8c200000, xipkernel size = 0013f000 memory type is ramimage
Chain base = xipkernel base + xipkernel size; chain size = 00001000 memory type is reserved
NK base = chain base + chain size; NK size is adjusted based on the actual NK. bin size customized on your platform. The memory type is nandimage.
Ram base = NK base + NK size; Ram size = 90000000-ram base. The memory type is Ram.
Pdwxiploc is a global variable of the specified address for initromchain (). Its address must be the same as chain base.
Xipschain = 8c33f000 must also be equal to chain base.
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 always 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 the 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.


Memory
Xipkernel 8c200000 0013f000 ramimage
Chain 8c33f000 00001000 Reserved
NK 8c340000 00d00000 nandimage
Ram 8d040000 02fc0000 Ram
; Ram 8c340000 03cc0000 Ram
Pdwxiploc 00000000 8c33f000 fixupvar
; Flash 92000000 00100000 Reserved

; Common RAM Areas
Aud_dma 8c002000 00000800 Reserved
Sdio_dma 8c010000 00010000 Reserved
ARGs 8c020800 00000800 Reserved
Dbgser_dma 8c022000 00002000 Reserved
Ser_dma 8c024000 00002000 Reserved
Ir_dma 8c026000 00002000 Reserved
; Edbg 8c030000 00020000 Reserved
; Camera 8c050000 000a0000 Reserved
Display 8c100000 00100000 Reserved


;
; Romflags is a bitmask of options for the kernel
; Romflags 0x0001 disallow Paging
; Romflags 0x0002 not all kmode
; Romflags 0x0010 trust module only
;
Config
Autosize = on
; Rom_autosize = on
Dlladdr_autosize = on
Compression = on
Kernelfixups = on
Xipschain = 8c33f000
Profile = off

Romflags = 00


Romstart = 8c200000
Romwidth = 32
Romsize = 00d00000
[Note] Pb can generate xip. Bin, which must define xipschain = 8c33f000. Otherwise, xip. Bin cannot be generated.

Step 2:
Registry Modification, platform. Reg
; Hive boot section
; @ Cesysgen if ce_modules_sdnpcid

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 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"
"Paging" = DWORD: 1
; 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

[HKEY_LOCAL_MACHINE \ SYSTEM \ storagemanager \ autoload \ msflash]
"Driverpath" = "Drivers \ builtin \ msflash"
; Loadflags 0x01 = load synchronously
"Loadflags" = DWORD: 1
"Order" = DWORD: 0
; "Mountflags" = DWORD: 10
"Bootphase" = DWORD: 0
"Flags" = DWORD: 1000

[HKEY_LOCAL_MACHINE \ drivers \ builtin \ msflash]
"Prefix" = "DSK"
"Order" = DWORD: 0
"DLL" = "smflash. dll"
"Profile" = "msflash"
; "Mountflags" = DWORD: 10
"Friendlyname" = "msflash driver"
"Bootphase" = DWORD: 0
"Flags" = DWORD: 1000

; Bind binfs to the block driver
[HKEY_LOCAL_MACHINE \ SYSTEM \ storagemanager \ profiles \ msflash]
"Defaultfilesystem" = "binfs"
"Partitiondriver" = "mspart. dll"
"Automount" = DWORD: 1
"Autopart" = DWORD: 1
"Folder" = "nandflash"
"Name" = "Microsoft flash disk"
"Bootphase" = DWORD: 0
"Flags" = DWORD: 1000
"Mountashidden" = DWORD: 1
"Mountasrom" = DWORD: 1
; "Mountflags" = DWORD: 00000004
; "Mounthidden" = DWORD: 00000000

[HKEY_LOCAL_MACHINE \ SYSTEM \ storagemanager \ profiles \ msflash \ fatfs]
"Friendlyname" = "Fat filesystem"
"DLL" = "fatfsd. dll"
"Flags" = DWORD: 00280014
"Paging" = DWORD: 1
"Cachesize" = DWORD: 0
"Enablecachewarm" = DWORD: 0
"Enablecache" = DWORD: 1
"Mountasbootable" = DWORD: 1
"Mountasrom" = DWORD: 1
; "Mountasroot" = DWORD: 1
; @ Cesysgen endif ce_modules_sdnpcid
; End hive boot section
Step 3:
The file system selected by the system must be Ram and Rom filesystem, and Rom only cannot be used.
Step 4:
You need to know which modules and files must be included in the kernel subset xipkernel. bin. According to my practice, 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 ",
Other options.
Step 5:
Use the preromimage.batand processbib.exe programs to copy them to your platform/smdk2440/files/directory.

After this change is completed, build and sysgen are started.
Xip is generated. BIN and then burn it to NAND Flash. You need to support partitions in boot, and automatically create binfs partitions and fat partitions when writing, if you are not using eboot, you will not be able to create binfs and fat partitions.
After the system starts up, we can see a binfs directory and a nandflash directory.
Step 6:
In the last step, modify Ce. bib's
Xipkernel 8c200000 0013f000 ramimage
Chain 8c33f000 00001000 Reserved
NK 8c340000 00d00000 nandimage
; Ram 8d040000 02fc0000 Ram
Ram 8c340000 03cc0000 Ram
So that the starting address of Ram is equal to the starting address of NK. Here, the RAM space is enlarged and romimage CE is used in the command line mode. bib to generate xipkernel. bin files can be burned to NAND Flash. Someone has a problem and finds xipkernel. bin is too small to burn in. In the oemverifymemory () Judgment, it is regarded as image_type_ramimage, so it is not written to flash. just comment out the code.
/* Comment for fix if the image too small and locate in range, then the image type will change to ram image and cause the image can not write to flash.
// Is it a ram image?
Else if (dwstartaddr> = rom_ramimage_start )&&
(Dwstartaddr + dwlength-1) <(rom_ramimage_start + rom_ramimage_size )))
{
// Retailmsg (1, (text ("downloading Ram image \ r \ n ")));
G_imagetype = image_type_ramimage;
Return true;
}
*/
Well, the program memory will be around 61774k.
Do you have any questions? I didn't mention the initromchain () function. Practice has proved that it is okay if you don't write this function and do not call it in oeminit.

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.