OAL porting from 2440 to 5.0

Source: Internet
Author: User

I 've been busy porting these days. To be honest, this idea has been around for a month, but it's just half a month ago. At first, I thought it was very simple. First, I have read several books.

I have read books, and I have read many forums, for example, Li Dawei, Zhou Jian, He zongjian, and Zhang dongquan, however, the results are still disappointing.

Often, things are different from what you think!
At first, I searched the internet to find out whether there is a ready-made transplant. I just want to use it directly and then make some modifications. Of course, the less I want, the better, but unfortunately it won't work. The reason is clear.

Explicit: 1. the CPU is inconsistent. Some are 2410, there are 2443, and of course there are 2440. So I chose 2440 for transplantation. Because my board is a friendly hand, mini2440.
2. Find someone else's transplanted BSP. Where can I find it? I have already transferred various forums and made a lot of changes. During this period, I will ask some people from Bs To Go To The Tony Forum. Some of the materials they have uploaded will not be enough to talk about.

The responsibility is entirely to cheat the gold coins. Of course, I still worship Tony!
3. I don't know where to start when the materials are available, because there is more room to choose, and there are more troubles. This person has this opinion, and that person has such a practice, how can I do this?

What should I do?
... There are still many problems, so I won't list them!
It was a small step to make the oal pass. Because I heard a cool man say that it's half done to call oal he kitl. Well, I don't know if it's true,

I hope I can stick to it.
First, refer

No. After a few days, I accidentally debugged it again, and the call was successful.
Next, refer to gooogleman's porting document and modify the document according to his ideas.
There are also many errors in the middle. I will post my errors to discuss with you:

First, follow

I can learn more. At least I know some functions of vs2005.
Next, refer to gooolman's post for transplantation, which is described in his personal blog. Just press it.
1. Compile the simplified version of the simulator first, then delete the oal-related code of the simulator, replace it with the code of 5.0bsp (delete the kitl-related code), and modify the corresponding sources.

File. The common directory contains two source files: smartmedia \ DLL and smartmedia \ FMD. The oal directory contains the source files under oalexe and oallib.

Block kitl from the Dir directory.

2. Replace c: \ wince500 \ platform \ smdk2440a \ SRC \ common with D: \ wince600 \ platform \ mini2440 \ SRC \ common
C: \ wince500 \ platform \ smdk2440a \ SRC \ Inc in place of D: \ wince600 \ platform \ mini2440 \ SRC \ Inc

Iii. Call the Lib generated by many code under D: \ wince600 \ platform \ mini2440 \ SRC \ common when compiling OAL. So I will compile D: \ wince600 first.

\ Platform \ mini2440 \ SRC \ common all the code below. In vs2005, click common and right-click "rebuild". If there is an error (if there is an error, it is normal,

(* ^__ ^ *) ......)
Warning content:
Build: [thrd: sequence: type] Message
Build: [01: 0000000039: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ intr \. \ Intr. C (379): Warning c4013: 'nkcallintchain'

Undefined; Assuming extern returning int
Build: [01: 0000000058: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ intr_dvs \. \ Intr. C (628): Warning c4013:

'Nkcallintchain 'undefined; Assuming extern returning int
Build: [01: 0000000192: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD \. \ FMD. CPP (940): Warning c4018: '<':

Signed/unsigned Mismatch
Build: [01: 0000000193: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD \. \ FMD. CPP (941): Warning c4244: '= ':

Conversion from 'unsigned long' to 'ushort ', possible loss of data
Build: [01: 0000000194: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD \. \ FMD. CPP (945): Warning c4018: '<':

Signed/unsigned Mismatch
Build: [01: 0000000195: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD. cpp (956): Warning c4700:

Uninitialized local variable 'plockinfo' used
Build: [00: 0000000445: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ dll \: Missing source file: D: \ wince600

\ Public \ cesysgen \ SDK \ Lib \ armv4i \ debug \ coredll. Lib.
Build: [00: 0000000446: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ dll \: Missing source file: D: \ wince600

\ Public \ cesysgen \ oak \ Lib \ armv4i \ debug \ FAL. Lib.

(The only bad thing about vs2005 is that the compilation error is not displayed in red)
Error location
// First find if IRQ is claimed by chain
Sysintr = nkcallintchain (uchar) IRQ );

Dizzy. The above is only a warning, but it is estimated that there are also problems. Run to common and open build. Err. There is an error.
Build: [thrd: sequence: type] Message
Build: [01: 0000000480: errore] FAL. Lib (falmain. OBJ): Error lnk2019: unresolved external symbol fmdhook_unhookinterface

Referenced in function dsk_deinit
Build: [01: 0000000481: errore] FAL. Lib (falmain. OBJ): Error lnk2019: unresolved external symbol fmdhook_hookinterface

Referenced in function "Void _ cdecl getfmdinterface (struct _ DEVICE *)"(? Getfmdinterface @ yaxpau_device @ Z)
Build: [01: 0000000482: errore] smflash_lib.lib (FMD. OBJ): Error lnk2019: unresolved external symbol readpage512 referenced in

Function "int _ cdecl fmd_sb_readsector (unsigned long, unsigned char *, struct _ sectorinfo *, unsigned long, INT )"(?

Fmd_sb_readsector @ yahkpaepau_sectorinfo @ KH @ Z)
Build: [01: 0000000483: errore] smflash_lib.lib (FMD. OBJ): Error lnk2019: unresolved external symbol writepage512 referenced in

Function "int _ cdecl fmd_sb_writesector (unsigned long, unsigned char *, struct _ sectorinfo *, unsigned long, INT )"(?

Fmd_sb_writesector @ yahkpaepau_sectorinfo @ KH @ Z)
Build: [01: 0000000484: errore] D: \ wince600 \ platform \ mini2440 \ target \ armv4i \ debug \ smflash. dll: Fatal error lnk1120: 4

Unresolved externals

 

What's going on?
Next refer to the http://bbs.driverdevelop.com/simple/index.php? T112006.htmlztg0021 post, found that he also encountered a similar error, according to his ideas to modify

:
Modify the sources file in SRC \ common \ smartmedia \ DLL
Add the following libraries based on the original two libraries in the sourcelibs statement segment.
$ (_ Commonoakroot) \ Lib \ $ (_ cpuindpath) \ fmdhooklib. Lib \
Then there is a new error.
Build: [thrd: sequence: type] Message
Build: [01: 0000000432: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ dll \ sources (12): u1033: syntax error:

'$ (_ Commonoakroot) \ Lib \ $ (_ cpuindpath) \ fmdhooklib. Lib' unexpected
Build: [01: 0000000434: errore] nmake. EXE targetlibfiles-I-c buildmsg = stop. buildroot = D: \ wince600 \ platform \ mini2440

Cleanbuild = 1 linkonly = 1 nopass0 = 1 failed-Rc = 2

Warning:
Build: [thrd: sequence: type] Message
Build: [01: 0000000039: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ intr \. \ Intr. C (379): Warning c4013: 'nkcallintchain'

Undefined; Assuming extern returning int
Build: [01: 0000000058: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ intr_dvs \. \ Intr. C (628): Warning c4013:

'Nkcallintchain 'undefined; Assuming extern returning int
Build: [01: 0000000192: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD \. \ FMD. CPP (940): Warning c4018: '<':

Signed/unsigned Mismatch
Build: [01: 0000000193: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD \. \ FMD. CPP (941): Warning c4244: '= ':

Conversion from 'unsigned long' to 'ushort ', possible loss of data
Build: [01: 0000000194: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD \. \ FMD. CPP (945): Warning c4018: '<':

Signed/unsigned Mismatch
Build: [01: 0000000195: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ FMD. cpp (956): Warning c4700:

Uninitialized local variable 'plockinfo' used

Faint. Replace smartmedia in the d: \ wince600 \ platform \ mini2440 \ SRC \ common directory with the one in ztg0021!
No error. Compilation successful!
Warning:
Build: [thrd: sequence: type] Message
Build: [01: 0000000039: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ intr \. \ Intr. C (380): Warning c4013: 'nkcallintchain'

Undefined; Assuming extern returning int
Build: [01: 0000000058: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ intr_dvs \. \ Intr. C (628): Warning c4013:

'Nkcallintchain 'undefined; Assuming extern returning int
Build: [00: 0000000436: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ dll \: Missing source file: D: \ wince600

\ Public \ cesysgen \ SDK \ Lib \ armv4i \ debug \ coredll. Lib.
Build: [00: 0000000437: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ dll \: Missing source file: D: \ wince600

\ Public \ cesysgen \ oak \ Lib \ armv4i \ debug \ FAL. Lib.
Build: [00: 0000000438: warnn] D: \ wince600 \ platform \ mini2440 \ SRC \ common \ smartmedia \ dll \: Missing source file: D: \ wince600

\ Public \ cesysgen \ oak \ Lib \ armv4i \ debug \ fmdhooklib. Lib.

 

Continue to compile OAL. After referring to gooogleman's transplant notes, it still gets stuck in oallib, and there are always eight errors. I posted them here for your advice:
Build: [thrd: sequence: type] Message
Build: [01: 0000000030: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ init. C (53): Error c2065: 'dwnkdrwatsonsize ':

Undeclared identifier
Build: [01: 0000000034: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ Intr. C (71): Error c2065:

'Bsp _ base_reg_pa_dm9000_iobase ': Undeclared identifier
Build: [01: 0000000035: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ Intr. C (71): Error c2051: Case expression not

Constant
Build: [01: 0000000045: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (73): Error c2065: 'bsp _ uart0_ufcon ':

Undeclared identifier
Build: [01: 0000000046: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (74): Error c2065: 'bsp _ uart0_umcon ':

Undeclared identifier
Build: [01: 0000000047: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (75): Error c2065: 'bsp _ uart0_ulcon ':

Undeclared identifier
Build: [01: 0000000048: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (76): Error c2065: 'bsp _ uart0_ucon ':

Undeclared identifier
Build: [01: 0000000049: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (77): Error c2065: 'bsp _ uart0_ubrdiv ':

Undeclared identifier

Fainted I DID NOT extern DWORD dwnkdrwatsonsize; will prompt dwnkdrwatsonsize undefined error, add it, But ztg0021 has to block
Extern DWORD dwnkdrwatsonsize. I hope you will not be confused.

Here I added this external statement, but I don't know what the final result is? Put it here first! But there is no problem in compiling common.

Here I would like to express my special thanks to one person: wlc311
In these days of csdn, he has helped me a lot like an old friend and thanked him again!
Wlc311 has fixed six errors: the solution is as follows:
I will provide a solution to six of the following errors:
Build: [01: 0000000034: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ Intr. C (71): Error c2065:

'Bsp _ base_reg_pa_dm9000_iobase ': Undeclared identifier
Add the following to Src-> inc-> bsp_base_reg_cfg:
# Define bsp_base_reg_pa_dm9000_iobase 0x20000300
# Define bsp_base_reg_pa_dm9000_membase 0x20000000
Build: [01: 0000000045: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (73): Error c2065: 'bsp _ uart0_ufcon ':

Undeclared identifier
Build: [01: 0000000046: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (74): Error c2065: 'bsp _ uart0_umcon ':

Undeclared identifier
Build: [01: 0000000047: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (75): Error c2065: 'bsp _ uart0_ulcon ':

Undeclared identifier
Build: [01: 0000000048: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (76): Error c2065: 'bsp _ uart0_ucon ':

Undeclared identifier
Build: [01: 0000000049: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ debug. C (77): Error c2065: 'bsp _ uart0_ubrdiv ':

Undeclared identifier
Add the following in Src-> inc-> bsp_cfg:
# Define bsp_uart0_ulcon 0x03 // 8 bits, 1 stop, no parity
# Define bsp_uart0_ucon 0 0x0005 // Pool Mode, pclk for UART
# Define bsp_uart0_ufcon 0x00 // disable FIFO
# Define bsp_uart0_umcon 0x00 // disable auto flow control
# Define bsp_uart0_ubrdiv (s3c2440a_pclk/(115200*16)-1)

For the other two reasons, we have not encountered this situation, so it is inconvenient to talk about it.
Recompile the entire oal

Build. Err
Build: [thrd: sequence: type] Message
Build: [01: 0000000076: errore] D: \ wince600 \ platform \ mini2440 \ SRC \ oal \ oallib \. \ init. C (53): Error c2065: 'dwnkdrwatsonsize ':

Undeclared identifier

About: nkcallintchain, I searched the internet, which probably means:
The dump file that generates the error report must have at least KB of memory. In oeminit, the variable dwnkdrwatsonsize is used to record the memory size. The kernel will

At the end of the primary memory area, this memory is retained. Set the compiling environment variable sysgen_watson_dmpgen to include the Error Report Generator function in the image.

Later, I asked for help on the Forum and got guidance from teacher he zongjian:
He zongjian: It seems that the error code is in oal's own code. In fact, I feel that we can comment out dwnkdrwatsonsize, disable the dump function, or place it in any header.

Define a variable in the file to see where the variable is defined in BSP of version 5.0. According to your own experience, 5.0 porting 6.0 only requires reference to Microsoft's official transplant documents, basically the workload is not

Large.

Zhengshijie: The global variables referenced externally in 5.0 cannot be used in 6.0, but are passed through
Platform/common/src/INC/OAL. H-> Public/common/oak/INC/oemglobal. H-> Public/common/oak/INC/bcoemglobal. h
# Define dwnkdrwatsonsize g_poemglobal-> cberrreportsize
Remove extern DWORD dwnkdrwatsonsize in 6.0, and delete extern DWORD ceprocessortype.

Then a small problem occurs:
Probably the error is that kitl. dll cannot be found, so OAL. EXE cannot be generated.
Why am I blocking it?
Originally, I chose kitl = 1 in the province/City option and checked it out.
Then conduct the overall compilation and generate osdesign6. Oh, my God, it's finally successful!
NK. Bin and NK. nb0 are generated.
Next, I want to port kitl and download it to the board!

I forgot to mention it. I directly downloaded a generic bootloader from the Internet, so I didn't make any changes. I plan to study it later. I 'd better write another nboot and add my own logo, think about it first.
Last thanks:
Wlc311, gooogleman, He zongjian, WinCE. He's predecessor, QQ name is 2008. Thank you for your help!

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.