2440/2416/6410/S5PV210之wince+android系统驱动开发者

等待新发生的事情

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2440 6.0BSP 移植过程之OAL

 

//-----------------------------------------------------------------------------------------------------------

// 作者:wogoyixikexie@gliet 

//论坛账号:gooogleman (经常在CSDN出没)

// 版权:桂林电子科技大学一系科协wogoyixikexie@gliet

// 平台:wince5.0 2440 5.0 BSP

// 发布日期:2009年6月18日 9:49:38

// 最后修改:

// 注意事项:未经作者同意,不得在转载的时候擅自修改、删除文章的任何部分

//-----------------------------------------------------------------------------------------------------------

 

作者:wogoyixikexie@gliet(注意转载请标明原创作者)
参照http://www.cnblogs.com/we-hjb/archive/2008/10/29/1322509.html帖子进行移植。

一、先编译后模拟器的精简版本,然后把模拟器的OAL相关的代码进行删除,换成5.0BSP的代码(把KITL相关的代码删除)并修改相应的sources文件。

二、把C:\WINCE500\PLATFORM\SMDK2440A\Src\Common代替H:\WINCE600\PLATFORM\QxCE6BSP\SRC\Common
C:\WINCE500\PLATFORM\SMDK2440A\Src\Inc代替H:\WINCE600\PLATFORM\QxCE6BSP\SRC\Inc

三、编译OAL的时候会调用H:\WINCE600\PLATFORM\QxCE6BSP\SRC\Common下的很多代码生成的lib,所以我现在首先编译H:\WINCE600\PLATFORM\QxCE6BSP\SRC\Common下面的所有代码,在VS2005 上点中Common然后右键选择“rebuild”,有错误了(有错误才是正常的,(*^__^*) 嘻嘻……)
BUILD: [01:0000000039:WARNN ] H:\WINCE600\PLATFORM\QxCE6BSP\src\common\Intr\.\intr.c(387) : warning C4013: 'NKCallIntChain' undefined; assuming extern returning int
BUILD: [01:0000000040:PROGC ] Compiling .\fiq.c
BUILD: [00:0000000045:PROGC ] Building COMPILE Pass in H:\WINCE600\PLATFORM\QxCE6BSP\src\common\Intr_dvs\ directory.
BUILD: [01:0000000055:PROGC ] Compiling .\intr.c
BUILD: [01:0000000058:WARNN ] H:\WINCE600\PLATFORM\QxCE6BSP\src\common\Intr_dvs\.\intr.c(637) : warning C4013: 'NKCallIntChain' undefined; assuming extern returning int
(这个VS2005 唯一不好的地方就是编译错误不是红色显示的)
出错地方
 // First find if IRQ is claimed by chain
        sysIntr = NKCallIntChain((UCHAR)irq);

晕,上面仅仅是警告,但是估计也有问题。跑到Common下打开build.err看看,有错误。
BUILD: [Thrd:Sequence:Type  ] Message
BUILD: [01:0000000469:ERRORE] fal.lib(falmain.obj) : error LNK2019: unresolved external symbol FMDHOOK_UnhookInterface referenced in function DSK_Deinit
BUILD: [01:0000000470: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:0000000471:ERRORE] H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\smflash.dll : fatal error LNK1120: 2 unresolved externals


怎么回事呢?
Src\Common\Smartmedia\Dll中的sources文件修改
在SOURCELIBS语句段中原有的两个库的基础上增加下面的库
$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\fmdhooklib.lib \
之后又有新的错误了。

BUILD: [Thrd:Sequence:Type  ] Message
BUILD: [01:0000000423:ERRORE] H:\WINCE600\PLATFORM\QxCE6BSP\src\common\Smartmedia\Dll\sources(10) :  U1033: syntax error : '$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\fal.lib' unexpected
BUILD: [01:0000000425:ERRORE] NMAKE.EXE TargetLibFiles  -i -c BUILDMSG=Stop.  BUILDROOT=H:\WINCE600\PLATFORM\QxCE6BSP CLEANBUILD=1 LINKONLY=1 NOPASS0=1 failed - rc = 2

晕倒,把sources换成ztg0021的那个就好了!

继续编译。
BUILD: [01:0000000030:ERRORE] H:\WINCE600\PLATFORM\QxCE6BSP\src\oal\OALLIB\.\init.c(55) : error C2065: 'dwNKDrWatsonSize' : undeclared identifier

晕倒我的没有extern DWORD dwNKDrWatsonSize;会提示dwNKDrWatsonSize未定义错误,加上就好了,但是ztg0021的却要屏蔽
extern DWORD dwNKDrWatsonSize 才行的。希望等下不要出乱子。

=================================使用ztg0021的改动OALEXE下面的sources导致好多错误=============================
BUILD: [Thrd:Sequence:Type  ] Message
BUILD: [01:0000000056:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol pQueryPerformanceCounter
BUILD: [01:0000000057:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol pQueryPerformanceFrequency
BUILD: [01:0000000058:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol curridlehigh
BUILD: [01:0000000059:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol idleconv
BUILD: [01:0000000060:ERRORE] oal.lib(intr.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000061:ERRORE] oal_ioctl_s3c2440a.lib(reboot.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000062:ERRORE] oal.lib(args.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000063:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000064:ERRORE] oal_intr_s3c2440a.lib(intr.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000065:ERRORE] oal_rtc_s3c2440a.lib(rtc.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000066:ERRORE] oal.lib(init.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000067:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol dwReschedTime
BUILD: [01:0000000068:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol CurMSec
BUILD: [01:0000000069:ERRORE] oal_power_s3c2440a.lib(off.obj) : error LNK2019: unresolved external symbol OALKitlPowerOn referenced in function OEMPowerOff
BUILD: [01:0000000070:ERRORE] oal_power_s3c2440a.lib(off.obj) : error LNK2019: unresolved external symbol OALKitlPowerOff referenced in function OEMPowerOff
BUILD: [01:0000000071:ERRORE] oal_rtc_s3c2440a.lib(rtc.obj) : error LNK2019: unresolved external symbol SC_SetLastError referenced in function OALIoCtlHalInitRTC
BUILD: [01:0000000072:ERRORE] oal.lib(init.obj) : error LNK2019: unresolved external symbol OALKitlStart referenced in function OEMInit
BUILD: [01:0000000073:ERRORE] oal.lib(init.obj) : error LNK2001: unresolved external symbol dwNKDrWatsonSize
BUILD: [01:0000000074:ERRORE] oal.lib(init.obj) : error LNK2001: unresolved external symbol CEProcessorType
BUILD: [01:0000000075:ERRORE] oal.lib(ioctl.obj) : error LNK2001: unresolved external symbol OALIoCtlVBridge
BUILD: [01:0000000076:ERRORE] H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\oal.exe : fatal error LNK1120: 14 unresolved externals
BUILD: [01:0000000081:ERRORE] EDITBIN : fatal error LNK1104: cannot open file 'H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\oal.exe'

再次编译OALLib,莫名出现错误 3 Error: Found NULL or missing TOC pointer for nk.exe ?记得刚才是没有错误了的,真是郁闷。

重新编译整个OAL

build.err变成
BUILD: [Thrd:Sequence:Type  ] Message
BUILD: [01:0000000127:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol pQueryPerformanceCounter
BUILD: [01:0000000128:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol pQueryPerformanceFrequency
BUILD: [01:0000000129:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol curridlehigh
BUILD: [01:0000000130:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol idleconv
BUILD: [01:0000000131:ERRORE] oal.lib(intr.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000132:ERRORE] oal_ioctl_s3c2440a.lib(reboot.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000133:ERRORE] oal.lib(args.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000134:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000135:ERRORE] oal_intr_s3c2440a.lib(intr.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000136:ERRORE] oal_rtc_s3c2440a.lib(rtc.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000137:ERRORE] oal.lib(init.obj) : error LNK2001: unresolved external symbol g_oalLogMask
BUILD: [01:0000000138:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol dwReschedTime
BUILD: [01:0000000139:ERRORE] oal_timer_s3c2440a.lib(timer.obj) : error LNK2001: unresolved external symbol CurMSec
BUILD: [01:0000000140:ERRORE] oal_power_s3c2440a.lib(off.obj) : error LNK2019: unresolved external symbol OALKitlPowerOn referenced in function OEMPowerOff
BUILD: [01:0000000141:ERRORE] oal_power_s3c2440a.lib(off.obj) : error LNK2019: unresolved external symbol OALKitlPowerOff referenced in function OEMPowerOff
BUILD: [01:0000000142:ERRORE] oal_rtc_s3c2440a.lib(rtc.obj) : error LNK2019: unresolved external symbol SC_SetLastError referenced in function OALIoCtlHalInitRTC
BUILD: [01:0000000143:ERRORE] oal.lib(init.obj) : error LNK2019: unresolved external symbol OALKitlStart referenced in function OEMInit
BUILD: [01:0000000144:ERRORE] oal.lib(init.obj) : error LNK2001: unresolved external symbol dwNKDrWatsonSize
BUILD: [01:0000000145:ERRORE] oal.lib(init.obj) : error LNK2001: unresolved external symbol CEProcessorType
BUILD: [01:0000000146:ERRORE] oal.lib(ioctl.obj) : error LNK2001: unresolved external symbol OALIoCtlVBridge
BUILD: [01:0000000147:ERRORE] H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\oal.exe : fatal error LNK1120: 14 unresolved externals
BUILD: [01:0000000152:ERRORE] EDITBIN : fatal error LNK1104: cannot open file 'H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\oal.exe'

参照ztg0021的帖子修改之后重新编译BSP下的Common,最后导致错Error: Found NULL or missing TOC pointer for nk.exe ?这是怎么回事呢?

现在整个BSP一起编译,还会出现如下错误,原因是KITL相关东西我现在还没有加上去。
BUILD: [Thrd:Sequence:Type  ] Message
BUILD: [01:0000000557:ERRORE] oal_power_s3c2440a.lib(off.obj) : error LNK2019: unresolved external symbol OALKitlPowerOn referenced in function OEMPowerOff
BUILD: [01:0000000558:ERRORE] oal_power_s3c2440a.lib(off.obj) : error LNK2019: unresolved external symbol OALKitlPowerOff referenced in function OEMPowerOff
BUILD: [01:0000000559:ERRORE] oal.lib(init.obj) : error LNK2019: unresolved external symbol OALKitlStart referenced in function OEMInit
BUILD: [01:0000000560:ERRORE] H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\oal.exe : fatal error LNK1120: 3 unresolved externals
BUILD: [01:0000000565:ERRORE] EDITBIN : fatal error LNK1104: cannot open file 'H:\WINCE600\platform\QxCE6BSP\target\ARMV4I\debug\oal.exe'

 

屏蔽上述代码后,编译整个BSP,天啊,居然成功了,NK.bin和NK.nb0生成了。
下载到我的产品。晕!,LCD可以看见画面了!
串口信息如下。

Windows CE Kernel for ARM (Thumb Enabled) Built on Nov 24 2008 at 14:58:23
ProcessorType=0920  Revision=0
OEMAddressTable = 8022a8d0
DCache: 8 sets, 64 ways, 32 line size, 16384 size
ICache: 8 sets, 64 ways, 32 line size, 16384 size
Error Reporting Memory Reserved, dump size = 00020000
Setting up softlog at 0x836cc000 for 0x800 entries
Booting Windows CE version 6.00 for (ARM)
&pTOC = 805a1c1c, pTOC = 80247b04, pTOC->ulRamFree = 805a6000, MemForPT = 00001000

Old or invalid version stamp in kernel structures - starting clean!
Configuring: Primary pages: 12573, Secondary pages: 0, Filesystem pages = 6286

Booting kernel with clean memory configuration:
Memory Sections:
[0] : start: 805a8000, extension: 00007000, length: 0311d000
NKStartup done, starting up kernel.
Windows CE KernelInit
Reserve VM for kernel XIP DLls, first = c0010000, last = c02b0000
g_pprcNK == 0x8059faa0
Updated eptr->e32_vsize to = 00036000
Initializing Memory Mapped File Support
Scheduling the first thread.
Detecting VFP... VFP Not Found!
LoaderInit: Initialing loader
Updated eptr->e32_vsize to = 00036000
Updated eptr->e32_vsize to = 000a2000
Updated eptr->e32_vsize to = 00010000
PGPOOL: Reserved 768 pages for Loader pool
PGPOOL: Reserved 256 pages for File pool
OSAXST0: Platform Name = PLATFORM_TYPE
OSAXST1: >>> Loading Module 'kd.dll' (0x836B087C) at address 0xC0010000-0xC0045000 in Process 'NK.EXE' (0x8059FAA0)
KD: Starting kernel debugger software probe (KdStub) - KD API version 22
OSAXST1: >>> Loading Module 'NK.EXE' (0x8059FAA0) at address 0x80200000-0x80236000 in Process 'NK.EXE' (0x8059FAA0)
Message Queue support initialized, g_hMsgQHeap = d0080010
OSAXST1: >>> Loading Module 'filesys.dll' (0x8368B648) at address 0xC0180000-0xC0216000 in Process 'NK.EXE' (0x8059FAA0)
OSAXST1: >>> Loading Module 'k.fpcrt.dll' (0x8368B780) at address 0xC0160000-0xC0178000 in Process 'NK.EXE' (0x8059FAA0)
OSAXST1: >>> Loading Module 'fsdmgr.dll' (0x8368B8C8) at address 0xC0260000-0xC02A6000 in Process 'NK.EXE' (0x8059FAA0)
FSDMGR!DllMain: DLL_PROCESS_ATTACH
CertMod.dll not found, using old OEM Trust Model
FileSystem Starting - starting with clean file system
FSDMGR!STOREMGR_Initialize
FSDMGR!InitializeStoreAPI
FSDMGR!MountTable_t::RegisterVolumeName: Registered "StoreMgr" at index 2FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 2 (Name="StoreMgr", MountFlags=0x1)FSDMGR!InitializeROMFileSystem: File System=ROM
OSAXST1: >>> Loading Module 'romfsd.dll' (0x83674B70) at address 0xC0220000-0xC0227000 in Process 'NK.EXE' (0x8059FAA0)
FSDMGR!MountTable_t::RegisterVolumeName: Registered "ROM" at index 3FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 3 (Name="ROM", MountFlags=0x71)FSVOL: Opening existing volume
FSVOL: Volume heap already initialized
FSREG: Mounted ROM portion of boot registry
FSVOL: Creating clean virtual volume
FSVOL: Initializing volume heap
FSREG: Mounted RAM portion of boot registry
FS: Creating signal event ReleaseFSD
FSREG: Unable to read value "Start DevMgr" under HKEY_LOCAL_MACHINE\init\BootVars
FILESYS: Starting boot phase 0.
FSDMGR!STOREMGR_StartBootPhase BootPhase=0 (PrevBootPhase=-1)
FSDMGR: File security disabled.
FSDMGR!AutoLoadFileSystems: CurrentBootPhase=0, LoadFlags=1
FSDMGR!AutoLoadFileSystem: CurrentBootPhase=0, RootKey=System\StorageManager\AutoLoad, FileSystem_t=ObjectStore
FSDMGR!PNPThread: Using PNPUnloadDelay of 4096
FSDMGR!PNPThread: PNPThread starting!
FILESYS: RAM File System FSD_MountDisk registering folder "Object Store"
FSDMGR!MountTable_t::RegisterVolumeName: Registered "Object Store" at index 4FSDMGR!MountTable_t::RegisterVolume: Registered volume at index 4 (Name="", MountFlags=0x46)FILESYS: Starting boot phase 1.
FSDMGR!STOREMGR_StartBootPhase BootPhase=1 (PrevBootPhase=0)
FSDMGR!AutoLoadFileSystems: CurrentBootPhase=1, LoadFlags=1
FSDMGR!AutoLoadFileSystem: CurrentBootPhase=1, RootKey=System\StorageManager\AutoLoad, FileSystem_t=Relfsd
OSAXST1: >>> Loading Module 'relfsd.dll' (0x8364D9AC) at address 0xC0230000-0xC023F000 in Process 'NK.EXE' (0x8059FAA0)
FILESYS: Waiting for bootable file system to be mounted.
FILESYS: Device started.  Boot file system ready.
FSREG: Unable to read value "SystemHiveInitialSize" under HKEY_LOCAL_MACHINE\init\BootVars
FSVOL: Opening existing volume
FSVOL: Volume heap already initialized
FSREG: Mounted ROM portion of system hive
FILESYS: Loading system hive from \Documents and Settings\system.hv.
FSREG: Mounting clean system hive
BuildPath: Documents and Settings
FSVOL: Creating new volume (size=28672 bytes)
FSVOL: Initializing volume heap
FSREG: Taking down boot registry.  Any open keys will be invalid.
FILESYS: Registry in place.
FSREG: Unable to read value "RegistryFlags" under HKEY_LOCAL_MACHINE\init\BootVars
FSVOL: Using system database volume "\Documents and Settings\default.vol"
BuildPath: Documents and Settings
FSVOL: Creating new volume (size=28672 bytes)
FSVOL: Initializing volume heap
FSREG: Unable to read value "RequireCertMod" under HKEY_LOCAL_MACHINE\init\BootVars
FSREG: Unable to read value "NoDefaultUser" under HKEY_LOCAL_MACHINE\init\BootVars
FSREG: Logging in default user.
FSREG: Unable to read value "DefaultUser" under HKEY_LOCAL_MACHINE\init\BootVars
SetCurrentUser: Logging out (nobody), logging in default
BuildPath: Documents and Settings
BuildPath: Documents and Settings\default
FSREG: Mounting ROM portion of user hive
FSVOL: Opening existing volume
FSVOL: Volume heap already initialized
Mounting user hive from \Documents and Settings\default\user.hv
FSREG: Mounting clean user hive
FSVOL: Creating new volume (size=28672 bytes)
FSVOL: Initializing volume heap
FSREG: Unable to read value "RegistryFlags" under HKEY_LOCAL_MACHINE\init\BootVars
FSDMGR!STOREMGR_StartBootPhase BootPhase=2 (PrevBootPhase=1)
FSDMGR!AutoLoadFileSystems: CurrentBootPhase=2, LoadFlags=1
FSDMGR!AutoLoadFileSystems: CurrentBootPhase=2, LoadFlags=2

Initializing Database
DB:Validation: Name already exists DB_notify_events
DB:CeCreateDatabase failed
Filesystem initialized!
FILESYS: Waiting for kernel to be ready to launch apps
InitMUI: Langs=409 0 0 0 0 0
FS: Creating signal event ReleaseFSD
FILESYS: Launching apps
FILESYS: Launching shell.exe
OSAXST1: >>> Loading Module 'coredll.dll' (0x836CA6CC) at address 0x40010000-0x400A1000 in Process 'shell.exe' (0x83645BDC)
OSAXST1: >>> Loading Module 'shell.exe' (0x83645BDC) at address 0x00010000-0x00026000 in Process 'shell.exe' (0x83645BDC)
OSAXST1: >>> Loading Module 'toolhelp.dll' (0x8361D81C) at address 0x400E0000-0x400E6000 in Process 'NK.EXE' (0x8059FAA0)
OSAXST1: >>> Loading Module 'toolhelp.dll' (0x8361D81C) at address 0x400E0000-0x400E6000 in Process 'shell.exe' (0x83645BDC)
FILESYS: Done launching apps
This device has booted 1 times !!!
看来明天要开始搞LCD等显示了。开始驱动,各个击破!

 

posted on 2010-11-05 10:21  gooogleman  阅读(351)  评论(0编辑  收藏  举报