Re: Call standard C functions in device driver

Tech-Archive recommends: Fix windows errors by optimizing your registry



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 -

.



Relevant Pages

  • kernel Doc/ URL corrections
    ... -Documents about softnet driver issues in general can be found ... Additional documentation is available at Don Becker's Linux Drivers site: ... Just force it to be recognized by kernel parameters. ... Keywords: files, VFS, file operations, kernel interface, character ...
    (Linux-Kernel)
  • Re: differences between kernel-tree and kernel-source and kernel image
    ... > will this install the kernel or try to patch an existing 2.6 kernel or ... affix-source - Driver source for the Affix Bluetooth protocol stack for Linux ... atlas-doc - Automatically Tuned Linear Algebra Software,documentation ...
    (Debian-User)
  • Re: eradicating out of tree modules
    ... crashes of "the Linux kernel" caused by some binary-only driver. ... This harms the reputation of Linux as being stable. ... for breaking out-of-tree open source modules is throwing out the baby ...
    (Linux-Kernel)
  • Re[2]: 2.6.16 serious consequences / GPL_EXPORT_SYMBOL / USB drivers of major vendor excluded
    ... is only truly feasible in kernel space. ... Even though people might do realtime DSP things in user space with Linux ... using usbfs directly, no kernel driver needed. ... release your code under this same license. ...
    (Linux-Kernel)
  • Re: 2.6.16-rc2-mm1: crash on suspend
    ... I've got a kernel crash when trying to suspend to disk. ... Mandriva Linux release 2006.1 for i586, ... # ACPI Support ... # Generic Driver Options ...
    (Linux-Kernel)