Here’s the thing with the compiler/linker in terms of drivers:
Market share of UM applications which use them: 99%
Market share of KM drivers which use them: 1%
In terms of priorities of new features and priorities, you can see who
wins. With that said, we are getting the compiler folks to listen to
our issues and what we want solved, but it’s a slow process.
D
(looking at the driver via link /dump tells you about code sections but
not about runtime usage. For instance, most of serial.sys is not
pageable, yet the entire drive is paged out if you are not using a COM
port.)
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Jan Bottorff
Sent: Sunday, July 31, 2005 2:30 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] C++ and WDF
Have you tried to mark any of templated classes as PAGEable? Or
particular member functions as such? I have had zero luck in getting
that to work on a deterministic basis.
I could imagine this is a problem area for some drivers. It’s exactly
this
kind of issue I’d love to discuss someplace without the discussion
turning
into a religious war. As the last two drivers I’ve written in C++ used
tens
of megabytes of non-paged pool, I avoided any issues of controlling code
segment placement by making all code non-pageable. If I were writing a
WDM
driver that had to run on very small memory W9x systems, the reduced
flexibility of controlling code placement in C++ might be a serious
problem.
Out of curiosity, I looked at a couple drivers on the XP system I’m
writing
this message from. The largest driver is the NVidia video driver (.text
size
of over 2 Mbytes), and see that less than 2% of the code isn’t resident.
The
NTFS driver on the other hand had only 96 kbytes of resident code and
over
400 kbytes of paged code. For the TCP.SYS driver, 80% is resident.
I would think some constructive feedback to the DDK compiler group at
Microsoft would be about better control of code segment placement for
C++.
Or perhaps it’s a documentation/education issue, and the compiler and
linker
already have features that would allow you control.
Controlling the layout of the .SYS file via an external layout file
given to
the linker sounds most attractive to me. Sometimes a driver uses
platform
neutral code modules which I don’t want to (or can’t) insert MS specific
compiler directives into. In this case, even for a driver totally in C,
I
have limited control over code pageability.
Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
You are currently subscribed to ntdev as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com