Buildring driver

Hi,

I have the following problem. Because of changes in our build environment my boss
wants me to come up with a Visual Studio project we can use to build drivers using
the .NET compiler.

I know this is not a good idea but I haven;t been able to come up with good arguments.

Can someone please help me with the following questions:

I believe NT 4.0 DDK and Win2K DDK support Visual C 6.0 compiler only. Is it possible at all to use the compiler included in .NET ? Is this just not suported or will this actually not work?

I know that it is recommended to build a driver for the oldest platform you are going to support. Our build server is an XP machine, will I be able to build a NT 4.0 style driver (e.g. originally developed with the NT 4.0 DDK). I am afraid that even if it would compile I will run into all kind of bizare problems when it runs on customer PC’s.

Thanks all,
Jos.

Here we go again. This has been asked, debated, debated even more, and “decided” many times. Microsoft only supports using the compiler that ships with the DDKs. If you want to have your driver in the box for future operating systems - usually just for hardware - you must provide source code that Microsoft can build and modify as needed during the Alpha/Beta testing cycles. All drivers shipped with the OS and the OS components, including GUI, are compiled with the build environment and the command line compiler.

I have been writing device drivers for many years including DOS, Windows 9x, NT, 2000, XP, & 2003. With several releases of the Microsoft compiler of the day, various pieces of code that worked began failing. Sometimes the linker was released with no capability to link 9x drivers that would work. The DDK group didn’t have any control over the compiler releases and that is why I believe that Microsoft, when trying to improve system stability, gave the DDK group the ability to release a tested compiler. It did eliminate the free download of the DDK because of licensing issues, or so I have heard. Even the BSCMAKE program was omitted from the DDK release, but you can get the copy from the full compiler release and it will work. If you get a MSDN subscription of Pro and higher, the compilers are included.

You can have several DDKs installed on a single machine. I have several and I can use any or all of them without rebooting or changing environment variables, but I worked rather hard to design it to do so. The latest DDKs are supposed to support earlier operating systems with only some restrictions about them dropping support for some of the earliest. I don’t know of any way to compile for Windows 95 or even NT 3.x with the latest DDKs.

I can run as many builds of device drivers I want with one batch file. It can build for any OS using any DDK needed for that project. I can even build multiple OS versions of one single driver - such as NT 4, W2K, & XP where the XP version can use some of the newer system calls and the NT 4 version can be free of power and PnP support.

Is your boss a Dilbert pointy-hair type? If so, my condolences. Search the archives and find other reasons to use the Microsoft specified tools.
“Jos Scherders” wrote in message news:xxxxx@ntdev…
Hi,

I have the following problem. Because of changes in our build environment my boss
wants me to come up with a Visual Studio project we can use to build drivers using
the .NET compiler.

I know this is not a good idea but I haven;t been able to come up with good arguments.

Can someone please help me with the following questions:

I believe NT 4.0 DDK and Win2K DDK support Visual C 6.0 compiler only. Is it possible at all to use the compiler included in .NET ? Is this just not suported or will this actually not work?

I know that it is recommended to build a driver for the oldest platform you are going to support. Our build server is an XP machine, will I be able to build a NT 4.0 style driver (e.g. originally developed with the NT 4.0 DDK). I am afraid that even if it would compile I will run into all kind of bizare problems when it runs on customer PC’s.

Thanks all,
Jos.

David gives a nice summary of the issues. Let me second his last point:
If you have a problem convincing your boss, search this group and also
microsoft.public.development.device.drivers for more ammunition.

You can, by the way, use Visual Studio as a front end to building via
the DDK’s compiler, and so can satisfy your boss in part. Search for
DDKBUILD.

Jos Scherders wrote:

Because of changes in our build environment my bosswants me to come up
with a Visual Studio project we can use to build drivers usingthe .NET
compiler.


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP

The sad state of affairs is, use a different compiler at your own risk.

That risk includes possible incompatibilities with the Linker, dependencies
by Microsoft software on code generation sequences that are specific to the
DDK compiler, unsafe optimizations by other compilers that lead to bugs or
crashes, and so on. Thing is, if the driver model and API was pristine
clean, it would be a feasible proposition to use a different compiler and
linker, but reality points the other way.

My question to Jos is, is there a solid reason not to use the DDK compiler ?
The .net IDE can be told to use the DDK compiler.

Alberto.

-----Original Message-----
From: David J. Craig [mailto:xxxxx@yoshimuni.com]
Sent: Thursday, August 07, 2003 7:32 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Buildring driver

Here we go again. This has been asked, debated, debated even more, and
“decided” many times. Microsoft only supports using the compiler that ships
with the DDKs. If you want to have your driver in the box for future
operating systems - usually just for hardware - you must provide source code
that Microsoft can build and modify as needed during the Alpha/Beta testing
cycles. All drivers shipped with the OS and the OS components, including
GUI, are compiled with the build environment and the command line compiler.

I have been writing device drivers for many years including DOS, Windows 9x,
NT, 2000, XP, & 2003. With several releases of the Microsoft compiler of
the day, various pieces of code that worked began failing. Sometimes the
linker was released with no capability to link 9x drivers that would work.
The DDK group didn’t have any control over the compiler releases and that is
why I believe that Microsoft, when trying to improve system stability, gave
the DDK group the ability to release a tested compiler. It did eliminate
the free download of the DDK because of licensing issues, or so I have
heard. Even the BSCMAKE program was omitted from the DDK release, but you
can get the copy from the full compiler release and it will work. If you
get a MSDN subscription of Pro and higher, the compilers are included.

You can have several DDKs installed on a single machine. I have several and
I can use any or all of them without rebooting or changing environment
variables, but I worked rather hard to design it to do so. The latest DDKs
are supposed to support earlier operating systems with only some
restrictions about them dropping support for some of the earliest. I don’t
know of any way to compile for Windows 95 or even NT 3.x with the latest
DDKs.

I can run as many builds of device drivers I want with one batch file. It
can build for any OS using any DDK needed for that project. I can even
build multiple OS versions of one single driver - such as NT 4, W2K, & XP
where the XP version can use some of the newer system calls and the NT 4
version can be free of power and PnP support.

Is your boss a Dilbert pointy-hair type? If so, my condolences. Search the
archives and find other reasons to use the Microsoft specified tools.

“Jos Scherders” < xxxxx@home.nl mailto:xxxxx > wrote in
message news:xxxxx@ntdev news:xxxxx
Hi,

I have the following problem. Because of changes in our build environment my
boss
wants me to come up with a Visual Studio project we can use to build drivers
using
the .NET compiler.

I know this is not a good idea but I haven;t been able to come up with good
arguments.

Can someone please help me with the following questions:

I believe NT 4.0 DDK and Win2K DDK support Visual C 6.0 compiler only. Is it
possible at all to use the compiler included in .NET ? Is this just not
suported or will this actually not work?

I know that it is recommended to build a driver for the oldest platform you
are going to support. Our build server is an XP machine, will I be able to
build a NT 4.0 style driver (e.g. originally developed with the NT 4.0 DDK).
I am afraid that even if it would compile I will run into all kind of bizare
problems when it runs on customer PC’s.

Thanks all,
Jos.


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

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

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.</news:xxxxx></mailto:xxxxx>

Have you ever read the comic strip “Dilbert”? Does your boss have pointy hair?

I really wouldn’t wanbt to be in his/her shoes when things go bump in the night because of a compiler incompatibility.


Gary G. Little
Seagate Technologies, LLC
xxxxx@seagate.com
“Jos Scherders” wrote in message news:xxxxx@ntdev…
Hi,

I have the following problem. Because of changes in our build environment my boss
wants me to come up with a Visual Studio project we can use to build drivers using
the .NET compiler.

I know this is not a good idea but I haven;t been able to come up with good arguments.

Can someone please help me with the following questions:

I believe NT 4.0 DDK and Win2K DDK support Visual C 6.0 compiler only. Is it possible at all to use the compiler included in .NET ? Is this just not suported or will this actually not work?

I know that it is recommended to build a driver for the oldest platform you are going to support. Our build server is an XP machine, will I be able to build a NT 4.0 style driver (e.g. originally developed with the NT 4.0 DDK). I am afraid that even if it would compile I will run into all kind of bizare problems when it runs on customer PC’s.

Thanks all,
Jos.

It’s reasonable to wish for a cleaner model and APIs, but you’re also
wishing for compiler magic, in the sense of always generating correct
code and correct optimizations. That beastie doesn’t exist and probably
never will. So Microsoft restricts its support to things built with a
compiler it controls and understands.

“Moreira, Alberto” wrote:

if the driver model and API was pristine clean, it would be a feasible
proposition to use a different compiler and linker


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP

What I’m not sure I understand is what “Microsoft support” means in this
context. Ok, they support the API, but do I need anything else ? Ideally, if
the API is negotiated correctly, it should work - and while samples and
other goodies make life easier, the only thing that’s really mandatory in
the DDK is the header files, and I consider those part of the API. I may be
an extreme case of minimalism, but I’d be happier if they supplied the API
and stated, well, “if you adhere to the API your driver will work” and let
me set up my own development environment. Anything beyond that, as I see it,
is extra load that I might be tempted to drop by the side of the road, that
is, if only I could.

Alberto.

-----Original Message-----
From: James Antognini [mailto:xxxxx@mindspring.nospam.com]
Sent: Friday, August 08, 2003 1:54 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Buildring driver

It’s reasonable to wish for a cleaner model and APIs, but you’re also
wishing for compiler magic, in the sense of always generating correct code
and correct optimizations. That beastie doesn’t exist and probably never
will. So Microsoft restricts its support to things built with a compiler it
controls and understands.

“Moreira, Alberto” wrote:

if the driver model and API was pristine clean, it would be a feasible
proposition to use a different compiler and linker


If replying by e-mail, please remove “nospam.” from the address.

James Antognini
Windows DDK MVP

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

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

The contents of this e-mail are intended for the named addressee only. It
contains information that may be confidential. Unless you are the named
addressee or an authorized designee, you may not copy or use it, or disclose
it to anyone else. If you received it in error please notify us immediately
and then destroy it.

No, a runtime environment is much more than an API. For the Windows driver world, this includes stack conventions for exception handling and compiler internal runtimes for things the hardware doesn’t do directly. This is why Microsoft legislates that a certain version of the compiler is used with a version of the OS for drivers.

This reminds me of a chip vendor who about 15 years ago came out with a RISC chip and tried to legislate that all compiler vendors would play the same, i.e. not just run programs on Unix with the same libaries, but allow vendor X’s subroutines to work with vendow Y’s routines no matter what the language or the compiler was. I was running a code generator team at the time, and along with the other vendors we tried to explain that this was not going to happen for things like extensions to “C” let alone for languages with large runtime support such as Cobol, Fortran, and others. The intenal runtimes are as much a part of the proprietary compilers as the code generation itself.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: Moreira, Alberto
To: Windows System Software Developers Interest List
Sent: Friday, August 08, 2003 2:09 PM
Subject: [ntdev] Re: Buildring driver

What I’m not sure I understand is what “Microsoft support” means in this context. Ok, they support the API, but do I need anything else ? Ideally, if the API is negotiated correctly, it should work - and while samples and other goodies make life easier, the only thing that’s really mandatory in the DDK is the header files, and I consider those part of the API. I may be an extreme case of minimalism, but I’d be happier if they supplied the API and stated, well, “if you adhere to the API your driver will work” and let me set up my own development environment. Anything beyond that, as I see it, is extra load that I might be tempted to drop by the side of the road, that is, if only I could.

Alberto.
-----Original Message-----
From: James Antognini [mailto:xxxxx@mindspring.nospam.com]
Sent: Friday, August 08, 2003 1:54 PM
To: Windows System Software Developers Interest List
Subject: [ntdev] Re: Buildring driver

It’s reasonable to wish for a cleaner model and APIs, but you’re also wishing for compiler magic, in the sense of always generating correct code and correct optimizations. That beastie doesn’t exist and probably never will. So Microsoft restricts its support to things built with a compiler it controls and understands.
“Moreira, Alberto” wrote:

if the driver model and API was pristine clean, it would be a feasible proposition to use a different compiler and linker

If replying by e-mail, please remove “nospam.” from the address.
James Antognini
Windows DDK MVP

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

You are currently subscribed to ntdev as: xxxxx@compuware.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: xxxxx@acm.org
To unsubscribe send a blank email to xxxxx@lists.osr.com

The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it.

MS recommends to use the compiler shipped with the XP DDK. It is the same compiler used by MS to build the OS itself, and thus it is recommended.

MSVC and VS.NET are just not intended for this work. So, calling BUILD as Custom Build Step can be the best idea.

If it was me, I would switch all user-mode software to use BUILD :slight_smile:

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

----- Original Message -----
From: Jos Scherders
To: Windows System Software Developers Interest List
Sent: Friday, August 08, 2003 2:14 AM
Subject: [ntdev] Buildring driver

Hi,

I have the following problem. Because of changes in our build environment my boss
wants me to come up with a Visual Studio project we can use to build drivers using
the .NET compiler.

I know this is not a good idea but I haven;t been able to come up with good arguments.

Can someone please help me with the following questions:

I believe NT 4.0 DDK and Win2K DDK support Visual C 6.0 compiler only. Is it possible at all to use the compiler included in .NET ? Is this just not suported or will this actually not work?

I know that it is recommended to build a driver for the oldest platform you are going to support. Our build server is an XP machine, will I be able to build a NT 4.0 style driver (e.g. originally developed with the NT 4.0 DDK). I am afraid that even if it would compile I will run into all kind of bizare problems when it runs on customer PC’s.

Thanks all,
Jos.

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