Re: Call standard C functions in device driver
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Wed, 5 Nov 2008 08:24:10 -0700
Well, you're wrong about what's in the kernel and what's in user space in
CE5, but that's not relevant.
When you're implementing your device driver, you usually have to implement
the various functions like Init, Open, Read, Write, IoCtl, Close, Deinit,
and the power-handling stuff (or specific functions for other sorts of
drivers like an NDIS driver). If you look in the documentation for those
call implementations, XXX_Init(), XXX_PowerUp(), etc., you'll see what
restrictions apply (look at XXX_PowerUp() for an example). If you're doing
something else, like implementing an interrupt service routine for your
driver, you need to look up that in the help and see what the restrictions
are. The same for an interrupt service thread. There's no global
you-can-never-call-these-functions-from-your-driver list because there can't
be a list like that.
Paul T.
"Marco Wang" <marco.wxy@xxxxxxxxx> wrote in message
news:fc1daf39-17cd-4a68-ae9f-db3b18be2e35@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Nov 4, 10:29 pm, "Bruce Eitman [eMVP]"
<bruce.eitman.nos...@xxxxxxxxxxxxxxxxxxx> wrote:
And of course, you can always try it to find out for yourself.
--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOGhttp://geekswithblogs.net/bruceeitman
Thanks for your guys' responses, but my question is not really
answered.
The biggest difference between Linux and Windows CE is that Linux is
monolithic kernel, in contrast, Windows CE is micro-kernel based. In
Linux, all device drivers, either built within kernel or as a module
driver, are all linked with kernel executable. There is no concept of
DLL here, either. Only symbols (functions, global variables) exported
from kernel can be referred by a device driver.
No idea about Windows CE 6.0, but for CE 5.0, only nk.exe is running
in "real" kernel mode, devices.exe, gwes.exe, filesys.exe are actually
running in user space. In addition, Windows CE 5.0 uses a flat virtual
memory model, which is also different with Linux.
My understanding in general is that a Windows CE device driver can
call most of standard C functions (I mean POSIX C functions which are
available on Win32 platform) and Win32 APIs as long as it is in user
space context at most of time, plus it is "compiled" and "linked" as
DLL already. Certainly there are special functions for device drivers
only, for instance physical memory access, virtual memory access, etc.
However, I don't find any document from MSDN which emphasizes what API
a device driver should NOT call in specific circumstance.
Thanks,
Marco Wang
EuroTech Inc.www.EuroTech.com
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in messagenews:elOJt2cPJHA.2312@xxxxxxxxxxxxxxxxxxxxxxx
Version of Windows CE?
Generally, some standard Win32 functions can be called in some
situations
from drivers, yes. There are also situations where you should not be
calling some or all Win32 functions. Those are documented in the help.
If you have a specific question, you're a lot more-likely to get a
clear,
simple answer...
Please read:
http://guruce.com/blogpost/howtoaskquestionsonnewsgroups
Paul T.
"Marco Wang" <marco....@xxxxxxxxx> wrote in message
news:2323df68-f2e8-4d9e-b7d5-037befbeaf0b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
I get confused with a fundamental concept regarding Windows CE device
driver. In Linux, we can't call standard C functions because Linux
kernel has no concept of C runtime library. Then how about Windows CE,
is it allowed to call C functions in a kernel mode Windows CE device
driver?
Thanks,
Marco Wang
.
- References:
- Call standard C functions in device driver
- From: Marco Wang
- Re: Call standard C functions in device driver
- From: Paul G. Tobey [eMVP]
- Re: Call standard C functions in device driver
- From: Bruce Eitman [eMVP]
- Re: Call standard C functions in device driver
- From: Marco Wang
- Call standard C functions in device driver
- Prev by Date: Re: Cryptography library with 3DES
- Next by Date: Re: Call standard C functions in device driver
- Previous by thread: Re: Call standard C functions in device driver
- Next by thread: Re: Call standard C functions in device driver
- Index(es):
Relevant Pages
|