Wednesday, November 26, 2014

Failed to initialize from CECONFIG.H


Today I noticed the following error: Failed to initialize from CECONFIG.H in Windows Compact 7.

I have added a new driver and thought of rebuilding only it. When I right click on it and gave a Rebuild command this error has occurred. When I verified the current configuration it shows as Debug. After that I opened the FLATRELEASE Directory and observed that the folder is empty (contains only three .bif files)

I realized that Clean Sysgen was not done in DEBUG mode.

When we switch the OS Design to Release mode, rebuild for the newly added driver succeeds.

So, the reason seems to be if Clean Sysgen is not performed in a configuration, performing a rebuild of a driver generates this error.

Thank you for visiting.

Thursday, May 22, 2014

Aborts in Windows CE

This article shows how to generate Prefetch Abort, Data Abort and Undefined Exception in Windows CE 6.0 R3

Data Abort

To generate the below exception a NULL pointer is written with some value

unsigned int *pu32Ptr = 23;

Exception 'Data Abort' (4): Thread-Id=08df001a(pth=847b8000), Proc-Id=08de001a(pprc=848059cc) 'Test.exe', VM-active=08de001a(pprc=848059cc) 'Test.exe'
PC=00011020(Test.exe+0x00001020) RA=000110f4(Test.exe+0x000010f4) SP=0002fbb4, BVA=00011040

Prefetch Abort

When a function pointer is assigned with a NULL Pointer Prefetch Abort is generated. This is learned after reading the following blog:

Exception 'Prefetch Abort' (3): Thread-Id=096d005e(pth=847b8000), Proc-Id=096b005e(pprc=848059cc) 'Test_NullFP.exe', VM-active=096b005e(pprc=848059cc) 'Test_NullFP.exe'
PC=00000000(???+0x00000000) RA=0001103c(Test_NullFP.exe+0x0000103c) SP=0002fba4, BVA=00000000

Undefined Instruction

When a function pointer is assigned with a variable's address the below exception is generated
Exception 'Undefined Instruction' (1): Thread-Id=09be0032(pth=8a86e0ac), Proc-Id=09bd0032(pprc=848059cc) 'Test.exe', VM-active=09bd0032(pprc=848059cc) 'Test.exe'
PC=0002fd14(???+0x0002fd14) RA=00011034(Test.exe+0x00001034) SP=0002fbb0, BVA=00000000


Thursday, March 27, 2014

Mutex, Semaphore and Spinlock

Some of the differences between Mutex and Semaphore in Windows CE

  • Is used for Mutual Exclusion
  • It has either TRUE or FALSE state
  • It is possible that if a thread takes the Mutex, then the same thread can unblock on the same Mutex
  • Mutex implements Priority Inheritance

  • It can be either binary or counting semaphore
  • Each time the thread waits on semaphore the count is decremented, once the count reaches zero it can't unblock on the same semaphore even though it is owned by the same thread
  • Semaphore doesn't implements the Priority Inheritance

  • From Windows Compact 7 documentation it shows that spin locks are supported as they have added SMP support