none
OEMGLOBAL Modification RRS feed

  • Question

  • Hi all,

    I want to add a function pointer to OEMGLOBAL structure defined in oemglobal.h. Windows CE 6.0 allows private code modification. But I can't make sure whether this modification cause any unexpected result. Do you mind if I modify OEMGLOBAL?

    Thanks a lot for your helps and explanations,

    Yasemin

    Wednesday, January 11, 2012 1:16 PM

Answers

  • The solution looks a bit complicated to me and far from being clean, sorry...

    Does your device  includes a HW watchdog? You may use it in combination with the kernel watchdog framework (see http://lcalligaris.wordpress.com/2010/11/04/31/).

    Notice that using only the kernel watchdog framework (no HW watchdog) may not be enough in your case since the kernel will use IOCTL_HAL_REBOOT to reset the device


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    • Marked as answer by yaseminyilmaz Thursday, January 12, 2012 10:09 AM
    Wednesday, January 11, 2012 3:24 PM

All replies

  • I do not think that the kernel makes assumptions on the size of OEMGLOBAL which, by the way, differs between different CPU architectures. Anyway adding a function pointer to OEMGLOBAL (%_WINCEROOT%\PUBLIC\COMMON\OAK\INC\oemglobal.h) requires modification to %_WINCEROOT%\PRIVATE\WINCEOS\COREOS\NK\OEMMAIN\oemglobal.c and a rebuild of the whole kernel (which you'll modify somehow to call the new function I imagine). Not only: since oemglobal.h is included here and there the modification may be propagated in the whole %_WINCEROOT%\PLATFORM folder. Of course you can clone the code before modifying it but it's seems a bit too much...

    What are you trying to achieve exactly?


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    Wednesday, January 11, 2012 1:46 PM
  • Thanks a lot to you.

    I want to call a new function defined in OAL BSP source through kernel private code.

    Windows CE system sometimes crashes so I want to restart the device as a workaround. I've added NKReboot call to PrintException in kernel private code. But the call IOTCL_HAL_REBOOT sometimes could not be arrived to OAL BSP source so the device could not be reset. I've thought to call the function defined in OAL BSP instead of IOCTL_HAL_REBOOT. Is the modification of oemglobal the preferred method to succeed this?

    Wednesday, January 11, 2012 2:19 PM
  • I've modified oemglobal.c, oemglobal.h and bcoemglobal.h and rebuilt oemmain project (PRIVATE\WINCEOS\COREOS\NK\OEMMAIN) then kernel project (PRIVATE\WINCEOS\COREOS\NK\KERNEL) and then clean sysgen.  But the system remains with following message on startup. Can the rebuild order be incorrect?

    Booting kernel with clean memory configuration:
    Memory Sections:
    [0] : start: 822b3000, extension: 00004000, length: 01d49000

    Wednesday, January 11, 2012 3:21 PM
  • The solution looks a bit complicated to me and far from being clean, sorry...

    Does your device  includes a HW watchdog? You may use it in combination with the kernel watchdog framework (see http://lcalligaris.wordpress.com/2010/11/04/31/).

    Notice that using only the kernel watchdog framework (no HW watchdog) may not be enough in your case since the kernel will use IOCTL_HAL_REBOOT to reset the device


    Luca Calligaris lucaDOTcalligarisATeurotechDOTcom www.eurotech.com Check my blog: http://lcalligaris.wordpress.com
    • Marked as answer by yaseminyilmaz Thursday, January 12, 2012 10:09 AM
    Wednesday, January 11, 2012 3:24 PM
  • Yes, our device has a hardware watchdog. But kernel continues to call pfnRefreshWatchDog when the system crashes so watchdog reset can not be achieved based on my observations. So I've switched to this approach. But I will search more reliable method. Thanks
    Wednesday, January 11, 2012 3:32 PM