none
Is it Correct Calling the KERNELIOCONTROL from appliaction in winec7 RRS feed

  • General discussion

  • Hi,

    Is it correct practise to call the kerneliocontol() from the application in winec 7.


    Friday, May 24, 2013 4:19 PM

All replies

  • Its always better to write a simple driver that calls the KernelIOControl, and your application calls the Driver API.

    Also with this little information, nothing can be clarified. Provide some detailed information, Why you need IOCTL to be called from APP? What the IOCTL will do?


    Jeslin Paul

    Friday, May 24, 2013 5:39 PM
  • By default, WinCE7 supports only few IOControls call from application.

    That are:

    IOCTL_HAL_GET_CACHE_INFO
    IOCTL_HAL_GET_DEVICE_INFO
    IOCTL_HAL_GET_DEVICEID
    IOCTL_HAL_GET_UUID
    IOCTL_PROCESSOR_INFORMATION

    See following link for details, And to know what you have to do to call other IOControls from application:

    WinCE: User mode IOControls: BruceEitman

    How to clone public code?:

    WinCE: How to clone public code?: BruceEitman

    --Keshava G N


    Keshava G N Member - Technical (Software), iWave Systems, Bangalore <http://iwavesystems.com> mailto: keshavagn AT iwavesystems DOT com

    Saturday, May 25, 2013 3:50 AM
  • Hi Jeslin,

    Thanks for the reply I am doing warm boot from my app using kerneliocontrol ().

    the problem im facing is a bit confusing.

    The call is forwared to oalioctl.dll in the oal layer which further calls the ioctl handler function defined in the oal layer that is oal.lib. in the handler function i,m calling the SetSystemPowerState( NULL, POWER_STATE_RESET, POWER_FORCE ); which is not able to do warm boot i mean to say at some point of time along the flow it is waiting.but the device is not hanging.

    One more observation is when i call the SetSystemPowerState( NULL, POWER_STATE_RESET, POWER_FORCE ); at the switch case in the oalioctl.dll  instead of routing the call to ioclt handler function in the oal.lib it seems to be working fine.

    thanks in advance

    Saturday, May 25, 2013 7:41 AM
  • As long as your BSP handles the call correctly it's ok to call KernelIoControl call from
    Application. This function is provided solely to allow your device driver or application to communicate with an OAL and its specific functionality.
    Second part of your question is bit confusing. Why do you call the SetSystemPowerState () from the kernel (OAL.lib) that's not recommended. In kernel you have the full control of hardware and you can directly reset the device depending on the
    capability of your hardware without invoking the SetSystemPowerState().
    SetSystemPowerState()
    will redirect the call to the PM driver and PM driver will invoke the KernelIoControl for rebooting the device.
    Why don’t you call the SetSystemPowerState () API from your application itself to achieve
    the same functionality?

    Regards,

    Rakesh.

    Saturday, May 25, 2013 11:00 AM
  • when  i Call the Setsystempowerstate from the oalioctl.dll which is cloned from public oal folder 

    setsystempowerstate() is working fine. warm boot happens fine. Let me know can i call the setsysytempowersate from oalioctl.dll

    Saturday, May 25, 2013 11:47 AM
  • When I Call the Setsystempowerstate from the oalioctl.dll which is cloned from public oal folder setsystempowerstate() is working fine. warm boot happens fine. Let me know can i call the setsystempowerstate from oalioctl.dll.

    There is no meaning.

    Anyway, as Rakesh suggested,

    You can call the SetSystemPowerState() API from your application itself.

    --Keshava G N


    Keshava G N Member - Technical (Software), iWave Systems, Bangalore <http://iwavesystems.com> mailto: keshavagn AT iwavesystems DOT com


    • Edited by Keshava GN Saturday, May 25, 2013 11:58 AM
    Saturday, May 25, 2013 11:58 AM
  • the issue is like they say it has to work with application via ioctl with warmboot.
    Saturday, May 25, 2013 12:34 PM
  • As rakesh said i should not be using setsystempowerstate in oal.lib . what is the reason behind this.could you share me a link that explains this .it would be of great help
    Saturday, May 25, 2013 12:36 PM
  • As rakesh said i should not be using setsystempowerstate in oal.lib . what is the reason behind this.could you share me a link that explains this .it would be of great help

    You NEED NOT call it in oal.lib. Because you can directly call from app..


    Keshava G N Member - Technical (Software), iWave Systems, Bangalore <http://iwavesystems.com> mailto: keshavagn AT iwavesystems DOT com


    • Edited by Keshava GN Saturday, May 25, 2013 12:44 PM
    Saturday, May 25, 2013 12:43 PM