R: Drivers for small computers

Download Windows CE platform Builder.

http://msdn2.microsoft.com/en-
us/embedded/aa714348.aspx

You will find a lot of device driver source
code and documentation.

PaoloC

----Messaggio originale----
Da: ian.
xxxxx@dsl.pipex.com
Data: 8-mag-2007 3.56 PM
A: “Windows System
Software Devs Interest List”
Ogg: [ntdev] Drivers
for small computers

This message may be a little off topic.

I have a
virtual cd/dvd rom driver that works well on XP and Vista as specified.

Now I am asked to investigate writing a version for small computers,
hand
helds, big phones etc.

I assume it is possible to add third
party drivers to these devices. If it is
not please tell me now.

Initially I will be writing for Windows CE but it is hoped that the
same can be
done for Symbian and other exotica that maybe out there.

I assume that the driver model I will be writing to will be
substantially
different even for WindowsCE and that I may need to
provide some class or even
file functions before it will work.

Can
somebody suggest good resources for Windows CE (or Symbian) driver
development.

I am currently ignorant so most suggestions are helpful.




Questions? First check the Kernel Driver FAQ at http://www.
osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server
section of OSR Online at http://www.osronline.com/page.cfm?
name=ListServer

xxxxx@dsl.pipex.com wrote:

This message may be a little off topic.

That never stopped us before.

I have a virtual cd/dvd rom driver that works well on XP and Vista as specified.

Now I am asked to investigate writing a version for small computers, hand
helds, big phones etc.

I assume it is possible to add third party drivers to these devices. If it is
not please tell me now.

Yes, it is. Often, such drivers are built-in to the system image that
gets burned in to the device, but installable drivers are also
possible. You don’t see quite as many installable drivers, because such
devices have such limited expansion potential.

Initially I will be writing for Windows CE but it is hoped that the same can be
done for Symbian and other exotica that maybe out there.

I assume that the driver model I will be writing to will be substantially
different even for WindowsCE and that I may need to provide some class or even
file functions before it will work.

Yes, Windows CE at the kernel level is very different from XP. However,
in many ways, CE is more fun than XP at that level. Essentially, the
line between drivers and applications is much fuzzier. Drivers are
basically Win32 apps that happen to have additional privileges.

Can somebody suggest good resources for Windows CE (or Symbian) driver
development.

You can download a 120-day evaluation edition of Windows CE Platform
Builder from Microsoft, www.microsoft.com/windowsce. Platform Builder
includes the source code for much of the operating system; the sample
drivers can give you the hints you need.

I don’t know anything about Symbian, I’m afraid. It looks like there is
a DDK, but you may need to pay for a membership. Check
developer.symbian.com.


Tim Roberts, xxxxx@probo.com
Providenza & Boekelheide, Inc.

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Tim Roberts[SMTP:xxxxx@probo.com]
Reply To: Windows System Software Devs Interest List
Sent: Tuesday, May 08, 2007 7:11 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] Drivers for small computers

> I assume that the driver model I will be writing to will be substantially
> different even for WindowsCE and that I may need to provide some class or even
> file functions before it will work.

Yes, Windows CE at the kernel level is very different from XP. However,
in many ways, CE is more fun than XP at that level. Essentially, the
line between drivers and applications is much fuzzier. Drivers are
basically Win32 apps that happen to have additional privileges.

Yep, CE driver resemble more w9x VxDs than NT/XP drivers. On the other hand, development is much easier and may even make more sense that writing NT driver because there is direct mapping between Win32 calls and driver entrypoints. Also, it is simpler as there isn’t overlapped access, pending IRPs and so on.

What can be harder is debugging. No problem on platforms generated with PB but there can be a problem with 3rd party devices. Maybe there is a way how to attach debugger to a driver running at a PDA but I ended with own debug monitor which captures traces from my code and sends them to the PC via RAPI. It was real fun :slight_smile:

> Can somebody suggest good resources for Windows CE (or Symbian) driver
> development.

You can download a 120-day evaluation edition of Windows CE Platform
Builder from Microsoft, www.microsoft.com/windowsce. Platform Builder
includes the source code for much of the operating system; the sample
drivers can give you the hints you need.

Actually, OS code is the only good info available. Docs is very limited comparing to WDK, for example.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]

I know nothing on Symbian except gossips, and the gossips are that this is
a very primitive OS - like MS-DOS with single-tasking graphics engine over it.
Maybe this is wrong.
The OS is very old, was used even in the glorious old Nokia 3210 cellphone
of 1999-2000 - pre-LiIon power cells, heavy and required to be fully discharged
before recharge, no vibro, black and white, very Spartan set of features.

About Windows CE:

  • driver model (except NDIS) is 100% different from Windows there. NDIS is
    99% same, so are the application’s Win32 APIs.
  • drivers are DLLs loaded to devices.exe service process.
  • no thing like IRQL in CE, so, drivers are allowed to use fopen/fprintf
    even from critical paths like NDIS send path
    . Sometimes such debug output is
    the only way of debugging.
  • debugging on a real device is hard. The real device usually have no
    hardware for debugger connection, and the debugger target support is not
    compiled in their build of WinCE. Applications can be debugged using
    ActiveSync/eVC++, but drivers cannot - this debugging facility does not allow
    to attach to devices.exe. So, traces by fprintf is the only chance.
  • another chance is the emulator included to eVC++ and PB. You build for
    the emulator and debug on the emulator. After this, there are great chances the
    code will work OK on the real device.
  • CE’s driver model is documented in MSDN library.
  • Platform Builder is not mandatory. Nevertheless, to do step-by-step
    debugging of devices.exe in the emulator, you need PB. eVC++ does not support
    this. It only has app-level debug feature, working on real hardware via
    ActiveSync or on the emulator. This feature cannot debug devices.exe. PB has
    the full system-level debug feature (KITL). Unfortunately, KITL works on either
    the emulator or on hardware which has special debugging connection hardware
    facility
    . Devices shipped to the market by the vendors usually have no such
    facility.
  • Platform Builder is mainly for people who develop their own CE-based
    firmware for their own devices
    , not for people who write add-ons to, say,
    Windows Mobile or its smartphone version.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

Symbian is pretty off-topic for this group. I’ve done quite a bit of work in
this OS. It is primarily phone oriented and designed to run from ROM. It is
still under development and is actually fairly feature rich. It supports
color and all normal smartphone features. Driver development is pretty much
restricted large corporations as you need access to what the OEM Adaptation
Kit (OAK). This is kernel level source and subject to some truly
bloodthirsty NDA requirements.

Historically it’s an outgrowth of Sinclair’s EPOC OS, but it has been
extensively upgraded over the years. Information for the curious is at
Symbian.org

I personally prefer CE, but Symbian works pretty well in the phone space.

Sam Robinson

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Maxim S. Shatskih
Sent: Thursday, May 10, 2007 7:58 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Drivers for small computers

I know nothing on Symbian except gossips, and the gossips are that this
is
a very primitive OS - like MS-DOS with single-tasking graphics engine over
it.
Maybe this is wrong.
The OS is very old, was used even in the glorious old Nokia 3210
cellphone
of 1999-2000 - pre-LiIon power cells, heavy and required to be fully
discharged
before recharge, no vibro, black and white, very Spartan set of features.

About Windows CE:

  • driver model (except NDIS) is 100% different from Windows there. NDIS
    is
    99% same, so are the application’s Win32 APIs.
  • drivers are DLLs loaded to devices.exe service process.
  • no thing like IRQL in CE, so, drivers are allowed to use
    fopen/fprintf
    even from critical paths like NDIS send path
    . Sometimes such debug output
    is
    the only way of debugging.
  • debugging on a real device is hard. The real device usually have no
    hardware for debugger connection, and the debugger target support is not
    compiled in their build of WinCE. Applications can be debugged using
    ActiveSync/eVC++, but drivers cannot - this debugging facility does not
    allow
    to attach to devices.exe. So, traces by fprintf is the only chance.
  • another chance is the emulator included to eVC++ and PB. You build for
    the emulator and debug on the emulator. After this, there are great chances
    the
    code will work OK on the real device.
  • CE’s driver model is documented in MSDN library.
  • Platform Builder is not mandatory. Nevertheless, to do step-by-step
    debugging of devices.exe in the emulator, you need PB. eVC++ does not
    support
    this. It only has app-level debug feature, working on real hardware via
    ActiveSync or on the emulator. This feature cannot debug devices.exe. PB has
    the full system-level debug feature (KITL). Unfortunately, KITL works on
    either
    the emulator or on hardware which has special debugging connection hardware
    facility
    . Devices shipped to the market by the vendors usually have no
    such
    facility.
  • Platform Builder is mainly for people who develop their own CE-based
    firmware for their own devices
    , not for people who write add-ons to, say,
    Windows Mobile or its smartphone version.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer

In my experience, it is good to create CE image for PC and develop driver using Platform Builder connected via KITL over Ethernet. This way real hardware can be used, instead of emulator. Evaluation PB version is quite sufficient for this purpose.

As for debugging on the real device, traces are the only way but fprintf can be too slow. When I started with it I was susprised there is no equivallent of DebugView; at least I haven’t found any. So I developed my own tool which allows to transfer traces via RAPI (ActiveSync). Driver uses my library which handles traces similar way as OutputDebugString() at NT; shared memory and mutexes. PC uses RAPI to start trace monitor at the device and it captures traces from shared memory and sends them to PC where can be saved to file or displayed using DebugView. This way I can have real time output from drivers and apps at once.

The only problem with above approach is debugging power transitions because RAPI connection is broken when the device is suspended. Power paths are restricted; IIRC file system can’t be accessed from them. I use local traces monitor for this purpose which saves traces to memory buffer. Remote monitor then transfers all captured data to PC when RAPI connection is reestablished.

Best regards,

Michal Vodicka
UPEK, Inc.
[xxxxx@upek.com, http://www.upek.com]


From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of Maxim S. Shatskih[SMTP:xxxxx@storagecraft.com]
Reply To: Windows System Software Devs Interest List
Sent: Thursday, May 10, 2007 1:57 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] Drivers for small computers

I know nothing on Symbian except gossips, and the gossips are that this is
a very primitive OS - like MS-DOS with single-tasking graphics engine over it.
Maybe this is wrong.
The OS is very old, was used even in the glorious old Nokia 3210 cellphone
of 1999-2000 - pre-LiIon power cells, heavy and required to be fully discharged
before recharge, no vibro, black and white, very Spartan set of features.

About Windows CE:

  • driver model (except NDIS) is 100% different from Windows there. NDIS is
    99% same, so are the application’s Win32 APIs.
  • drivers are DLLs loaded to devices.exe service process.
  • no thing like IRQL in CE, so, drivers are allowed to use fopen/fprintf
    even from critical paths like NDIS send path
    . Sometimes such debug output is
    the only way of debugging.
  • debugging on a real device is hard. The real device usually have no
    hardware for debugger connection, and the debugger target support is not
    compiled in their build of WinCE. Applications can be debugged using
    ActiveSync/eVC++, but drivers cannot - this debugging facility does not allow
    to attach to devices.exe. So, traces by fprintf is the only chance.
  • another chance is the emulator included to eVC++ and PB. You build for
    the emulator and debug on the emulator. After this, there are great chances the
    code will work OK on the real device.
  • CE’s driver model is documented in MSDN library.
  • Platform Builder is not mandatory. Nevertheless, to do step-by-step
    debugging of devices.exe in the emulator, you need PB. eVC++ does not support
    this. It only has app-level debug feature, working on real hardware via
    ActiveSync or on the emulator. This feature cannot debug devices.exe. PB has
    the full system-level debug feature (KITL). Unfortunately, KITL works on either
    the emulator or on hardware which has special debugging connection hardware
    facility
    . Devices shipped to the market by the vendors usually have no such
    facility.
  • Platform Builder is mainly for people who develop their own CE-based
    firmware for their own devices
    , not for people who write add-ons to, say,>
    Windows Mobile or its smartphone version.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com


Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer