build environment for 64 bit driver - general questions

Hello all,
does anybody have some working project file for Visual Studio 2003 / 2005
used to compile x86-64bit WDM driver? Is there any sample project
available somewhere?

Issues I am interested in are:

  • how to define the driver entry point (for 32bit was used
    driver_entry_function@8, but it doesnt seem to work with same settings
    under 64bit driver, neither @16 do)
  • what optimisations, discovered parameters for compiler are good to use
    for driver
  • what calling conventions are you using to declare these and other (eg
    PNP) functions?
  • what method are you using to use assembler code (eg which external
    compiler)?

Thanx!
Olav

Use Ddkbuild, the approach of a project file does not work for 32 bit or 64
bit. The idiots who do this should be flogged to the edge of their lives.
I have gone in to multiple customers who have gotten sold this concept, and
fixed their problems by just converting them to a real build environment.
Using the visual studio stupidity you:

  1. Create a unmaintable mess, since Micosoft has been known to change
    the options
  2. Introduce corner cases, since it likely you will get something
    wrong
  3. Disable the use of tools such as the driver version of PreFast and
    Static Driver Verifier
  4. Make it impossible to submit a bug to Microsoft on the DDK, since
    you are playing by the rules

If you want to do crap like this, stay out of the Windows kernel.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Remove StopSpam from the email to reply

----- Original Message -----
From: “Olav”
To: “Windows System Software Devs Interest List”
Sent: Thursday, June 16, 2005 3:01 AM
Subject: [ntdev] build environment for 64 bit driver - general questions

Hello all,
does anybody have some working project file for Visual Studio 2003 / 2005
used to compile x86-64bit WDM driver? Is there any sample project
available somewhere?

Issues I am interested in are:
- how to define the driver entry point (for 32bit was used
driver_entry_function@8, but it doesnt seem to work with same settings
under 64bit driver, neither @16 do)
- what optimisations, discovered parameters for compiler are good to use
for driver
- what calling conventions are you using to declare these and other (eg
PNP) functions?
- what method are you using to use assembler code (eg which external
compiler)?

Thanx!
Olav


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

You are currently subscribed to ntdev as: unknown lmsubst tag argument: ‘’
To unsubscribe send a blank email to xxxxx@lists.osr.com

This idiot uses a project file for both 32-bit and 64-bit, and
it works fine. As he pointed out in a recent thread, it’s way
more important to achieve commonality between driver and
application than to follow the party line 100% percent. About
the specific points in this post,

  1. Driver building *is* a nearly unmaintainable mess today, and
    the judicious use of an IDE goes a long way towards alleviating
    it.

  2. If you do your job right you will not get any more wrong than
    anyone elsewhere. No offense intended, but I for myself trust my
    hand more than anyone else’s, including people who work for
    Microsoft.

  3. Nothing replaces a thorough, comprehensive and deep
    understanding of the machine architecture, its hardware, its
    instruction set, the peripheral(s) you’re trying to support, the
    C or C++ language you use to develop your code, and the code you
    write. If you achieve that, tools such as Driver Verifier or
    PreFast can be quite irrelevant: do you job thoroughly and
    carefully and you don’t need props.

  4. It’s not my job to debug Microsoft’s code. Sorry, dudes, if
    you choose to do that, that’s your prerogative, but don’t demand
    it. Furthermore, as I see it, the only bit of the DDK that
    should *really* be necessary are the include files and possibly
    a library or two - everything else is superfluous and Occam’s
    Razor alone tells us to be very stingy in using it. These things
    are like taxes: you pay them if you must, but you pay the least
    possible and you grumble a lot when you need to. Because, again,
    no offense intended, I trust my hand better than anyone else’s,
    including the people who put the DDK together.

And what do you know ? My software works, and it has been
working for a long, long while.

Now, one point. One reason why driver writing today is, and I
capitalize for emphasis,

THERE IS NO COMMON RUNTIME SYSTEM THAT PERFORMS WELL BOTH IN
RING 3 AND RING 0,

and, also,

THERE IS NO COMMON COMPILER THAT CAN GENERATE CONSISTENT CODE
FOR BOTH RING 0 AND RING 3,

and,

MANY OF THE VERY NICE INDUSTRY-STRENGTH DEVELOPMENT TOOLS
ROUTINELY USED BY APPLICATION WRITERS DO NOT SUPPORT KERNEL
DEVELOPMENT,

and finally,

THE CONCEPT OF WIZARD-DRIVEN PROGRAM GENERATION AND DEVELOPMENT,
COMMONPLACE IN MFC AND IN .NET, IS NOT SUPPORTED IN DRIVERLAND.

The issue isn’t that kernel development is “special” or “harder”
in any way; it’s just that the powers of that be (Microsoft, are
you listening?) do not support kernel development to the same
extent they support applications development. Hence the addons,
and what do you know ? They’re very, very welcome, at least to
some of us idiots. And again, our software tends to work just as
well as anyone else’s.

So, dudes, there’s more than one way to skin a cat, and there’s
more than one way in this profession of ours to act like an
idiot.

Alberto.

----- Original Message -----
From: “Don Burn”
To: “Windows System Software Devs Interest List”

Sent: Thursday, June 16, 2005 6:43 AM
Subject: Re: [ntdev] build environment for 64 bit driver -
general questions

> Use Ddkbuild, the approach of a project file does not work for
> 32 bit or 64 bit. The idiots who do this should be flogged to
> the edge of their lives. I have gone in to multiple customers
> who have gotten sold this concept, and fixed their problems by
> just converting them to a real build environment. Using the
> visual studio stupidity you:
>
> 1. Create a unmaintable mess, since Micosoft has been
> known to change the options
> 2. Introduce corner cases, since it likely you will get
> something wrong
> 3. Disable the use of tools such as the driver version of
> PreFast and Static Driver Verifier
> 4. Make it impossible to submit a bug to Microsoft on the
> DDK, since you are playing by the rules
>
> If you want to do crap like this, stay out of the Windows
> kernel.
>
> Don Burn (MVP, Windows DDK)
> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> Remove StopSpam from the email to reply
>
>
>
> ----- Original Message -----
> From: “Olav”
> To: “Windows System Software Devs Interest List”
>
> Sent: Thursday, June 16, 2005 3:01 AM
> Subject: [ntdev] build environment for 64 bit driver - general
> questions
>
>
> Hello all,
> does anybody have some working project file for Visual Studio
> 2003 / 2005
> used to compile x86-64bit WDM driver? Is there any sample
> project
> available somewhere?
>
> Issues I am interested in are:
> - how to define the driver entry point (for 32bit was used
> driver_entry_function@8, but it doesnt seem to work with same
> settings
> under 64bit driver, neither @16 do)
> - what optimisations, discovered parameters for compiler are
> good to use
> for driver
> - what calling conventions are you using to declare these and
> other (eg
> PNP) functions?
> - what method are you using to use assembler code (eg which
> external
> compiler)?
>
> Thanx!
> Olav
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ieee.org
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com

Alberto,
I totally agree with you.
For some reason some people in this industry are soooo reluctant to let go
of their command line tools and complex build environments. I do not
understand why such people use Microsoft tools to develop code for Windows.
They are obviously longing to return to their *nix roots.

“Alberto Moreira” wrote in message news:xxxxx@ntdev…
> This idiot uses a project file for both 32-bit and 64-bit, and it works
> fine. As he pointed out in a recent thread, it’s way more important to
> achieve commonality between driver and application than to follow the
> party line 100% percent. About the specific points in this post,
>
> 1. Driver building is a nearly unmaintainable mess today, and the
> judicious use of an IDE goes a long way towards alleviating it.
>
> 2. If you do your job right you will not get any more wrong than anyone
> elsewhere. No offense intended, but I for myself trust my hand more than
> anyone else’s, including people who work for Microsoft.
>
> 3. Nothing replaces a thorough, comprehensive and deep understanding of
> the machine architecture, its hardware, its instruction set, the
> peripheral(s) you’re trying to support, the C or C++ language you use to
> develop your code, and the code you write. If you achieve that, tools such
> as Driver Verifier or PreFast can be quite irrelevant: do you job
> thoroughly and carefully and you don’t need props.
>
> 4. It’s not my job to debug Microsoft’s code. Sorry, dudes, if you choose
> to do that, that’s your prerogative, but don’t demand it. Furthermore, as
> I see it, the only bit of the DDK that should really be necessary are
> the include files and possibly a library or two - everything else is
> superfluous and Occam’s Razor alone tells us to be very stingy in using
> it. These things are like taxes: you pay them if you must, but you pay the
> least possible and you grumble a lot when you need to. Because, again, no
> offense intended, I trust my hand better than anyone else’s, including the
> people who put the DDK together.
>
> And what do you know ? My software works, and it has been working for a
> long, long while.
>
> Now, one point. One reason why driver writing today is, and I capitalize
> for emphasis,
>
> THERE IS NO COMMON RUNTIME SYSTEM THAT PERFORMS WELL BOTH IN RING 3 AND
> RING 0,
>
> and, also,
>
> THERE IS NO COMMON COMPILER THAT CAN GENERATE CONSISTENT CODE FOR BOTH
> RING 0 AND RING 3,
>
> and,
>
> MANY OF THE VERY NICE INDUSTRY-STRENGTH DEVELOPMENT TOOLS ROUTINELY USED
> BY APPLICATION WRITERS DO NOT SUPPORT KERNEL DEVELOPMENT,
>
> and finally,
>
> THE CONCEPT OF WIZARD-DRIVEN PROGRAM GENERATION AND DEVELOPMENT,
> COMMONPLACE IN MFC AND IN .NET, IS NOT SUPPORTED IN DRIVERLAND.
>
> The issue isn’t that kernel development is “special” or “harder” in any
> way; it’s just that the powers of that be (Microsoft, are you listening?)
> do not support kernel development to the same extent they support
> applications development. Hence the addons, and what do you know ? They’re
> very, very welcome, at least to some of us idiots. And again, our software
> tends to work just as well as anyone else’s.
>
> So, dudes, there’s more than one way to skin a cat, and there’s more than
> one way in this profession of ours to act like an idiot.
>
>
> Alberto.
>
>
>
> ----- Original Message -----
> From: “Don Burn”
> To: “Windows System Software Devs Interest List”
> Sent: Thursday, June 16, 2005 6:43 AM
> Subject: Re: [ntdev] build environment for 64 bit driver - general
> questions
>
>
>> Use Ddkbuild, the approach of a project file does not work for 32 bit or
>> 64 bit. The idiots who do this should be flogged to the edge of their
>> lives. I have gone in to multiple customers who have gotten sold this
>> concept, and fixed their problems by just converting them to a real build
>> environment. Using the visual studio stupidity you:
>>
>> 1. Create a unmaintable mess, since Micosoft has been known to
>> change the options
>> 2. Introduce corner cases, since it likely you will get something
>> wrong
>> 3. Disable the use of tools such as the driver version of PreFast
>> and Static Driver Verifier
>> 4. Make it impossible to submit a bug to Microsoft on the DDK, since
>> you are playing by the rules
>>
>> If you want to do crap like this, stay out of the Windows kernel.
>>
>> Don Burn (MVP, Windows DDK)
>> Windows 2k/XP/2k3 Filesystem and Driver Consulting
>> Remove StopSpam from the email to reply
>>
>>
>>
>> ----- Original Message -----
>> From: “Olav”
>> To: “Windows System Software Devs Interest List”
>> Sent: Thursday, June 16, 2005 3:01 AM
>> Subject: [ntdev] build environment for 64 bit driver - general questions
>>
>>
>> Hello all,
>> does anybody have some working project file for Visual Studio 2003 / 2005
>> used to compile x86-64bit WDM driver? Is there any sample project
>> available somewhere?
>>
>> Issues I am interested in are:
>> - how to define the driver entry point (for 32bit was used
>> driver_entry_function@8, but it doesnt seem to work with same settings
>> under 64bit driver, neither @16 do)
>> - what optimisations, discovered parameters for compiler are good to use
>> for driver
>> - what calling conventions are you using to declare these and other (eg
>> PNP) functions?
>> - what method are you using to use assembler code (eg which external
>> compiler)?
>>
>> Thanx!
>> Olav
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
>> ‘’
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>>
>>
>> —
>> Questions? First check the Kernel Driver FAQ at
>> http://www.osronline.com/article.cfm?id=256
>>
>> You are currently subscribed to ntdev as: xxxxx@ieee.org
>> To unsubscribe send a blank email to xxxxx@lists.osr.com
>
>

You can do something in this direction, there may be more to it
and you may need to experiment, but,

  1. Install the DDK.
  2. Run the Build Environment you need, say, AMD64 Checked.
  3. Dump your environment variables onto a file.
  4. Build your driver with the DDK build.exe.
  5. Look at the log file and catch all those command line
    options.
  6. Create yourself an MSVC environment with those. I recommend
    using MSVC.NET and coding a macro or an addin.
  7. You can put things such as include, lib and executable paths
    in your Tools/Options/Directories. Don’t forget to point them to
    the DDK compiler, unless you want the additional charge of
    making sure the DDK environment doesn’t assume the messy
    attitude of depending on specific (and undocumented!) command
    line options and command-line defined variables.

And I would myself add another item, but this is a more personal
thing:

  1. Get a simple, minimalist driver, to work within that
    environment. Once you get it, freeze your environment, and
    flatly refuse to use any API or technique that breaks it. After
    all, kernel software runs on the iron, or at least it should:
    kernel writers shouldn’t have to bother about APIs that sneak
    themselves between their kernel code and the machine they’re
    trying to drive.

Also, it’s a jolly good idea to study setenv.bat, makefile.def,
i386mk.inc and ia64.inc, because that’s where the build stuff
comes from. In fact, you can probably create your own versions
of those that generate a data file that feeds into your addin;
you do that once per DDK version, and if you do it right all you
need to do is to run your “CreateMyBuildEnvironment.exe” every
time you get a new DDK, done.

In other words: that’s not for the fainthearted, it’s not for
the party-line treaders or for the apparatchicks either; it’s
for fully functional, able-bodied and able-minded professionals.
But, mind you, works wonders. I’ve use MSVC IDEs to develop my
drivers for over ten years now, and I’m not in the habit of
writing code that doesn’t work!

Now, this will last as long as your DDK lasts; you may have to
repeat the performance next time you install a different DDK.
Note also that each different Build Environment requires a
different set of options and such: these are however easily
handled through the MSVC.NET Configuration Manager.

For assembler code, I would use ML.EXE. I don’t particularly
like inline assembler, and you can’t do it in 64-bit anyway. I
would write myself a small bunch of assembler functions and link
them in when I needed them; or create a static library with
those functions, and add it to the librarly line of my project’s
property sheet.

One last thing: you can save yourself a lot of hard work if you
just compromise into using build.exe from inside the IDE: it’s a
simple matter to write an addin or even a macro for that, and
kick it in from the tools menu.

There’s more than one way to skin that cat!

Alberto.

----- Original Message -----
From: “Olav”
To: “Windows System Software Devs Interest List”

Sent: Thursday, June 16, 2005 3:01 AM
Subject: [ntdev] build environment for 64 bit driver - general
questions

Hello all,
does anybody have some working project file for Visual Studio
2003 / 2005
used to compile x86-64bit WDM driver? Is there any sample
project
available somewhere?

Issues I am interested in are:
- how to define the driver entry point (for 32bit was used
driver_entry_function@8, but it doesnt seem to work with same
settings
under 64bit driver, neither @16 do)
- what optimisations, discovered parameters for compiler are
good to use
for driver
- what calling conventions are you using to declare these and
other (eg
PNP) functions?
- what method are you using to use assembler code (eg which
external
compiler)?

Thanx!
Olav


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com

> You can do something in this direction

  1. Dump your environment variables onto a file.
  2. Build your driver with the DDK build.exe.
  3. Look at the log file and catch all those command line options.

A pro po, though not exactly the point under discussion: not just the
compilers in the DDK and in VS 7.1 are
different; the LANGUAGES are slightly different: what is try, leave, except,
finally for DDK’s cl.exe
is __try, __leave, __except, __finally, respectively, for VS 7.1’s cl.exe.

As for VS builds vs build-utility builds, I prefer debug builds from within
VS for one reason -
the driver and its user-mode test.exe are in one place.

Production stuff is another story, I do want to play by the “build -cZg”
rules there, like it or not.

Regards,
Alex

> ----------

From: xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com] on behalf of KMillar[SMTP:xxxxx@neverfailgroup.com]
Reply To: Windows System Software Devs Interest List
Sent: Thursday, June 16, 2005 3:02 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] build environment for 64 bit driver - general questions

For some reason some people in this industry are soooo reluctant to let go
of their command line tools and complex build environments. I do not
understand why such people use Microsoft tools to develop code for Windows.
They are obviously longing to return to their *nix roots.

Sorry, this is nonsese. Using command line tools has nothing to do with UNIX but with efficiency of work.

DDK build environment may be complicated internally but doesn’t matter because is simple to use and simple to intergrate to any IDE developer prefers. What is complicated are VS projects, try to use them for teamwork where team members reside in few different countries. Maintenance nightmare. We saved a lot of time when developed own build engine similar as DDK build just because results are reproducible and don’t depend on machine configuration. It is integrated with SCC, supports nighty builds (one of main purposes) and every member can just sync files from archives and start build in proper directory to get the same results as others. Coworkers of course use it from VS IDE; no problem as there is no problem with DDK.

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 Alberto Moreira[SMTP:xxxxx@ieee.org]
Reply To: Windows System Software Devs Interest List
Sent: Thursday, June 16, 2005 2:49 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] build environment for 64 bit driver - general questions

  1. Driver building *is* a nearly unmaintainable mess today, and
    the judicious use of an IDE goes a long way towards alleviating
    it.

Unmaintainable mess? You’re speaking about VS, right? What is easier than writing SOURCES file and run build?

  1. Nothing replaces a thorough, comprehensive and deep
    understanding of the machine architecture, its hardware, its
    instruction set, the peripheral(s) you’re trying to support, the
    C or C++ language you use to develop your code, and the code you
    write. If you achieve that, tools such as Driver Verifier or
    PreFast can be quite irrelevant: do you job thoroughly and
    carefully and you don’t need props.

Nice opinion from former employee of company which sells tools as BoundsChecker, TrueCoverage etc. :wink:

It is just plain wrong. Nobody is infalliable and these tools guard you against your own mistakes. When I started using PC-lint long ago, it saved me a lot of time because catched stupid typos and not-so-stupid bugs which’d cause BSOD and in turn reboot which took some time then (NT4).

Ignoring Driver Verifier is as don’t writing ASSERTs in own code; you can work well without it but there are times when one ASSERT saves days of work. Just because warns developers a necessary condition isn’t met. This week such ASSERT written months ago catched a very rare case which’d cause failure and I can’t imagine I’d find it without it. It was typical “one crash per-month” bug.

  1. It’s not my job to debug Microsoft’s code. Sorry, dudes, if
    you choose to do that, that’s your prerogative, but don’t demand
    it. Furthermore, as I see it, the only bit of the DDK that
    should *really* be necessary are the include files and possibly
    a library or two - everything else is superfluous and Occam’s
    Razor alone tells us to be very stingy in using it. These things
    are like taxes: you pay them if you must, but you pay the least
    possible and you grumble a lot when you need to. Because, again,
    no offense intended, I trust my hand better than anyone else’s,
    including the people who put the DDK together.

Why not? But good developer tries to understand the environment and debugging OS code helps understanding. Sometimes it is quite necessary, docs may be insufficient or wrong and OS code itself can be buggy. Currently I write a driver for WinCE and although docs are very strict against to DDK, OS sources help a lot. Unfortunately MS isn’t wise enough to make NT sources available, too.

Best regards,

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

Olav wrote:

Hello all,
does anybody have some working project file for Visual Studio 2003 / 2005
used to compile x86-64bit WDM driver? Is there any sample project
available somewhere?

Oh, it’s so nice to be back at this topic again.

Olav: CHECK THE ARCHIVE before posting, will ya? It’s not like we
haven’t beat the shit out of this topic 6 million times before.

Heavens! I can barely believe it: I almost can’t find anything to
disagree with in Mr. Moreira’s second post on this topic. He has even
taken to advocating the use of DDKBUILD, if I read it correctly.

Of course, there is that item #8:

>>

  1. Get a simple, minimalist driver, to work within that environment.
    Once you get it, freeze your environment, and flatly refuse to use any
    API or technique that breaks it. After all, kernel software runs on the
    iron, or at least it should: kernel writers shouldn’t have to bother
    about APIs that sneak themselves between their kernel code and the
    machine they’re trying to drive.
    >>>

I don’t understand the point of this item at all. Is it: Don’t use any
functions that demonstrate that your build environment is broken? Hmmm.
Also that bit about “running on the iron” – When I write a driver, it
runs on Windows, not on “the iron”, any more than a VB .NET app runs “on
the iron.”

But, whatever… cuz I think Mr. Moreira is starting to see the light :slight_smile:

Peter
OSR

My point is to work with a controlled environment where you know
there’s nothing but my code and the bare minimum to make it rev,
which’d better work with just about any build environment. Once
you achieve that stage, you know that your environment can build
a working driver, hence, from that point on, it’s a question of
incremental testing. If your driver builds and runs but it
breaks when you include blah.h, you will have singled out blah.h
as the cause. Furthermore, Occam’s Razor tells me that I
shouldn’t use blah.h unless I’m really forced - and I do mean
forced - to use it; moreover, I only need to iron out my build
environment to the extent that I need it for my specific driver.
The DDK build must be universal and fit every user and every
situation; mine doesn’t, all it has to do is to correctly build
my driver.

Device drivers, by definition, run on the iron. They get
requests from higher level OS layers, they drive the hardware.
They collaborate with the lowest level of the OS so that an
appearance of order is maintained, but they’re *device* drivers;
and devices are supposed to be hardware, with at best some
on-device firmware that dons it some intelligence.

It just happens that you can sandwich a Windows driver between
layers of the OS, and it may be actually easier to many, but
hey, that’s not an obligatto performance. And when you want to
push the envelope, that’s rarely a feasible way to write
software.

Alberto.

----- Original Message -----
From: “PeterGV (OSR)”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”

Cc:
Sent: Thursday, June 16, 2005 3:44 PM
Subject: Re:[ntdev] build environment for 64 bit driver -
general questions

> Olav wrote:
>> Hello all,
>> does anybody have some working project file for Visual Studio
>> 2003 / 2005
>> used to compile x86-64bit WDM driver? Is there any sample
>> project
>> available somewhere?
>>
>
> Oh, it’s so nice to be back at this topic again.
>
> Olav: CHECK THE ARCHIVE before posting, will ya? It’s not
> like we haven’t beat the shit out of this topic 6 million
> times before.
>
> Heavens! I can barely believe it: I almost can’t find
> anything to disagree with in Mr. Moreira’s second post on this
> topic. He has even taken to advocating the use of DDKBUILD,
> if I read it correctly.
>
> Of course, there is that item #8:
>
> >>>
> 8. Get a simple, minimalist driver, to work within that
> environment. Once you get it, freeze your environment, and
> flatly refuse to use any API or technique that breaks it.
> After all, kernel software runs on the iron, or at least it
> should: kernel writers shouldn’t have to bother about APIs
> that sneak themselves between their kernel code and the
> machine they’re trying to drive.
> >>>
>
> I don’t understand the point of this item at all. Is it:
> Don’t use any functions that demonstrate that your build
> environment is broken? Hmmm. Also that bit about “running on
> the iron” – When I write a driver, it runs on Windows, not on
> “the iron”, any more than a VB .NET app runs “on the iron.”
>
> But, whatever… cuz I think Mr. Moreira is starting to see
> the light :slight_smile:
>
>
> Peter
> OSR
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@ieee.org
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com

Hi, Michal,

I’m no longer Compuware, so, now I talk as Alberto the
individual. And indeed my philosophy is, I use the least
possible of anything that I haven’t written myself. My
philosophy about use and reuse is, (1) I’ll reuse anything I’ve
written, (2) I’ll reuse much provided I control its source code,
and (3) I’ll be very, very reluctant in using or reusing
anything else, specially things that constrain my ability to
design or my access to what I need too access. Most tools
constrain me too much and require too much babysitting, or
they’re clumsy and cumbersome to use, or they enforce someone
else’s criteria that often don’t match mine. And my personal
experience is that by far the higher source of driver problems
is chip bugs or mishandling of the hardware - and here my
debugging tools are a scope and a logic analyzer, now that’s
real debugging as far as I can see. Programming gets simpler and
more robust the less you call other people’s software; every
call opens the door for impedance mismatches of all sorts.
Hence, know thy hardware, follow Occam’s Razor, and you won’t
regret it!

Alberto.

----- Original Message -----
From: “Michal Vodicka”
To: “Windows System Software Devs Interest List”

Sent: Thursday, June 16, 2005 1:58 PM
Subject: RE: [ntdev] build environment for 64 bit driver -
general questions

> ----------
> From:
> xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]
> on behalf of Alberto Moreira[SMTP:xxxxx@ieee.org]
> Reply To: Windows System Software Devs Interest List
> Sent: Thursday, June 16, 2005 2:49 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] build environment for 64 bit driver -
> general questions
>
> 1. Driver building is a nearly unmaintainable mess today,
> and
> the judicious use of an IDE goes a long way towards
> alleviating
> it.
>
Unmaintainable mess? You’re speaking about VS, right? What is
easier than writing SOURCES file and run build?

> 3. Nothing replaces a thorough, comprehensive and deep
> understanding of the machine architecture, its hardware, its
> instruction set, the peripheral(s) you’re trying to support,
> the
> C or C++ language you use to develop your code, and the code
> you
> write. If you achieve that, tools such as Driver Verifier or
> PreFast can be quite irrelevant: do you job thoroughly and
> carefully and you don’t need props.
>
Nice opinion from former employee of company which sells tools
as BoundsChecker, TrueCoverage etc. :wink:

It is just plain wrong. Nobody is infalliable and these tools
guard you against your own mistakes. When I started using
PC-lint long ago, it saved me a lot of time because catched
stupid typos and not-so-stupid bugs which’d cause BSOD and in
turn reboot which took some time then (NT4).

Ignoring Driver Verifier is as don’t writing ASSERTs in own
code; you can work well without it but there are times when one
ASSERT saves days of work. Just because warns developers a
necessary condition isn’t met. This week such ASSERT written
months ago catched a very rare case which’d cause failure and I
can’t imagine I’d find it without it. It was typical “one crash
per-month” bug.

> 4. It’s not my job to debug Microsoft’s code. Sorry, dudes, if
> you choose to do that, that’s your prerogative, but don’t
> demand
> it. Furthermore, as I see it, the only bit of the DDK that
> should really be necessary are the include files and
> possibly
> a library or two - everything else is superfluous and Occam’s
> Razor alone tells us to be very stingy in using it. These
> things
> are like taxes: you pay them if you must, but you pay the
> least
> possible and you grumble a lot when you need to. Because,
> again,
> no offense intended, I trust my hand better than anyone
> else’s,
> including the people who put the DDK together.
>
Why not? But good developer tries to understand the environment
and debugging OS code helps understanding. Sometimes it is quite
necessary, docs may be insufficient or wrong and OS code itself
can be buggy. Currently I write a driver for WinCE and although
docs are very strict against to DDK, OS sources help a lot.
Unfortunately MS isn’t wise enough to make NT sources available,
too.

Best regards,

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


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com

Alberto,

yes, I know you’re no longer Compuware; it just appeared funny.

Sorry but your philosophy, especially point 3, just doesn’t match Windows drivers development. It is source of all misunderstanding and vain discussions here. You’d better work in embedded development where you can really have bare iron and nothing else. Windows kernel is environment which enforces a lot of rules and drivers have to cooperate. Some kind of device drivers don’t even talk directly to hardware, try to write an USB driver for example.

As for tools, I take differently. I’m lazy person (Wally is my ideal :slight_smile: so the key point is efficiency and I use everything which allows me to work less. That’s why I don’t use crappy IDE as VS is and use programmers editor which I can customize according to my needs and write macros which save me from tiresome work. That’s why I prefer command line tools and write own to save time and test better. That’s why I use traces and assert regularly because it avoids stepping through code. Some tools are annoying; PC-lint can be real PITA but it saves time when used regularly. I guess Prefast can be both annoying and useful the same way. Similarly Driver Verifier and BoundsChecker. It is much easier to fix problem catched immediatelly when occurs than trying to find what caused damage hours before. I’m not against hw tools; recently I spent a week debugging firmware using logical analyser because needed to maximize performance. USB analyser became my friend. Everything which helps to avoid trial/error work is useful, both software and hardware. Finally, I understand your complaints about clumsy software written by others; that’s why I spend time writting bugreports and suggestions to software vendors. Well, being lazy isn’t easy task :wink:

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 Alberto Moreira[SMTP:xxxxx@ieee.org]
Reply To: Windows System Software Devs Interest List
Sent: Saturday, June 18, 2005 2:03 AM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] build environment for 64 bit driver - general questions

Hi, Michal,

I’m no longer Compuware, so, now I talk as Alberto the
individual. And indeed my philosophy is, I use the least
possible of anything that I haven’t written myself. My
philosophy about use and reuse is, (1) I’ll reuse anything I’ve
written, (2) I’ll reuse much provided I control its source code,
and (3) I’ll be very, very reluctant in using or reusing
anything else, specially things that constrain my ability to
design or my access to what I need too access. Most tools
constrain me too much and require too much babysitting, or
they’re clumsy and cumbersome to use, or they enforce someone
else’s criteria that often don’t match mine. And my personal
experience is that by far the higher source of driver problems
is chip bugs or mishandling of the hardware - and here my
debugging tools are a scope and a logic analyzer, now that’s
real debugging as far as I can see. Programming gets simpler and
more robust the less you call other people’s software; every
call opens the door for impedance mismatches of all sorts.
Hence, know thy hardware, follow Occam’s Razor, and you won’t
regret it!

Alberto.

----- Original Message -----
From: “Michal Vodicka”
> To: “Windows System Software Devs Interest List”
>
> Sent: Thursday, June 16, 2005 1:58 PM
> Subject: RE: [ntdev] build environment for 64 bit driver -
> general questions
>
>
> > ----------
> > From:
> > xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]
> > on behalf of Alberto Moreira[SMTP:xxxxx@ieee.org]>
> > Reply To: Windows System Software Devs Interest List
> > Sent: Thursday, June 16, 2005 2:49 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] build environment for 64 bit driver -
> > general questions
> >
> > 1. Driver building is a nearly unmaintainable mess today,
> > and
> > the judicious use of an IDE goes a long way towards
> > alleviating
> > it.
> >
> Unmaintainable mess? You’re speaking about VS, right? What is
> easier than writing SOURCES file and run build?
>
> > 3. Nothing replaces a thorough, comprehensive and deep
> > understanding of the machine architecture, its hardware, its
> > instruction set, the peripheral(s) you’re trying to support,
> > the
> > C or C++ language you use to develop your code, and the code
> > you
> > write. If you achieve that, tools such as Driver Verifier or
> > PreFast can be quite irrelevant: do you job thoroughly and
> > carefully and you don’t need props.
> >
> Nice opinion from former employee of company which sells tools
> as BoundsChecker, TrueCoverage etc. :wink:
>
> It is just plain wrong. Nobody is infalliable and these tools
> guard you against your own mistakes. When I started using
> PC-lint long ago, it saved me a lot of time because catched
> stupid typos and not-so-stupid bugs which’d cause BSOD and in
> turn reboot which took some time then (NT4).
>
> Ignoring Driver Verifier is as don’t writing ASSERTs in own
> code; you can work well without it but there are times when one
> ASSERT saves days of work. Just because warns developers a
> necessary condition isn’t met. This week such ASSERT written
> months ago catched a very rare case which’d cause failure and I
> can’t imagine I’d find it without it. It was typical “one crash
> per-month” bug.
>
> > 4. It’s not my job to debug Microsoft’s code. Sorry, dudes, if
> > you choose to do that, that’s your prerogative, but don’t
> > demand
> > it. Furthermore, as I see it, the only bit of the DDK that
> > should really be necessary are the include files and
> > possibly
> > a library or two - everything else is superfluous and Occam’s
> > Razor alone tells us to be very stingy in using it. These
> > things
> > are like taxes: you pay them if you must, but you pay the
> > least
> > possible and you grumble a lot when you need to. Because,
> > again,
> > no offense intended, I trust my hand better than anyone
> > else’s,
> > including the people who put the DDK together.
> >
> Why not? But good developer tries to understand the environment
> and debugging OS code helps understanding. Sometimes it is quite
> necessary, docs may be insufficient or wrong and OS code itself
> can be buggy. Currently I write a driver for WinCE and although
> docs are very strict against to DDK, OS sources help a lot.
> Unfortunately MS isn’t wise enough to make NT sources available,
> too.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@upek.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

> 1. Driver building *is* a nearly unmaintainable mess today, and

the judicious use of an IDE goes a long way towards alleviating
it.

IDE builds are by far more messy then BUILD.EXE. That’s why MS uses BUILD for
the OS itself.

write. If you achieve that, tools such as Driver Verifier or
PreFast can be quite irrelevant: do you job thoroughly and
carefully and you don’t need props.

The human attention is limited, so, even the good specialist can make typo-like
bugs. So, PreFast and DV are very, very valuable.

THE CONCEPT OF WIZARD-DRIVEN PROGRAM GENERATION AND
DEVELOPMENT,
COMMONPLACE IN MFC AND IN .NET, IS NOT SUPPORTED IN DRIVERLAND.

This is a stupid novice-only demo-like thing in userland too. Not suitable for
anything complex and non-linear.

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

Command-line tools have longer learning curve (yes, you will need to look
to the docs), but are more suitable for real-world problems, especially in the
large projects. They are by far more flexible.

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

----- Original Message -----
From: “KMillar”
Newsgroups: ntdev
To: “Windows System Software Devs Interest List”
Sent: Thursday, June 16, 2005 5:02 PM
Subject: Re:[ntdev] build environment for 64 bit driver - general questions

> Alberto,
> I totally agree with you.
> For some reason some people in this industry are soooo reluctant to let go
> of their command line tools and complex build environments. I do not
> understand why such people use Microsoft tools to develop code for Windows.
> They are obviously longing to return to their *nix roots.
>
>
> “Alberto Moreira” wrote in message news:xxxxx@ntdev…
> > This idiot uses a project file for both 32-bit and 64-bit, and it works
> > fine. As he pointed out in a recent thread, it’s way more important to
> > achieve commonality between driver and application than to follow the
> > party line 100% percent. About the specific points in this post,
> >
> > 1. Driver building is a nearly unmaintainable mess today, and the
> > judicious use of an IDE goes a long way towards alleviating it.
> >
> > 2. If you do your job right you will not get any more wrong than anyone
> > elsewhere. No offense intended, but I for myself trust my hand more than
> > anyone else’s, including people who work for Microsoft.
> >
> > 3. Nothing replaces a thorough, comprehensive and deep understanding of
> > the machine architecture, its hardware, its instruction set, the
> > peripheral(s) you’re trying to support, the C or C++ language you use to
> > develop your code, and the code you write. If you achieve that, tools such
> > as Driver Verifier or PreFast can be quite irrelevant: do you job
> > thoroughly and carefully and you don’t need props.
> >
> > 4. It’s not my job to debug Microsoft’s code. Sorry, dudes, if you choose
> > to do that, that’s your prerogative, but don’t demand it. Furthermore, as
> > I see it, the only bit of the DDK that should really be necessary are
> > the include files and possibly a library or two - everything else is
> > superfluous and Occam’s Razor alone tells us to be very stingy in using
> > it. These things are like taxes: you pay them if you must, but you pay the
> > least possible and you grumble a lot when you need to. Because, again, no
> > offense intended, I trust my hand better than anyone else’s, including the
> > people who put the DDK together.
> >
> > And what do you know ? My software works, and it has been working for a
> > long, long while.
> >
> > Now, one point. One reason why driver writing today is, and I capitalize
> > for emphasis,
> >
> > THERE IS NO COMMON RUNTIME SYSTEM THAT PERFORMS WELL BOTH IN RING 3 AND
> > RING 0,
> >
> > and, also,
> >
> > THERE IS NO COMMON COMPILER THAT CAN GENERATE CONSISTENT CODE FOR BOTH
> > RING 0 AND RING 3,
> >
> > and,
> >
> > MANY OF THE VERY NICE INDUSTRY-STRENGTH DEVELOPMENT TOOLS ROUTINELY USED
> > BY APPLICATION WRITERS DO NOT SUPPORT KERNEL DEVELOPMENT,
> >
> > and finally,
> >
> > THE CONCEPT OF WIZARD-DRIVEN PROGRAM GENERATION AND DEVELOPMENT,
> > COMMONPLACE IN MFC AND IN .NET, IS NOT SUPPORTED IN DRIVERLAND.
> >
> > The issue isn’t that kernel development is “special” or “harder” in any
> > way; it’s just that the powers of that be (Microsoft, are you listening?)
> > do not support kernel development to the same extent they support
> > applications development. Hence the addons, and what do you know ? They’re
> > very, very welcome, at least to some of us idiots. And again, our software
> > tends to work just as well as anyone else’s.
> >
> > So, dudes, there’s more than one way to skin a cat, and there’s more than
> > one way in this profession of ours to act like an idiot.
> >
> >
> > Alberto.
> >
> >
> >
> > ----- Original Message -----
> > From: “Don Burn”
> > To: “Windows System Software Devs Interest List”
> > Sent: Thursday, June 16, 2005 6:43 AM
> > Subject: Re: [ntdev] build environment for 64 bit driver - general
> > questions
> >
> >
> >> Use Ddkbuild, the approach of a project file does not work for 32 bit or
> >> 64 bit. The idiots who do this should be flogged to the edge of their
> >> lives. I have gone in to multiple customers who have gotten sold this
> >> concept, and fixed their problems by just converting them to a real build
> >> environment. Using the visual studio stupidity you:
> >>
> >> 1. Create a unmaintable mess, since Micosoft has been known to
> >> change the options
> >> 2. Introduce corner cases, since it likely you will get something
> >> wrong
> >> 3. Disable the use of tools such as the driver version of PreFast
> >> and Static Driver Verifier
> >> 4. Make it impossible to submit a bug to Microsoft on the DDK, since
> >> you are playing by the rules
> >>
> >> If you want to do crap like this, stay out of the Windows kernel.
> >>
> >> Don Burn (MVP, Windows DDK)
> >> Windows 2k/XP/2k3 Filesystem and Driver Consulting
> >> Remove StopSpam from the email to reply
> >>
> >>
> >>
> >> ----- Original Message -----
> >> From: “Olav”
> >> To: “Windows System Software Devs Interest List”
> >> Sent: Thursday, June 16, 2005 3:01 AM
> >> Subject: [ntdev] build environment for 64 bit driver - general questions
> >>
> >>
> >> Hello all,
> >> does anybody have some working project file for Visual Studio 2003 / 2005
> >> used to compile x86-64bit WDM driver? Is there any sample project
> >> available somewhere?
> >>
> >> Issues I am interested in are:
> >> - how to define the driver entry point (for 32bit was used
> >> driver_entry_function@8, but it doesnt seem to work with same settings
> >> under 64bit driver, neither @16 do)
> >> - what optimisations, discovered parameters for compiler are good to use
> >> for driver
> >> - what calling conventions are you using to declare these and other (eg
> >> PNP) functions?
> >> - what method are you using to use assembler code (eg which external
> >> compiler)?
> >>
> >> Thanx!
> >> Olav
> >>
> >>
> >> —
> >> Questions? First check the Kernel Driver FAQ at
> >> http://www.osronline.com/article.cfm?id=256
> >>
> >> You are currently subscribed to ntdev as: unknown lmsubst tag argument:
> >> ‘’
> >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> >>
> >>
> >> —
> >> Questions? First check the Kernel Driver FAQ at
> >> http://www.osronline.com/article.cfm?id=256
> >>
> >> You are currently subscribed to ntdev as: xxxxx@ieee.org
> >> To unsubscribe send a blank email to xxxxx@lists.osr.com
> >
> >
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com

Max,

I have worked a lot with integrated applications where the
system spans from the GUI to the iron. My experience is that
apps are usually way larger, way more complex and way harder to
maintain than drivers, yet I don’t think anyone would in his or
her right mind suggest that people build apps with build.exe.

And they’re more often than not generated from an initial Wizard
run. It’s close to nonsense to write an MFC app from scratch,
when you can get so much ancillary code written in five minutes
of point and click! It’s even more apparent with .NET, because
it has extensive facilities for on-line point-and-click
generation of working industrial-strength code. I only wish
Microsoft included driver writing in that environment!
DriverWorks and DriverNetworks are a step in the right
direction, but there’s much more to be achieved.

In fact, apps are usually organized in projects, and the IDE
gives us automatic management of project dependencies and of
different configurations, such as x86, amd64 or i64, checked or
free. The IDE gives us a powerful debugger (and it’s a pity that
Microsoft didn’t integrate a kernel debugging capability from
within the IDE debugger), a rather effective object browser (and
you can go to Whole Tomato, or write your own addin, if you want
something even better), integration with the Source Control
System, automatic generation of XML documentation, integration
with Web deployment, the ability to integrate my own code into
the IDE through macros, addins, or merely by inserting the tool
into the external tools menu, and a lot more.

Apps are usually way more complex and way bigger structures than
drivers, and yet everybody uses the IDE for their development.

For production, all you have to do is to add one line to your
build script, which calls the IDE:

DEVENV /run “c:\mydirectory\mysolution.sln”

That can be safely done by the release management team, no need
for developers to bother about that except in very small
organizations where the developer has to wear both hats.
Moreover, the IDE lets you operate on an “experimental” branch
of your tree until it’s time to move up to production, at which
time changing one registry entry does the trick: it can’t get
simpler than that.

If you generate your code the right way, the IDE build
environment builds up automatically, with near zero delta
effort. No need to bother about makefiles, sources files, script
files or the like: you build the solution as you go, by point
and click, and all its management is done either automatically
or with point and click.

Now, about Prefast, DV and the rest, I might even use it, if
they were integrated with the IDE. But I’m a minimalist myself,
and I don’t see much use for that kind of tool; a healthy degree
of separation between my code and the API, a large amount of
caring for the computer science base underneath the program I
write, and enough knowledge of the hardware, well those have
been enough for my own development; one of my self-discipline
rules is, I don’t use anything unless I really, really have to.
Besides, my specialty is graphics, what do DriverVerifier or DV
know about Texture Mapping or about 3D graphics pipelines ?
These tools useless to me, my industry has its own benchmarks
and tests.

Know computer science, know your hardware, minimize your
interactions with outside software, that’s my advice. And do not
write any script of any source if you can avoid it; there’s
enough technology out there that the command box should be
delegated to the museum where it belongs.

Alberto.

----- Original Message -----
From: “Maxim S. Shatskih”
To: “Windows System Software Devs Interest List”

Sent: Saturday, June 18, 2005 7:02 AM
Subject: Re: [ntdev] build environment for 64 bit driver -
general questions

>> 1. Driver building is a nearly unmaintainable mess today,
>> and
>> the judicious use of an IDE goes a long way towards
>> alleviating
>> it.
>
> IDE builds are by far more messy then BUILD.EXE. That’s why MS
> uses BUILD for
> the OS itself.
>
>> write. If you achieve that, tools such as Driver Verifier or
>> PreFast can be quite irrelevant: do you job thoroughly and
>> carefully and you don’t need props.
>
> The human attention is limited, so, even the good specialist
> can make typo-like
> bugs. So, PreFast and DV are very, very valuable.
>
>> THE CONCEPT OF WIZARD-DRIVEN PROGRAM GENERATION AND
>>DEVELOPMENT,
>> COMMONPLACE IN MFC AND IN .NET, IS NOT SUPPORTED IN
>> DRIVERLAND.
>
> This is a stupid novice-only demo-like thing in userland too.
> Not suitable for
> anything complex and non-linear.
>
> 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
>
> You are currently subscribed to ntdev as: xxxxx@ieee.org
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com

Michal,

What you have written is all ok. “I prefer this, you prefer
that”, that’s very normal, and it’d be a wonder if we all
preferred the same techniques and software. But it’s definitely
not ok to throw words like “this is stupid” at a fellow
professional, or to say “it doesn’t work” about things that are
known to work and quite well indeed, only because you happen not
to like those particular things!

Alberto.

----- Original Message -----
From: “Michal Vodicka”
To: “Windows System Software Devs Interest List”

Sent: Friday, June 17, 2005 9:08 PM
Subject: RE: [ntdev] build environment for 64 bit driver -
general questions

Alberto,

yes, I know you’re no longer Compuware; it just appeared funny.

Sorry but your philosophy, especially point 3, just doesn’t
match Windows drivers development. It is source of all
misunderstanding and vain discussions here. You’d better work in
embedded development where you can really have bare iron and
nothing else. Windows kernel is environment which enforces a lot
of rules and drivers have to cooperate. Some kind of device
drivers don’t even talk directly to hardware, try to write an
USB driver for example.

As for tools, I take differently. I’m lazy person (Wally is my
ideal :slight_smile: so the key point is efficiency and I use everything
which allows me to work less. That’s why I don’t use crappy IDE
as VS is and use programmers editor which I can customize
according to my needs and write macros which save me from
tiresome work. That’s why I prefer command line tools and write
own to save time and test better. That’s why I use traces and
assert regularly because it avoids stepping through code. Some
tools are annoying; PC-lint can be real PITA but it saves time
when used regularly. I guess Prefast can be both annoying and
useful the same way. Similarly Driver Verifier and
BoundsChecker. It is much easier to fix problem catched
immediatelly when occurs than trying to find what caused damage
hours before. I’m not against hw tools; recently I spent a week
debugging firmware using logical analyser because needed to
maximize performance. USB analyser became my friend. Everything
which helps to avoid trial/error work is useful, both software
and hardware. Finally, I understand your complaints about clumsy
software written by others; that’s why I spend time writting
bugreports and suggestions to software vendors. Well, being lazy
isn’t easy task :wink:

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 Alberto Moreira[SMTP:xxxxx@ieee.org]
> Reply To: Windows System Software Devs Interest List
> Sent: Saturday, June 18, 2005 2:03 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] build environment for 64 bit driver -
> general questions
>
> Hi, Michal,
>
> I’m no longer Compuware, so, now I talk as Alberto the
> individual. And indeed my philosophy is, I use the least
> possible of anything that I haven’t written myself. My
> philosophy about use and reuse is, (1) I’ll reuse anything
> I’ve
> written, (2) I’ll reuse much provided I control its source
> code,
> and (3) I’ll be very, very reluctant in using or reusing
> anything else, specially things that constrain my ability to
> design or my access to what I need too access. Most tools
> constrain me too much and require too much babysitting, or
> they’re clumsy and cumbersome to use, or they enforce someone
> else’s criteria that often don’t match mine. And my personal
> experience is that by far the higher source of driver problems
> is chip bugs or mishandling of the hardware - and here my
> debugging tools are a scope and a logic analyzer, now that’s
> real debugging as far as I can see. Programming gets simpler
> and
> more robust the less you call other people’s software; every
> call opens the door for impedance mismatches of all sorts.
> Hence, know thy hardware, follow Occam’s Razor, and you won’t
> regret it!
>
> Alberto.
>
>
>
> ----- Original Message -----
> From: “Michal Vodicka”
> To: “Windows System Software Devs Interest List”
>
> Sent: Thursday, June 16, 2005 1:58 PM
> Subject: RE: [ntdev] build environment for 64 bit driver -
> general questions
>
>
> > ----------
> > From:
> > xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]
> > on behalf of Alberto Moreira[SMTP:xxxxx@ieee.org]>
> > Reply To: Windows System Software Devs Interest List
> > Sent: Thursday, June 16, 2005 2:49 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] build environment for 64 bit driver -
> > general questions
> >
> > 1. Driver building is a nearly unmaintainable mess today,
> > and
> > the judicious use of an IDE goes a long way towards
> > alleviating
> > it.
> >
> Unmaintainable mess? You’re speaking about VS, right? What is
> easier than writing SOURCES file and run build?
>
> > 3. Nothing replaces a thorough, comprehensive and deep
> > understanding of the machine architecture, its hardware, its
> > instruction set, the peripheral(s) you’re trying to support,
> > the
> > C or C++ language you use to develop your code, and the code
> > you
> > write. If you achieve that, tools such as Driver Verifier or
> > PreFast can be quite irrelevant: do you job thoroughly and
> > carefully and you don’t need props.
> >
> Nice opinion from former employee of company which sells tools
> as BoundsChecker, TrueCoverage etc. :wink:
>
> It is just plain wrong. Nobody is infalliable and these tools
> guard you against your own mistakes. When I started using
> PC-lint long ago, it saved me a lot of time because catched
> stupid typos and not-so-stupid bugs which’d cause BSOD and in
> turn reboot which took some time then (NT4).
>
> Ignoring Driver Verifier is as don’t writing ASSERTs in own
> code; you can work well without it but there are times when
> one
> ASSERT saves days of work. Just because warns developers a
> necessary condition isn’t met. This week such ASSERT written
> months ago catched a very rare case which’d cause failure and
> I
> can’t imagine I’d find it without it. It was typical “one
> crash
> per-month” bug.
>
> > 4. It’s not my job to debug Microsoft’s code. Sorry, dudes,
> > if
> > you choose to do that, that’s your prerogative, but don’t
> > demand
> > it. Furthermore, as I see it, the only bit of the DDK that
> > should really be necessary are the include files and
> > possibly
> > a library or two - everything else is superfluous and
> > Occam’s
> > Razor alone tells us to be very stingy in using it. These
> > things
> > are like taxes: you pay them if you must, but you pay the
> > least
> > possible and you grumble a lot when you need to. Because,
> > again,
> > no offense intended, I trust my hand better than anyone
> > else’s,
> > including the people who put the DDK together.
> >
> Why not? But good developer tries to understand the
> environment
> and debugging OS code helps understanding. Sometimes it is
> quite
> necessary, docs may be insufficient or wrong and OS code
> itself
> can be buggy. Currently I write a driver for WinCE and
> although
> docs are very strict against to DDK, OS sources help a lot.
> Unfortunately MS isn’t wise enough to make NT sources
> available,
> too.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@upek.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com

MICHAL:

I second Alberto’s sentiment, but take it a bit farther. There is no
need for “this is stupid,” et. c. a forum such as this no matter how
misguided someone’s efforts. Unless I’m missing something, no one is
making you respond to any of these e-mails. This, in my opinion, is a
forum for questions, answers and, at the worst, constructive criticism.

M. M. O’Brien

>> xxxxx@ieee.org 6/19/2005 2:38:30 PM >>>
Michal,

What you have written is all ok. “I prefer this, you prefer
that”, that’s very normal, and it’d be a wonder if we all
preferred the same techniques and software. But it’s definitely
not ok to throw words like “this is stupid” at a fellow
professional, or to say “it doesn’t work” about things that are
known to work and quite well indeed, only because you happen not
to like those particular things!

Alberto.

----- Original Message -----
From: “Michal Vodicka”
To: “Windows System Software Devs Interest List”

Sent: Friday, June 17, 2005 9:08 PM
Subject: RE: [ntdev] build environment for 64 bit driver -
general questions

Alberto,

yes, I know you’re no longer Compuware; it just appeared funny.

Sorry but your philosophy, especially point 3, just doesn’t
match Windows drivers development. It is source of all
misunderstanding and vain discussions here. You’d better work in
embedded development where you can really have bare iron and
nothing else. Windows kernel is environment which enforces a lot
of rules and drivers have to cooperate. Some kind of device
drivers don’t even talk directly to hardware, try to write an
USB driver for example.

As for tools, I take differently. I’m lazy person (Wally is my
ideal :slight_smile: so the key point is efficiency and I use everything
which allows me to work less. That’s why I don’t use crappy IDE
as VS is and use programmers editor which I can customize
according to my needs and write macros which save me from
tiresome work. That’s why I prefer command line tools and write
own to save time and test better. That’s why I use traces and
assert regularly because it avoids stepping through code. Some
tools are annoying; PC-lint can be real PITA but it saves time
when used regularly. I guess Prefast can be both annoying and
useful the same way. Similarly Driver Verifier and
BoundsChecker. It is much easier to fix problem catched
immediatelly when occurs than trying to find what caused damage
hours before. I’m not against hw tools; recently I spent a week
debugging firmware using logical analyser because needed to
maximize performance. USB analyser became my friend. Everything
which helps to avoid trial/error work is useful, both software
and hardware. Finally, I understand your complaints about clumsy
software written by others; that’s why I spend time writting
bugreports and suggestions to software vendors. Well, being lazy
isn’t easy task :wink:

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 Alberto Moreira[SMTP:xxxxx@ieee.org]
> Reply To: Windows System Software Devs Interest List
> Sent: Saturday, June 18, 2005 2:03 AM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] build environment for 64 bit driver -
> general questions
>
> Hi, Michal,
>
> I’m no longer Compuware, so, now I talk as Alberto the
> individual. And indeed my philosophy is, I use the least
> possible of anything that I haven’t written myself. My
> philosophy about use and reuse is, (1) I’ll reuse anything
> I’ve
> written, (2) I’ll reuse much provided I control its source
> code,
> and (3) I’ll be very, very reluctant in using or reusing
> anything else, specially things that constrain my ability to
> design or my access to what I need too access. Most tools
> constrain me too much and require too much babysitting, or
> they’re clumsy and cumbersome to use, or they enforce someone
> else’s criteria that often don’t match mine. And my personal
> experience is that by far the higher source of driver problems
> is chip bugs or mishandling of the hardware - and here my
> debugging tools are a scope and a logic analyzer, now that’s
> real debugging as far as I can see. Programming gets simpler
> and
> more robust the less you call other people’s software; every
> call opens the door for impedance mismatches of all sorts.
> Hence, know thy hardware, follow Occam’s Razor, and you won’t
> regret it!
>
> Alberto.
>
>
>
> ----- Original Message -----
> From: “Michal Vodicka”
> To: “Windows System Software Devs Interest List”
>
> Sent: Thursday, June 16, 2005 1:58 PM
> Subject: RE: [ntdev] build environment for 64 bit driver -
> general questions
>
>
> > ----------
> > From:
> >
xxxxx@lists.osr.com[SMTP:xxxxx@lists.osr.com]

> > on behalf of Alberto Moreira[SMTP:xxxxx@ieee.org]>
> > Reply To: Windows System Software Devs Interest List
> > Sent: Thursday, June 16, 2005 2:49 PM
> > To: Windows System Software Devs Interest List
> > Subject: Re: [ntdev] build environment for 64 bit driver -
> > general questions
> >
> > 1. Driver building is a nearly unmaintainable mess today,
> > and
> > the judicious use of an IDE goes a long way towards
> > alleviating
> > it.
> >
> Unmaintainable mess? You’re speaking about VS, right? What is
> easier than writing SOURCES file and run build?
>
> > 3. Nothing replaces a thorough, comprehensive and deep
> > understanding of the machine architecture, its hardware, its
> > instruction set, the peripheral(s) you’re trying to support,
> > the
> > C or C++ language you use to develop your code, and the code
> > you
> > write. If you achieve that, tools such as Driver Verifier or
> > PreFast can be quite irrelevant: do you job thoroughly and
> > carefully and you don’t need props.
> >
> Nice opinion from former employee of company which sells tools
> as BoundsChecker, TrueCoverage etc. :wink:
>
> It is just plain wrong. Nobody is infalliable and these tools
> guard you against your own mistakes. When I started using
> PC-lint long ago, it saved me a lot of time because catched
> stupid typos and not-so-stupid bugs which’d cause BSOD and in
> turn reboot which took some time then (NT4).
>
> Ignoring Driver Verifier is as don’t writing ASSERTs in own
> code; you can work well without it but there are times when
> one
> ASSERT saves days of work. Just because warns developers a
> necessary condition isn’t met. This week such ASSERT written
> months ago catched a very rare case which’d cause failure and
> I
> can’t imagine I’d find it without it. It was typical “one
> crash
> per-month” bug.
>
> > 4. It’s not my job to debug Microsoft’s code. Sorry, dudes,
> > if
> > you choose to do that, that’s your prerogative, but don’t
> > demand
> > it. Furthermore, as I see it, the only bit of the DDK that
> > should really be necessary are the include files and
> > possibly
> > a library or two - everything else is superfluous and
> > Occam’s
> > Razor alone tells us to be very stingy in using it. These
> > things
> > are like taxes: you pay them if you must, but you pay the
> > least
> > possible and you grumble a lot when you need to. Because,
> > again,
> > no offense intended, I trust my hand better than anyone
> > else’s,
> > including the people who put the DDK together.
> >
> Why not? But good developer tries to understand the
> environment
> and debugging OS code helps understanding. Sometimes it is
> quite
> necessary, docs may be insufficient or wrong and OS code
> itself
> can be buggy. Currently I write a driver for WinCE and
> although
> docs are very strict against to DDK, OS sources help a lot.
> Unfortunately MS isn’t wise enough to make NT sources
> available,
> too.
>
> Best regards,
>
> Michal Vodicka
> UPEK, Inc.
> [xxxxx@upek.com, http://www.upek.com]
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: unknown lmsubst tag
> argument: ‘’
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@upek.com
> To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com


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

You are currently subscribed to ntdev as: xxxxx@evitechnology.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

OK, guys. I don’t think I used this phrase in this thread but also disagree with you. List archives are searchable and incorrect posts can mislead anybody long time later. It is important to post corrections, disagreement and in some cases mark really stupid idea as stupid. Feel free to call me stupid when I do or propagate stupid things.

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 Martin O’Brien[SMTP:xxxxx@evitechnology.com]
Reply To: Windows System Software Devs Interest List
Sent: Monday, June 20, 2005 1:09 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] build environment for 64 bit driver - general questions

MICHAL:

I second Alberto’s sentiment, but take it a bit farther. There is no
need for “this is stupid,” et. c. a forum such as this no matter how
misguided someone’s efforts. Unless I’m missing something, no one is
making you respond to any of these e-mails. This, in my opinion, is a
forum for questions, answers and, at the worst, constructive criticism.

M. M. O’Brien

>>> xxxxx@ieee.org 6/19/2005 2:38:30 PM >>>
Michal,

What you have written is all ok. “I prefer this, you prefer
that”, that’s very normal, and it’d be a wonder if we all
preferred the same techniques and software. But it’s definitely
not ok to throw words like “this is stupid” at a fellow
professional, or to say “it doesn’t work” about things that are
known to work and quite well indeed, only because you happen not
to like those particular things!

Alberto.

Michal,

I wasn’t criticizing you when I wrote that. It wasn’t you who
wrote the stuff I objected to! Apologies if I gave you and
others the wrong impression.

Alberto.

----- Original Message -----
From: “Michal Vodicka”
To: “Windows System Software Devs Interest List”

Sent: Monday, June 20, 2005 3:09 PM
Subject: RE: [ntdev] build environment for 64 bit driver -
general questions

OK, guys. I don’t think I used this phrase in this thread but
also disagree with you. List archives are searchable and
incorrect posts can mislead anybody long time later. It is
important to post corrections, disagreement and in some cases
mark really stupid idea as stupid. Feel free to call me stupid
when I do or propagate stupid things.

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 Martin O’Brien[SMTP:xxxxx@evitechnology.com]
> Reply To: Windows System Software Devs Interest List
> Sent: Monday, June 20, 2005 1:09 PM
> To: Windows System Software Devs Interest List
> Subject: Re: [ntdev] build environment for 64 bit driver -
> general questions
>
> MICHAL:
>
> I second Alberto’s sentiment, but take it a bit farther.
> There is no
> need for “this is stupid,” et. c. a forum such as this no
> matter how
> misguided someone’s efforts. Unless I’m missing something, no
> one is
> making you respond to any of these e-mails. This, in my
> opinion, is a
> forum for questions, answers and, at the worst, constructive
> criticism.
>
>
> M. M. O’Brien
>
>
> >>> xxxxx@ieee.org 6/19/2005 2:38:30 PM >>>
> Michal,
>
> What you have written is all ok. “I prefer this, you prefer
> that”, that’s very normal, and it’d be a wonder if we all
> preferred the same techniques and software. But it’s
> definitely
> not ok to throw words like “this is stupid” at a fellow
> professional, or to say “it doesn’t work” about things that
> are
> known to work and quite well indeed, only because you happen
> not
> to like those particular things!
>
> Alberto.
>
>


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

You are currently subscribed to ntdev as: unknown lmsubst tag
argument: ‘’
To unsubscribe send a blank email to
xxxxx@lists.osr.com

I just grepped the postings of Michal and found nowhere the word
‘stupid’. So Michal never said it or I missed a post.

I found ‘nonsense’ ( or similar :-). As this thread went
from a technical discussion to an exchange of opinions I think it is
quite normal to find such wordings.

Some more famous topics ( some of it are available in the archives):

IDE vs. Commandline

C vs. C++ (in Kernelmode)

Emacs vs. VI (SlickEdit,Multi-Edit, Notepad …)

if{ vs. if
} {
}

CamelCase vs. under_lines

Softice vs. WinDbg

Norbert.

“It is the spirit we bring to the battle that decides the issue.”
---- snip ----