trouble with SOURCES

BUILD is quite capable of parallel builds. If it wasn’t, NT builds would take far longer than they do. This is documented in MSDN. Look at the macros for SYNCHRONIZE_DRAIN, SYNCHRONIZE_BLOCK, BUILD_PRODUCES, BUILD_CONSUMES, the command-line docs for BUILD, and the MSDN topic “Building on a Multiprocessor Computer”.

Sometimes people (including me) have trouble with BUILD because the DIRS and SOURCES files are read and interpreted by two very different programs – NMAKE and BUILD. BUILD reads DIRS and SOURCES files, analyzes inter-component dependencies (including parallelization), and runs any number of NMAKE instances. But BUILD and NMAKE interpret the SOURCES file differently. NMAKE doesn’t have any special knowledge of SOURCES files; that’s why the one-line MAKEFILE includes MAKEFILE.DEF, which aligns NMAKE’s perception of the SOURCES file with that of BUILD. BUILD assigns specific meanings to many of the macros documented, such as SYNC* ones I mentioned.

This is why you can’t do some tricks, such as building the SOURCES macro (not file) using !INCLUDE, or within !IF blocks, or a lot of other things that seem rational when you’re writing a makefile. BUILD does not implement the same NMAKE preprocessor, so it interprets all lines unconditionally. So think of SOURCES as a declarative description of a component, not a makefile. Sure, there are escapes, such as makefil0 and makefile.inc. All this is documented in MSDN, as well.

So, long story short, BUILD handles inter-component dependency analysis (ordering and running parallel NMAKE instances) for very large source trees, and NMAKE handles intra-component dependencies. Actually BUILD does *some* intra-component analysis (header files, etc.), but there are situations that confuse it.

Personally, I think that people who chose (2) are insane, as it breaks
basically every fundamental rule and/or convention governing separate
compilation, and still results in a far from transparent hack to
workaround around a build system.

Not quite. Separate compilation doesn’t really buy you much. Separate compilation can even be a detriment. The majority of the large components I’ve worked on usually converge on having a single project-wide #include file, so that every .C file is working with the same environment. With precompiled headers, this usually reduces your compile time, too. (If you aren’t using PRECOMPILED_INCLUDE… then why aren’t you?!) In projects where it is possible to rebuild a single .obj file and then rebuild the component, you often hit problems where the dependency analysis wasn’t quite right and several .obj files have different ideas of the layout of shared structures, function prototypes, etc. So I usually rebuild the entire component anyway. With precompiled headers, it’s very fast. This is one area where I really, truly prefer C# and its relatives – file-by-file compilation is a maintenance headache, and it was only necessary as a work-around for machines with very little memory. We’re beyond that time.

#including other C files is conceptually quite similar to precompiled headers. You expose the compiler to all of the prototypes, structure definitions, etc. in a single pass, so again you get consistency. And I don’t see how it breaks any “fundamental rules”. You can still organize your code any way you please.

Anyway, this is clearly one of those “taste” issues. Some like Coke, some like Pepsi. (And in some provinces, they’re both outlawed, at least right now!) We’re *kind* of off-topic, but since BUILD ships with the DDK, I guess we’re safe.

Anyways, I think build.exe is a good tool for small scale drivers
and for getting started project. But as the size of your driver
increase and you start having auto code/header/ Makefile
generation, you ll need to pull back with a traditional build system.

Like 30 million lines of code?

– arlie

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of bank kus
Sent: Wednesday, August 30, 2006 1:51 AM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

“Martin O’Brien” wrote in message news:xxxxx@ntdev…
> JEREMY:
>
> As far as SOURCES/DIRS/BUILD goes, no you’ve got it right - it really,
> really sucks. To do what you wish you have three basic options:
>
> 1. The one you have already described 2. Include the .C/.CPP files
> from the folder in which you compile 3. Don’t use BUILD
>
> Personally, I think that people who chose (2) are insane, as it breaks
> basically every fundamental rule and/or convention governing separate
> compilation, and still results in a far from transparent hack to
> workaround around a build system.
>
> I’ve used something I’ve written (just a set of makefiles and a couple
> of perl scripts) for about seven years. As long as you check that the
> compiler and linker settings are still valid with each new DDK/WDK
> that you use, you shouldn’t have any trouble. The only nice feature
> of BUILD that gets lost here (assuming you use only CL, LINK, and
> NMAKE) is automatic dependency information.

Cant agree any more with it. GNU Make ( and its Windows port Mingw ) works for me but it has its own restrictions.
Particularly the topic of recursive build can be a hairy one that modern build systems like Makepp/ JAM do better at. The topic of contention being do you createprocess (make.exe or whatever your tool is ) once for each directory or do you include your sub directory Makefiles into the parent makefile and run Make just once.
Apart from the createprocess overhead, continous directory recursion is bad for build level parallelism.

I think in one of the replies somebody from Microsoft mentioned parallel builds. I was not aware whether build.exe / nmake is capable of parallel build / dependency tree walking capability. Or is it?

Anyways, I think build.exe is a good tool for small scale drivers and for getting started project. But as the size of your driver increase and you start having auto code/header/ Makefile generation, you ll need to pull back with a traditional build system.

> I can’t help you with your second question (WPP), as I know nothing
> about it. I looked at it once, and decided that KdPrint was just fine.
>
> Good luck,
>
> MM
>
>
>
>>>> xxxxx@telestream.net 2006-08-28 17:56:02 >>>
> I would like to organize my driver source code into subdirectories
> based on the codes primary function and I’m having a lot of trouble.
> I’ve read through OSR Online, Google, and the DDK Docs and I’ve found
> that the only good way to do this is to make each subfolder a library,
> and then
>
> link them all together. First, I just want to say that I think this
> sucks. It is frustrating enough that I have to jump through so many
> hoops to just use basic C++, and then to add insult to injury, I can’t
>
> even organize my source files in an object oriented way. Has everyone
> just gotten used to the ridiculous restrictions in SOURCES files, or
> am
>
> I just missing out on some import concept?
>
> Anyway, enough ranting. My new problem is trying to include *.tmh
> files
>
> in my library. I tried adding the RUN_WPP code to my libraries SOURCES
>
> file, but nothing was generated. Should I try to include the *.tmh
> file
>
> from my parent project? How do I add the correct include path to my
> libraries SOURCES file?
>
> Thanks,
> --Jeremy
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


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

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

>>What do you think the OS should do instead?

It should carry on.

>How does
>How do

I’m sorry, but the answers are sensitive and subject to NDA.

>I more then happy to hear how you think a modern OS which loads all the
>drivers in one address space

I think it can’t.

I didn’t meant to offend Microsoft. I realise the guys did their best 15
years ago. I just expressed my understanding of a good OS. After all,
Windows usually does not crash because of user mode hello world. Why should
it because of a driver? Yeah, I know, it’s by design.

:slight_smile:

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct? How do you know why the driver crashed? Is it b/c it
touched a random value? Or it was touching pool that it already freed,
corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the
drivers in one address space (so let’s skip mach in this instance) can
achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware


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

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

Hey I’ve got all the hard problems solved too, I just can’t tell you
what the solutions are, its sensitive and subject to NDA.

The solutions in this area are really all pretty well known. You might
be covered by an NDA but I doubt the solution is either new or without
major ‘no free lunch’ issues.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Wednesday, August 30, 2006 4:13 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

>What do you think the OS should do instead?

It should carry on.

>How does
>How do

I’m sorry, but the answers are sensitive and subject to NDA.

>I more then happy to hear how you think a modern OS which loads all
the
>drivers in one address space

I think it can’t.

I didn’t meant to offend Microsoft. I realise the guys did their best 15

years ago. I just expressed my understanding of a good OS. After all,
Windows usually does not crash because of user mode hello world. Why
should
it because of a driver? Yeah, I know, it’s by design.

:slight_smile:

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct? How do you know why the driver crashed? Is it b/c it
touched a random value? Or it was touching pool that it already freed,
corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the
drivers in one address space (so let’s skip mach in this instance) can
achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware


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

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


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

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

Well, user-mode Hello World faulting and kernel-mode Hello World Driver faulting are not necessarily analagous. User-mode HelloWorld is limited in the scope of the things it touches. You can just tear down its address space and poof… no harm done except to that process.

Even if you isolate the kernel-mode Hello World Driver from the rest of the OS, you’ll have device-specific issues to deal with. With some serious re-architecting, could Windows do a BETTER job than it does to isolate drivers and not make every driver fault crash the system. Almost certainly. A food first step would be to get the non-essential drivers out of kernel mode. But is it likely that you could get to a place where ANY driver can fault and NEVER crash the system? I don’t see it.

You can, for example, have outstanding interrupts for the device with the faulting driver. Should a faulting driver be “trusted” to reset its hardware? You can’t just disable the interrupt… it could be shared. And, what do you do with user-mode apps that are accessing the device? I guess you just start returning STATUS_INVALID_HANDLE and hope the apps all deal with this… And there are the issues Doron raised about shared state – like paging. Sorry, the disk driver faulted, and SOME data’s in the page file…

When your new fault tolerant OS comes out, please be sure to put me on the Beta list. Until then…

Peter
OSR

Take it easy, Mark. Do you expect me to publish
commercially sensitive ideas here, for free riders? While Microsoft is
patenting
things like “IS NOT” (app #20040230959) or double-click (pat #6,727,830)?

Anyway, very soon we will be writing hardware drivers in script (pat
#7,100,170)
http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2Fsearch-bool.html&r=4&f=G&l=50&co1=AND&d=ptxt&s1=Microsoft.ASNM.&OS=AN/Microsoft&RS=AN/Microsoft

If Microsoft patented such a brilliant innovative idea, I am sure they are
eager to make use of it ASAP.

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
Hey I’ve got all the hard problems solved too, I just can’t tell you
what the solutions are, its sensitive and subject to NDA.

The solutions in this area are really all pretty well known. You might
be covered by an NDA but I doubt the solution is either new or without
major ‘no free lunch’ issues.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Wednesday, August 30, 2006 4:13 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

>>What do you think the OS should do instead?

It should carry on.

>>How does
>>How do

I’m sorry, but the answers are sensitive and subject to NDA.

>>I more then happy to hear how you think a modern OS which loads all
the
>>drivers in one address space

I think it can’t.

I didn’t meant to offend Microsoft. I realise the guys did their best 15

years ago. I just expressed my understanding of a good OS. After all,
Windows usually does not crash because of user mode hello world. Why
should
it because of a driver? Yeah, I know, it’s by design.

:slight_smile:

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct? How do you know why the driver crashed? Is it b/c it
touched a random value? Or it was touching pool that it already freed,
corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the
drivers in one address space (so let’s skip mach in this instance) can
achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware


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

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


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

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

http://research.microsoft.com/os/singularity/

Nuff said.

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Wednesday, August 30, 2006 2:46 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

Take it easy, Mark. Do you expect me to publish commercially sensitive ideas here, for free riders? While Microsoft is patenting things like “IS NOT” (app #20040230959) or double-click (pat #6,727,830)?

Anyway, very soon we will be writing hardware drivers in script (pat
#7,100,170)
http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=%2Fnetahtml%2Fsearch-bool.html&r=4&f=G&l=50&co1=AND&d=ptxt&s1=Microsoft.ASNM.&OS=AN/Microsoft&RS=AN/Microsoft

If Microsoft patented such a brilliant innovative idea, I am sure they are eager to make use of it ASAP.

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
Hey I’ve got all the hard problems solved too, I just can’t tell you what the solutions are, its sensitive and subject to NDA.

The solutions in this area are really all pretty well known. You might be covered by an NDA but I doubt the solution is either new or without major ‘no free lunch’ issues.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Wednesday, August 30, 2006 4:13 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

>>What do you think the OS should do instead?

It should carry on.

>>How does
>>How do

I’m sorry, but the answers are sensitive and subject to NDA.

>>I more then happy to hear how you think a modern OS which loads all
the
>>drivers in one address space

I think it can’t.

I didn’t meant to offend Microsoft. I realise the guys did their best 15

years ago. I just expressed my understanding of a good OS. After all, Windows usually does not crash because of user mode hello world. Why should it because of a driver? Yeah, I know, it’s by design.

:slight_smile:

“Doron Holan” wrote in message news:xxxxx@ntdev…
Ok, I’ll bite. What do you think the OS should do instead? Just terminate the thread that the driver was on? How does the OS know that the state of its structures and of the other drivers’ structures are still correct? How do you know why the driver crashed? Is it b/c it touched a random value? Or it was touching pool that it already freed, corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the drivers in one address space (so let’s skip mach in this instance) can achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?) of BSODs out there!

Dmitriy Budko
VMware


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

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


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

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


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

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

>BSOD immediately). BTW, Linux (more-or-less modern OS) just kills the

Linux is grossly mis-architectured compared to Windows and to FreeBSD.

For instance, they have mis-designed VFS layer compared to FreeBSD’s, which
introduced the need in a lot of dirty tricks to implement the filesystems which
do not have the on-disk notion of “inode number” (like FAT) on Linux.

They also 100% rewrote their USB stack and threw the old one to the recycle bin
:slight_smile: you can be sure such things are only done if the old code had major
architectural issues
.

Yes, Windows is overdesigned, but at least it sustained no major rewrites since
1993, and only 1 next-to-major one - the PnP/Power Management in w2k.

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

>I see, so let’s take this scenario. DriverEntry() is called on a work

item thread. The caller (IopLoadUnloadDriver) has state associated with
it that is only cleaned up on return from DriverEntry(). DriverEntry()
blows up and we kill the thread. All that state is gone.

Correct. The only solution for “the OS tolerant to driver failures” task is the
microkernel OS with each driver in its separate process, and this is suboptimal
from the perf point of view.

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

> I think in one of the replies somebody from Microsoft mentioned parallel

builds. I was not aware whether build.exe / nmake
is capable of parallel build / dependency tree walking capability. Or is it?

Yes it can, at least on SMP machines.

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

> http://research.microsoft.com/os/singularity/

Nuff said.

Cool stuff…

Back in the mid 80’s, I worked on a project to move the KeyKos
architecture (http:</http:>) to a major vendor’s
new h/w platform. The project was cancelled after a year, but it was
cool project back then.

Hmmm…

Actually I expect that if you are going to discuss a technical issue on
a technical forum that you will not do so by hiding behind ‘can’t tell
you’. No big deal though. I just thought it was amusing that Windows is
obviously doing the wrong thing when it comes to software fault
detection in critical trusted components, but the examples of the right
thing are a) linux - carry on, who cares, what me worry; and b) if I
told you I’d have to kill you.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Wednesday, August 30, 2006 5:46 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

Take it easy, Mark. Do you expect me to publish
commercially sensitive ideas here, for free riders? While Microsoft is
patenting
things like “IS NOT” (app #20040230959) or double-click (pat
#6,727,830)?

Anyway, very soon we will be writing hardware drivers in script (pat
#7,100,170)
http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO2&Sect2=HITOFF&p=1&u=
%2Fnetahtml%2Fsearch-bool.html&r=4&f=G&l=50&co1=AND&d=ptxt&s1=Microsoft.
ASNM.&OS=AN/Microsoft&RS=AN/Microsoft

If Microsoft patented such a brilliant innovative idea, I am sure they
are
eager to make use of it ASAP.

“Roddy, Mark” wrote in message
news:xxxxx@ntdev…
Hey I’ve got all the hard problems solved too, I just can’t tell you
what the solutions are, its sensitive and subject to NDA.

The solutions in this area are really all pretty well known. You might
be covered by an NDA but I doubt the solution is either new or without
major ‘no free lunch’ issues.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Wednesday, August 30, 2006 4:13 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

>>What do you think the OS should do instead?

It should carry on.

>>How does
>>How do

I’m sorry, but the answers are sensitive and subject to NDA.

>>I more then happy to hear how you think a modern OS which loads all
the
>>drivers in one address space

I think it can’t.

I didn’t meant to offend Microsoft. I realise the guys did their best 15

years ago. I just expressed my understanding of a good OS. After all,
Windows usually does not crash because of user mode hello world. Why
should
it because of a driver? Yeah, I know, it’s by design.

:slight_smile:

“Doron Holan” wrote in message
news:xxxxx@ntdev…
Ok, I’ll bite. What do you think the OS should do instead? Just
terminate the thread that the driver was on? How does the OS know that
the state of its structures and of the other drivers’ structures are
still correct? How do you know why the driver crashed? Is it b/c it
touched a random value? Or it was touching pool that it already freed,
corrupting somebody else’s data?

I more then happy to hear how you think a modern OS which loads all the
drivers in one address space (so let’s skip mach in this instance) can
achieve this.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of cristalink
Sent: Tuesday, August 29, 2006 8:35 PM
To: Windows System Software Devs Interest List
Subject: Re:[ntdev] trouble with SOURCES

No, it’s Microsoft. I doubt a properly designed OS should crash simply
because of a bug in a hello world driver.

“Dmitriy Budko” wrote in message news:xxxxx@ntdev…
> Geez Tim, are we really insignificant? :slight_smile:
>
> -dc

No, quite the opposite – we are responsible for the majority (%70-%80?)
of
BSODs out there!

Dmitriy Budko
VMware


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

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


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

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


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

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

Actually, my favorite on Linux is the explanation of why to no put in bug
checks on things like allocations. I was told by a bunch of senior
developers who had worked on Linux for years that “by not testing if the
allocation succeeded it makes it easy to pinpoint the problem, since when it
crashes the dump will show you the variable that did not get allocated!”.
Note: these guys were in the enterprise server space and had worked on
mainframes running Linux before that!

Just to confirm how bad things were, when PreFast first came out (missing
most of the checks of today) I ran it over a bunch of Red Hat kernel source.
This is the only time I saw PreFast loose it, there were so many bugs it got
confused and crashed. By splitting things into small pieces I got it to run
with error counts in the hundreds per routine!


Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com

“Roddy, Mark” wrote in message news:xxxxx@ntdev…
Hmmm…

Actually I expect that if you are going to discuss a technical issue on
a technical forum that you will not do so by hiding behind ‘can’t tell
you’. No big deal though. I just thought it was amusing that Windows is
obviously doing the wrong thing when it comes to software fault
detection in critical trusted components, but the examples of the right
thing are a) linux - carry on, who cares, what me worry; and b) if I
told you I’d have to kill you.

Agreed. Seriously, though, take a look at Singularity. It’s a microkernel OS, but instead of using MMU hardware to enforce process boundaries, they use compile-time code analysis. Driver faults are isolated, although DMA devices can still cause problems, at least until IOMMUs are a reality. Empirical testing shows performance to be quite good. Their prototype web server came within striking distance of IIS/Apache on standardized web server throughput testing. Instead of copying data between processes, or mapping shared memory segments, processes transfer ownership of memory in a verifiably-correct manner. Also, OS APIs can be safely inlined, because the instruction stream is considered “trusted” by the OS, because it was generated by a trusted OS component (the verifying compiler).

It’s a research prototype, but I honestly think it’s the most significant development in OS reliability since the MMU.

– arlie


From: xxxxx@lists.osr.com On Behalf Of Maxim S. Shatskih
Sent: Wednesday, August 30, 2006 7:49 PM
To: Windows System Software Devs Interest List
Subject: Re: [ntdev] trouble with SOURCES

I see, so let’s take this scenario. DriverEntry() is called on a work
item thread. The caller (IopLoadUnloadDriver) has state associated with
it that is only cleaned up on return from DriverEntry(). DriverEntry()
blows up and we kill the thread. All that state is gone.

Correct. The only solution for “the OS tolerant to driver failures” task is the
microkernel OS with each driver in its separate process, and this is suboptimal
from the perf point of view.

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


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

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