Monday, June 27, 2011

How to clone the KBDHID client driver into your platform

1. Create a folder for the MyKbdHid under the following directory"
    _PLATFORMROOT\MyPlatform\src\drivers\.
   
2. Copy all files from _PUBLICROOT\Common\Oak\Drivers\USB\class\hid\clients\KBDHID.

3. Rename mouhid.def to MyKbdHid.def.

4. Find the following line of code:

    TARGETNAME=KBDHID
   
   Change the above line of code to the following:
  
    TARGETNAME=MyKbdHid
   
5. Find the following line of code:

    TARGETTYPE=LIBRARY

   Change the above line to the following:

    TARGETTYPE=DYNLINK
   
6. Change the build target type from generating a library file to generating a DLL file.

7. Find the following line of code:

    TARGETDEFNAME=KBDHID

   Change the above line of code to

    TARGETDEFNAME=MyKbdHid
   
8. Add the following line of code near the beginning of the file:

    RELEASETYPE=PLATFORM

9. Find the following line of code:

    WINCETARGETFILE0=$(_COMMONOAKROOT)\lib\$(_CPUINDPATH)\$(TARGETDEFNAME).def

   Change the above line of code to

    WINCETARGETFILE0=$(_TARGETPLATROOT)\lib\$(_CPUINDPATH)\$(TARGETDEFNAME).def

11. Add the following TARGETLIBS entries after the SOURCELIBS line:

TARGETLIBS=\
$(_WINCEROOT)\OSDesigns\YOUR_OSDESIGN\YOUR_OSDESIGN\Wince600\YOUR_PLATFORM_x86\cesysgen\sdk\lib\x86\debug\Coredll.lib \
$(_WINCEROOT)\OSDesigns\YOUR_OSDESIGN\Wince600\YOUR_PLATFORM_x86\cesysgen\sdk\lib\x86\debug\Ceddk.lib \
$(_WINCEROOT)\public\common\oak\lib\x86\debug\hidparse_lib.lib \
$(_SYSGENSDKROOT)\lib\$(_CPUINDPATH)\ddguid.lib \
   
With the above modifications to the Sources file, the cloned MyKbdHid driver source code can be
compiled to generate the mymouhid.dll binary in the build release directory.

12. Add the below lines in platform.reg

; @CESYSGEN IF CE_MODULES_KBDHID[HKEY_LOCAL_MACHINE\Drivers\HID\LoadClients\Default\Default\1_6\Keyboard]
"DLL"="MYKBDHID.DLL"
[HKEY_LOCAL_MACHINE\Drivers\HID\ClientDrivers\Keyboard]
"DLL"="MYKBDHID.DLL"
"Prefix"="KBD"
"IClass"="{CBE6DDF2-F5D4-4e16-9F61-4CCC0B6695F3}"
"RemoteWakeup"=dword:1
"Flags"=dword:00010000
;


13. Add the below lines in platform.reg

    mykbdhid.DLL        $(_FLATRELEASEDIR)\mykbdhid.DLL           NK SHK
@CESYSGEN ENDIF CE_MODULES_KBDHID
 

No comments:

Post a Comment