Monday, October 5, 2009

Who calls all Stream interface function!!! [WinCE]

Hello Developers,
Since so many days, I was thinking that it will be better if everybody know, which function calls all stream interface function.. Like xxx_Init or whatever.

Find out the crisp form of information.

1. XXX_Init - Called by ActivateDeviceEx. If it is BuiltIn driver then BusEnum will call it.
2. XXX_Open - Called by CreateFile which in turn return a handle for the Handle.
3. XXX_Close - Called by CloseHandle.
4. XXX_Read - Called by ReadFile function
5. XXX_Write - Called by WriteFile
6. XXX_IOControl - Called by DeviceIoControl
7. XXX_Seek - Called by SetFilePointer
8. DllEntry - Called by LoadLibrary.
9. XXX_DeInit - DeactivateDevice. Also check for XXX_PreDeinit.
10. XXX_PreClose - Same as case of XXX_PreDeinit
11. XXX_PowerUp - Called by DevMgrPowerOffHandler by Device manager. In turn, OS kernel.

12. XXX_PowerDown - Called by DevMgrPowerOffHandler by Device manager. In turn, OS kernel.



Sunday, October 4, 2009

How Warm Boot is Implemented? [WinCE]

Usually Images stored in Flash media in the following manner:
1. Store eboot(include piece of code which will copy NK.BIN to RAM too) and NK.BIN in FLASH together.
2. At startup, eboot copy nk.bin into RAM and then jump to address (0x800XYYYY address of NK.BIN in RAM) when image is copied.
3. In warm boot, we issue JUMP instruction to PC to start from NK.BIN address at RAM(0x800XYYYY).
Warm boot is use to retain data into image even after reset. Cold boot will restored the system to it's previous state.
4. Before validating the warm boot, re validate flow as well.

Note: the following line

memset((LPVOID)RomHdr.ulRAMStart, 0, RomHdr.ulRAMEnd - RomHdr.ulRAMStart)

Clears the RAM addresses, make sure it is not getting called.

Monday, September 28, 2009

How to get finer control over driver loading!!! [WinCE]

Refer simply the link

Download and follow instruction. Learn how to do it.

Hav fun with WinCE

How to make Passive KITL work!!! [WinCE]

Hi,
Search Just in time debugger in your msdn for WinCE or help to know how to make Passive KITL work.
Note your Active KITL should already be working.

Have fun @ WinCE

Loading a driver using KITL!!! [WinCE]

Apart from loading driver directly from image, you can use KITL to do for you.

Remove driver entry from platform.bib. Add entry into platform.reg.
To make it work, enable SYSGEN_SHELL=1 which supports \Release which used to permit to use _FLATRELEASEDIR.

This should be your registry entry.

[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SAM]
"Dll"="\Release\sample.dll"
"Prefix"="SAM"
"Index"=dword:1
"Order"=dword:1

Have fun with WinCE!!!