How to exporting pointer from kernel - Windows CE

This is a discussion on How to exporting pointer from kernel - Windows CE ; I am running WinCE 4.1 on a CEPC (x86). I am creating a global pointer in PRIVATE\WINCEOS\COREOS\NK\KERNEL\sysinit.c. I want this pointer to be seen by other device drivers for example the NE2000 ethernet drive. I am doing this just debug ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: How to exporting pointer from kernel

  1. How to exporting pointer from kernel

    I am running WinCE 4.1 on a CEPC (x86). I am creating a global pointer in
    PRIVATE\WINCEOS\COREOS\NK\KERNEL\sysinit.c. I want this pointer to be seen
    by other device drivers for example the NE2000 ethernet drive. I am doing
    this just debug purposes.
    How do I go about doing this?

    Thanks
    Aravindh



  2. Re: How to exporting pointer from kernel

    You don't. It's a separate process not a device driver. What are you trying
    to do? (Big Picture)

    --
    Steve Maillet (eMVP)
    Entelechy Consulting
    smaillet_AT_EntelechyConsulting_DOT_com



  3. Re: How to exporting pointer from kernel

    The pointer in sysinit.c points to a structure containing function pointers.
    I want to call those functions in the NE2000 driver.

    Aravindh

    "Steve Maillet (eMVP)" wrote in message
    news:%2377kr0VUDHA.1588@TK2MSFTNGP11.phx.gbl...
    > You don't. It's a separate process not a device driver. What are you

    trying
    > to do? (Big Picture)
    >
    > --
    > Steve Maillet (eMVP)
    > Entelechy Consulting
    > smaillet_AT_EntelechyConsulting_DOT_com
    >
    >




  4. Re: How to exporting pointer from kernel

    You can't do that. Why do you want to? What are you trying to do? [Big
    Picture]

    --
    Steve Maillet (eMVP)
    Entelechy Consulting
    smaillet_AT_EntelechyConsulting_DOT_com



  5. Re: How to exporting pointer from kernel

    I am loading WinCE on top of our custom firmware for CEPC. There are some
    firmware runtime functions which have been made visible in sysinit.c i.e. in
    the kernel. The modified NE2000 driver has to call these functions to do IO.
    How do I make these functions visible to the NE2000 driver? For example
    VirtualAlloc is being called in many drivers. I want to do the same for my
    functions.

    Aravindh
    "Steve Maillet (eMVP)" wrote in message
    news:uU6LMiWUDHA.940@TK2MSFTNGP11.phx.gbl...
    > You can't do that. Why do you want to? What are you trying to do? [Big
    > Picture]
    >
    > --
    > Steve Maillet (eMVP)
    > Entelechy Consulting
    > smaillet_AT_EntelechyConsulting_DOT_com
    >
    >




  6. Re: How to exporting pointer from kernel

    1) You cannot ship a modified version of the kernel. (SYSINIT.C is part of
    the private shared source code. re-read the license that comes with that)
    2) There isn't any mechanism for adding new APIs to the kernel (Or at least
    not one that doesn't involve modifying the kernel - see #1 above)
    3) You can't just call into arbitrary addresses. Windows CE uses a protected
    Virtual Address system (Like the desktop systems have since NT and Win9x) So
    even if you manage to map an address to call to it won't have execute
    permissions to run code.
    4) The proper way to provide extra capabilities is through OEMIoControl in
    the OAL which is accessible to applications via KernelIoControl(). You can
    use the virtual mapping system either dynamically or via static mapping to
    access any device or hardware in the system from within the OAL or a driver.
    So there is no need to place code outside the OAL to access your hardware.


    --
    Steve Maillet (eMVP)
    Entelechy Consulting
    smaillet_AT_EntelechyConsulting_DOT_com



  7. Re: How to exporting pointer from kernel

    Note that depending on what it is you are trying to do (You still haven't
    provided much of a big picture!) a Device driver might be more appropriate
    then KernelIoControl(). In general you should resist putting things in the
    OAL and try to put as much as possible into device drivers to keep a clean
    separation in the design.

    --
    Steve Maillet (eMVP)
    Entelechy Consulting
    smaillet_AT_EntelechyConsulting_DOT_com



  8. Re: How to exporting pointer from kernel

    > 1) You cannot ship a modified version of the kernel. (SYSINIT.C is part of
    > the private shared source code. re-read the license that comes with that)


    This is just a prototype to prove a point. It is never going to be shipped.

    > 2) There isn't any mechanism for adding new APIs to the kernel (Or at

    least
    > not one that doesn't involve modifying the kernel - see #1 above)


    So what kernel modifications should I do?

    > 3) You can't just call into arbitrary addresses. Windows CE uses a

    protected
    > Virtual Address system (Like the desktop systems have since NT and Win9x)

    So
    > even if you manage to map an address to call to it won't have execute
    > permissions to run code.


    The way I am doing it is by VirtualAlloc ing some space and then doing
    VirtualCopy on phy addresses that containg the firmware code. I have
    temporarily created PDE for those addresses. I clear the PDEs once I have
    finished VirtualCopy ing. All this happens in early boot. Partly in init.asm
    and sysinit.c.
    I know it sounds strange but it does work. I am able to call those
    functions.

    Aravindh



+ Reply to Thread