Re: Call standard C functions in device driver
- From: Henrik Viklund <henrik.viklund@xxxxxxxxx>
- Date: Wed, 5 Nov 2008 09:40:19 -0800 (PST)
Marco,
Not that I'm super familiar with linux drivers but since I dine
regularly with our full-blood-linux-guru there's been a fair share of
mutual indoctrination going on the past few months. My take is that
compared to a monolithic kernel like linux the windows ce microkernel
architecture give the driver developers access to pretty much any OS
functionality from inside the device driver threads. You're not really
limited to any kernel-only API, in theory you can do pretty much what
you can do from an application. For instance you can pop up a user
interface from inside an interrupt service thread -in reality however,
that is probably not a wise thing to do. So, even though there are
some restrictions on what can be done from inside a driver I'd say
that it is more a matter of using good judgement when deciding how to
architect your driver.
Henrik Viklund
Prevas AB
On 5 Nov, 11:24, Marco Wang <marco....@xxxxxxxxx> wrote:
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@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
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- Dölj citerad text -
- Visa citerad text -
.
- Follow-Ups:
- Re: Call standard C functions in device driver
- From: Marco Wang
- Re: Call standard C functions in device driver
- 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: Call standard C functions in device driver
- Next by Date: CE 6.x on Pico-ITX
- 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
|