July 04, 2009

Search is sick, Bing is the cure

Oh dear...

This article at http://www.msnbc.msn.com/id/31084838/ is titled "Microsoft ads say search is sick, Bing is the cure". Cute...

But, didn't anyone tell them that the Chinese word "bìng" (), which is pronounced with the 4th tone, very similar to the English pronounciation of bing, means "sick" or "to get sick"???

More than 1 billion people, people that seem to believe in things like lucky numbers and "bad" sounds, people that feel that the number 4 is unlucky because it sounds like "death", these people say "wǒ bìng le" (我病了) and they mean "I am SICK". And MS hopes to make bing a new verb for searching and have them type in www.bing.com every now and then to do their searches?

Oh dear... I think I need another drink...

May 28, 2009

Firewire Expert Blog

Hi everyone,

Some weeks ago I posted a link to some Firewire informational videos. Now there is an insiders' blog about the history and business decisions that affected Firewire's development, written by the man himself, James Snider the Executive Director of the 1394 Trade Association. Jeff Cat is just a nickname that James is using. In an act of shameless promotion I would say that I think it is worth your time to check it out.

Oh, and here's the link: Firewire Expert Blog

Have fun!

Dimitris

March 18, 2009

Firewire Informational Videos

Hi all,

The 1394 Trade Association (www.1394ta.org) recently started a series of Firewire informational videos on YouTube. These are like "video FAQs", not full fledged tutorials. However, these videos are not made by "self-proclaimed" experts but by the 1394 Trade Association, so you are guaranteed that what you will see and hear is accurate.

Surely the 1394 Trade Association has "promoting 1394 technology" in its mission statement, but it is not a marketing organization. These videos are not marketing material, but answers to common questions about Firewire.

You can check them out at: http://www.youtube.com/user/FireWireExpert

Currently there are only a few, but if there is enough traffic then the 1394TA will decide to invest more time and money on this approach. Surely enough, you can understand that it takes much more time to prepare a video FAQ than typing in 20 lines of text on some web page.

Also don't hesitate to email them your questions, if you happen to have any.

Have fun,

Dimitris Staikos

October 30, 2008

Digital Misfortunes: Remote desktop messes up keyboard layout of logon screen

It seems that lately I have been having a peak of digital troubles, which I have come to call "Digital Misfortunes". These are situations where programs or computers do not behave in the expected way and I have to utilize the "supernatural" powers that device driver development has given me in order to solve these problems.

So, since these things seem to happen more and more often I have created a new category in my blog, with that name exactly.

It really makes me sad to see that more and more problems keep coming up. What would a normal user do? Format and reinstall the OS? Most likely...

Continue reading "Digital Misfortunes: Remote desktop messes up keyboard layout of logon screen" »

October 24, 2008

How violating KISS can end up in 100% CPU usage by your antivirus

Hi all,

I have been using an antivirus/firewall product on 4 of my computers, 2 desktops and 2 laptops, for more than a year without any troubles and was more than happy for the money I paid for it.

However at some moment I noticed that the my IBM ThinkPad X41 was extremely slow. Process Explorer would show CPU utilization being constantly at 100% and the culprit was the executable of the antivirus software.

If I disabled the antivirus real-time protection then CPU went down to normal. When I reenabled it then back to 100%.

To start with I left the laptop open for a couple of days so maybe the antivirus would get done with something it was doing but of course that was a silly thought without results. Then I tried to uninstall and reinstall it but this was just another silly thought and of course the problem remained.

So I decided to use the artillery. I opened up Process Monitor by SysInternals just to take a look at what the antivirus was doing.

Suprise!

It was scanning over and over a 9MB html file!

The location of this file?
C:\Program Files\ThinkPad\ConnectUtilities and the name of it AddConnAdvanced.html

So I added this file to the exclusion list and my laptop became normal again.

I thought maybe my laptop downloaded some software update that screwed things up, so I decided to look at what could a 9MB html file possibly hold...

Surprise (again)!

It was the IBM diagmostics utility debug log...

Then I remembered... I had a problem with the wifi on the laptop about two months ago. So I turned on the debug diagnostics and of course forgot it on even after I solved the problem.

It seems that the IBM developers wanted to appear slick I guess, so a .TXT file was not good enough for them but instead they output an HTML file which eventually gets huge, it is an HTML file so it gets scanned by adivirus software because it might be malicious, ending up in a frustrated user >:( .
Bravo! Way to go!

I do device driver development for a living and as a result I have a "lean and mean" mentality, some also call it KISS (Keep It Simple Stupid). I just hate it when people use HTML/XML for something that could be done with a plain txt, or use .NET for a config utility because they want to add a silly jpg on the dialog and don't know how to do this in plain Win32.

Things are simple: When you do more than you absolutely have to, then you increase your application's "problem surface". More and more things can go wrong and you DON'T want things to go wrong with low level stuff like debug logs and config utilities.

To understand the extent of this problem, that is doing more than you have to just because it is cool, be amused to know that some PhD guys that obviously hadn't do much programming in their lives, designed a camera specification called Genicam, and designed a feature by which the camera could send to the application a file that describes in a standard format all of its settings. This "standard" format of course was XML and everybody was so happy and cool. Of course the time came to write a device driver for such a camera and guess what? How on earth do you fit an XML parser in kernel mode code? Only if you want to play cowboy and device driver developers usually don't have much free time to play cowboy. Using XML, which is user mode crap, for some simple text information that NEVER changes is against KISS.

Dude, do I hear someone saying "but what about schema validation etc"??? We are not talking about a file that got created by a user. We are talking about a file that gets stored inside a camera by the manufacturer. IT BETTER BE IN THE CORRECT FORMAT.

Anyway, although the antivirus is not to blame for my troublesome situation, but it would help if they provided some statistics screen/report with the most scanned files so we can solve such problems in an easier way, without using super natural powers.


Tip: If a similar thing happens to your PC and it is so slow that it is almost unusable because a process is taking 100% CPU and you don't want to kill the process (so that you can study what is going on) then try lowering the process priority of the offending process. This will permit you to use your computer again so that you can solve the problem.

Have fun,
Dimitris Staikos

October 16, 2008

Superb Vista Tip

Well, although my overall opinion for Vista is kind of on the positive side, there are far too many things that I consider just BROKEN. One of those areas is the silly USB stick.

Before Vista, I used to plug it in, do my file copying with explorer, then do a safe removal and sure enough all explorer windows that were on that drive would close and the drive jet removed. PLUS the lights went OFF :-)

For some reason, God knows what, but I am sure that it has to be seriously valid at least technically, they decided to ruin the user experience and have us first close ALL explorer windows and then remove the drive.

Cool so far. And I am pretty certain many of you have seen the following dreaded dialog:

Image1_2

I am bloody sure that they could make it a BIT more useful and tell us WHICH programs are using the device, but then I guess this would probably require admin priviledges, so they didn't do it.
Anyway, on the message I particularly enjoy the "try again LATER" part. LATER? How much later? Like in a minute or so? I have actually seen in some other program an error message saying "try again in 1 minute" (I think it was Google Earth) and I found that even scarier, so I guess "later" is not that bad. Of course, they could just say "try again".

Anyway, I surely am not as wise as the Vista designers, so I should better keep my big mouth shut before someone sues me or my wife divorces me :-D

So here is the ULTRA tip, which comes straight from the horse's mouth! An MS developer in the Vista/Windows 7 "Devices Team".

When the dreaded dialog appears, then Vista does us all a big favour and adds entries to the event log, reporting which apps are using the device and preventing it from getting safely removed!!!
Oh yes...

All you have to do is open up event log viewer (Run ==> eventvwr.msc), go to Custom Views | Administrative Events and here's what you get (click on image to view in full size):

Image2

Yeap, it's explorer.exe that is preventing the device removal. In my case I also have a command prompt on that drive, so I had a second message as well for CMD.EXE. You will get one message for every process.

Note that the message even lists the process id, so that if you have many of the kind open you can easily locate which ones is causing the trouble. Just locate the pid in Task Manager and do a "switch to...". All really user friendly now, isn't it?

However, sometimes the event log message will report that the SYSTEM process is preventing device removal. In that case, there's nothing you can do other than:
(a) Try Again LATER and LATER and LATER until it gets removed (it eventually does...) OR
(b) To hell with the error message, just unplug the stick and hope for the best!

Now for those of you who like to do things the hardcore way, there is also a command line way to figure things out. First you must download the HANDLE tool from SYSINTERNALS.

Then open up a command shell and enter: HANDLE -a HardDiskVolume

You will get an output that looks like this (in my case I have two USB sticks attached):

Image4

Here I can see that the stick I am insterested in is actually HardDiskVolume7, so I can refine my search a little more to clean up the messy output.

If you feel kind of adventurous the you can try the -c option of HANDLE.EXE and close some handles in a really friendly way.

Have fun!
Dimitris Staikos

Vista Troubleshooting Tip (Windows Mail + SPA + SSL)

You might find this Vista tip useful from George Adamopoulos' blog.

Have Fun!
Dimitris Staikos

October 10, 2008

Batch file tips and horrors

Dude, it seems that some things are made by sadists...
It can't be explained otherwise...

Before explaining the horrors I will give you a tip that I think you will find useful.
Typing the following line in a BAT file:

    SET /p VAR=Please enter value:

Will give you a sweet prompt so that you can enter the value to be used in the batch file!!!
Wow64!!!
I've been looking for this for years! And it has been there in the friggin' help for SET who knows for how long.

Moreover SET has the /a switch that can evaluate expressions which means that you can use it to create simplistic loops in a batch file, with a statement like this:

    SET /a VAR=%VAR%+1

And as a bonus if you do SET /a 5*4 on the command line you get to use the shell as a quick calculator for integer arithmetic :-)


Now let's go to the horrors...
Take a look at this trivial batch file:
@ECHO OFF
SET /p VAR=Give me VAR value:
echo VAR=%VAR%
if EXIST C:\nul (
    SET VAR=C:\%VAR%
    echo VAR=%VAR%
)
echo VAR=%VAR%

The if condition is made so that it succeeds (for most people).
If you enter 123 at the prompt, what do you expect to get printed?

VAR=123
VAR=C:\123
VAR=C:\123

Right?

Wrong... And here comes the horror!
The batch file outputs the following:

VAR=123
VAR=123
VAR=C:\123

What the heck???
To cut a long story short, the SET statement inside the IF actually takes place, but its results are NOT visible inside the IF!!! Instead the previous value is used throught the statements within the if.
I tried several things to make a SET statement that takes place within an IF to make its results visible to the rest of the statements. Be my guest. It seems however that the interpreter is reading and translating all the statements inside the IF in a single operation, so any updated variables do not get reflected to the code.

For the time being right the code like this:

@ECHO OFF
SET /p VAR=Give me VAR value:
echo VAR=%VAR%
if not EXIST C:\nul goto AFTER_IF
    SET VAR=C:\%VAR%
    echo VAR=%VAR%

:AFTER_IF
echo VAR=%VAR%

Enjoy!
Dimitris Staikos

August 01, 2008

Solving an NMI crash

As I described in one of my previous posts, there is a special kind of fatal error called NMI error, a form of ultra fatal error that Windows users don't encounter as often as the infamous Blue Screen of Death (BSOD).

It is caused by some erroneous hardware behavior which, in order to make things sound 'common sense', let's say crashes the motherboard, while BSODs crash the operating system.

Of course, it is the software (operating system and device drivers) that programs the hardware, so if the hardware is not at fault (true hardware damage) then it is the software that is to blame once again :-).
Even if the chips have bugs (hardware bugs) the device driver developer is required to write code that circumvents the hardware bug so that the device operates correctly.

I have been working with Windows device driver code for a total of about 6 years in my career and of course I have encountered and solved dozens of BSODs in our drivers. But so far I had met only one NMI error caused by our driver. A couple of days ago I encountered my second NMI error and I was truly excited!!!

Why I was excited instead of disappointed and thinking that our code is being crappy? For starters, I KNOW our code is not crappy (famous last words) so I couldn't possibly worry about that.
There are two reasons why I was excited:
(1) One NMI error in 6 years means that you don't get the chance to debug such beasts very often. The more often you get to debug such errors the more experienced you become in the sorts of things that cause NMIs and how to debug them. Such a kind of experience is extremely hard to get and extremely valuable.
(2) Secondly, as I explained in my previous NMI post, the software was running smoothly everywhere but was causing an NMI on some semi-exotic platform. This was exactly the case once again, an exotic Xeon-based super server. If we have clients that decide to run our software even on such exotic machines then (a) we must be having a lot of clients (since only a small percentage use exotic machines overall) and (b) they trust our software enough to use it in extremely demanding applications that require exotic machines.

In both NMIs the actual case was that the client let's say started using our software on Series 3 of the server, then upgraded to Series 4, then Series 5 and when they tried to upgrade to Series 6 (in their labs of course) they found out that an NMI was occuring.
So there is no matter of trust to our code and our company. Our clients KNOW that our software works correctly and they obviously realize that we don't have the latest and greatest version of every exotic server available in our lab to test with, so they tell us about the error, we get it fixed and both parties are totally happy and excited!

So if there is a common sense lesson here for ordinary users it is this one: If you decide to build your own super exotic PC with a uniquely super cool combination of the latest-greatest-fanciest hardware don't act that much surprised if you have driver problems (BSODs or more likey NMIs). If you want to stay out of trouble then shoot for something that is less exotic. Or at least ask for your PC provider to build your PC and then test it a bit before you pay for it and take it home.

OK then, just for the record, let me tell you what was causing the NMI.

Initially I thought that it was a cache-coherency issue that made the 1394 adapter read garbage for the context program of its DMA context. Cache-coherency means that the code updates some memory, but the new memory contents are still inside the CPU cache because that portion of the cache was not flushed to main memory.
However devices read their context programs from main memory, so if the data did not reach there yet the device will read garbage and act accordingly. Too bad that devices can't popup error message boxes to the user :-D
By examining the code carefully for that kind of error I located a little well-hidden window of opportunity where it could occur. So I fixed this bug, but lucky me, it was not the cause of the NMI. The NMI persisted.

Then I fired up my 1394 Bus Analyzer and after several experiments and server crashes one thing was evident. The 1394 adapter would always transmit exactly 51 packets before NMIing. Now, *always* and *exactly 51* are a strong indication that something a little special must be happening on the 52nd packet.
I knew of course that each packet uses 5 DMA descriptors in the DMA context program, each descriptor being 16 bytes, so I did some simple math: 5*16*51=4080. BINGO!!!
Each physical page of memory has 4096 bytes, so the 5 descriptors of the 52nd packet were on a physical page boundary. That's always a good start, although the DMA context program is being written in 'physically contiguous' pages so crossing the boundary shouldn't result in any surprises.

The NMI was caused by what we call 'isochronous transmit'. But there is also 'Isochronous receive' and it also uses 5 descriptors of 16 bytes each, but DID NOT crash on the 52nd packet, on the same machine of course.
How could that possibly be?

I studied the chip specs closely for any mention of anything related to physical page boundaries for the DMA context programs and sure enough... there was nothing. No restrictions whatsoever were mentioned.

Mind you, the code that is preparing the isochronous transmit context program was originally written back in 1999 so it has been literally tested on thousands of computers since then. This was sure a neat thing that was going down here. (Note: 1999 is more than 6 years ago, but I didn't work with drivers all the time ;-))

Then I studied our code again and soon I found out that the isochronous transmit was using 5 descriptors but the first one was a bit special, in fact something like a "double" descriptor. Since 4096-4080=16, then it became evident that this "double" descriptor was getting split in two physical pages (always physically continuous in memory).

Hmmm, I thought, maybe this machine is not too happy with this fact and crashes with the NMI at the moment the 1394 DMA chip is trying to read the 32-bytes of the next descriptor in one operation from two different physical pages.
This sounded plausible enough in my mind, so I started to give it a try.

Of course I was not sure that it was the correct reason, I mean it works everywhere else right?

I would have to change the code first then run it and see if the NMI goes away. But I estimated the correction to be at least a week's worth of coding, because too many things had to change in order to accomodate for the required 'holes' in the context program.
Classic case of a Catch-22. I can't put in 4-5 days of work just to test an idea! What if it was not the correct one?

Then something else came to mind... a quick and dirty solution... If I add 3 nop descriptors (nop="no op"="no operation") to each packet then I will have 8*16 bytes = 128 bytes. And sure enough 4096 is divisible by 128, so I would never have the special descriptor on a page boundary.
Of course this means 48 wasted bytes of physical memory for each packet, which is a very precious resource. The requests we deal with may contain thousands of packets, so that would be a non-trivial waste.

I didn't have to think twice before I decided that this was not an acceptable solution, but it was just fine in order to try out my theory!

And then came that precious moment of glory!!!
It worked like a charm :-)
My theory was right and bye-bye NMI #2.

Then I embarked on a 4-day effort to implement the proper solution that doesn't waste memory and works too.

Isn't it just so cool being a driver developer in your spare time? :-D

Have fun!
Dimitris Staikos

December 03, 2007

How adding more RAM to your PC can hurt Windows performance

This is a story that should really tell us something broader about how computers work and how software that controls computers works:

  • Often in weird ways.
  • Often in totally unexpected ways.
  • Often in sadistic ways.
  • Often in seemingly nonsensical ways.

When trying to explain a complex technical concept I always try to start by making a real world analogy; I think it greatly helps understanding the nature of the concept I am trying to explain, which is the prerequisite to understanding the details.

So imagine you go to a restaurant and you order a bowl of soup. The waiter, along with the soup, brings an impressive selection of spoons, so that you can pick the one that better suits your eating habits and preferences. You are really hungry and in a hurry, so you grab a really huge spoon and finish off the soup in a snap.

The next day you enter another restaurant, and you order their specialty soup. After a while the waiter arrives with your soup and brings along a small luxury spoon, children’s size. You stare at the spoon with bewilderment and ask for a bigger one.

"I am sorry sir, I am afraid these are the only spoons we have. They are selected by our chef so that customers can properly enjoy their soup".

At first you are shocked; then puzzled; then... you name it. Anyway you decide to give it a go. The soup is excellent and the little spoon can be made to work.

Now imagine you go to a third soup restaurant and the chef mandates that clients eat their soup using a spoon so small it can only hold a single drop of liquid.
What excuse can the chef offer you that could possibly justify what you have to go through in order to eat your soup using such a spoon? I don’t think I would fall for anything.

End of analogy.

In the example the restaurants represent the various versions of Windows running on different hardware. The soup represents "data", while you get to be on the device driver seat. The chef is the Windows kernel and the spoon is the size of the "bucket" that you can use to move data from your device.

Let’s get a bit more technical.

The Windows kernel has a concept called "Map Registers". Map registers translate to the size of the maximum DMA transfer that you are allowed to program on your device.
Instead of confusing you with "Map Registers" I will be talking about Maximum DMA Transfer or use the simpler term of "DMA Limit" that we use in Unibrain’s Firewire software documentation.

The DMA Limit is of course decided upon by the Windows kernel.

  • On x86 Windows running on plain-vanilla x86 hardware, the DMA limit is 2GB which means that... there is NO LIMIT. No DMA Limit. Any driver can program a DMA transfer as big as its heart desires, like 100MB for example.
  • On x64 Windows running on x64 hardware the DMA limit is 1MB. This is not a typo. It actually says "One Mega Byte".

Before getting too upset about "Why didn’t Microsoft set a bigger DMA Limit on x64?" I think it is better that you consider a different question: "Why didn’t Microsoft set ANY DMA Limit on x86?"

In my opinion this is the point where Microsoft initially got it wrong. By not putting a DMA limit on x86  Windows Microsoft made the lives of driver developers much, much easier, and thus they achieved having x86 Windows drivers for everything under the sun.
The downside was that many of these drivers were of dubious quality, allowing applications to setup even 100MB DMA transfers (which is a huge waste of system resources).

If Microsoft had put a reasonable DMA limit into x86 Windows, like say 10MB, then driver developers would be really used to the idea of working with a DMA limit and then the transition to x64 would be much smoother.

Instead Microsoft adopted a different approach for x64. By setting the DMA limit to 1MB they are essentially telling driver makers:

If you can’t operate your device using max 1MB DMA transfers then we don’t want your driver running on x64 systems.

Fair enough I say; 1MB is more than enough and keep in mind that it is not a 1MB overall total. It is 1MB per DMA Adapter Object. If your device has multiple execution contexts, then it uses 1 DMA adapter object for each context, and you get a 1MB maximum per execution context.
Trust me when I say that 1MB IS ENOUGH to serve even the demanding 800Mbps of Firewire.

However, the fact remains that this change in the DMA limit from the x86 world to the x64 world was a bit dramatic. And it is the core reason why YOU are having so much trouble finding x64 drivers for the hardware stuff you have on your Windows PC.

I hope I haven’t bored you to death with all the above but this was the simplest introduction I could come up for the REAL ISSUE of this article.

You might have noticed that something is missing in my earlier description about how Windows sets the DMA limit: Unlimited on x86 OS on plain-vanilla x86 hardware, 1MB on x64 OS on x64 hardware.

So what about x86 OS running on non plain-vanilla x86 hardware?
What about x86 OS running on x64 hardware, which is the norm these days?

The common denominator here is that we are talking about hardware that can address more that 32 bits of PCI space. This feature was referred to as PAE (Physical Address Extensions) on those exotic x86 machines that first supported it, and it still appears that way on your x86 Windows running on your x64 PC on the Computer Properties dialog.

On these systems, there is no DMA limit as long as the total amount of PCI-addressable memory space is less than or equal to 4GB.

What’s the difference between "memory" (RAM) and "memory space"?
Well, memory space is a space where memory lives. Master of the obvious, am I not?

The PCI-addressable memory space is where you RAM lives.

Is there anything else inhabiting that space?
The answer is YES: Device memory.

Device registers and the device’s PCI configuration space are "memory mapped" (mostly), which means that they have PCI-level physical addresses that the operating system can use to access them. Your graphics adapter memory goes in there too.

A crucial thing that happens a little after you start up your PC is that the infamous chipset, working together with the BIOS and other mystical powers, reserves 0.5GB up to 1GB of PCI-addressable memory space for device memory. In most systems I have tested it was either 0.75GB or 1GB. I’ll refer to this as DeviceMemory.

Now let me reiterate one of the previous paragraphs and see if it starts ringing any bells:

On these systems, there is no DMA limit as long as the total amount of PCI addressable memory space is less than or equal to 4GB.

Ladies and gents, we have arrived at our destination.

If you bought 4 or more GB of RAM for your PC, running an x86 version of Windows on the aforementioned hardware then RAM+DeviceMemory>4GB, so one of two things will happen:

  • The x86 OS will only "see" 3GB, or 3.25GB or 3.5GB of RAM.
    Actually it will see VisibleRAM=(4GB minus DeviceMemory).
  • More usually however, especially when modern x64 hardware is involved, the x86 OS will take advantage of PAE support on the hardware and then VisibleRAM=(Full RAM).

If the first option is what happened to you, then you are a lucky bustard (typo intended – I don’t use slang in my posts ;-)). The reason that you are lucky is that in your case the x86 Windows kernel continues to operate in the generous NO DMA LIMIT mode. Every driver on the planet is happy in that land.

If the second option is what happens to you, then you are in for a nasty surprise which is the article’s punchline:

On x86 Windows with VisibleRAM+DeviceMemory>4GB the DMA Limit is 64KB.

Once again there is no typo: SIXTY FOUR KILOBYTES
Or 16 map registers if you prefer.

So you installed 4GB of RAM on your x86 Windows PC running on x64 hardware and suddenly:

  • Logοn takes several minutes
  • File copies are slower than usual
  • Network is sooooo slow
  • Everything feels sluggish and defunct

There is a way out and it is pretty simple: edit your BOOT.INI and add /MAXMEM=3072 (or the equivalent with my beloved BCDEDIT on zVista). See if it makes any difference and then try readjusting it up or down until you find the maximum value that does not invoke the 64KB death penalty.

This 64KB DMA limit is the tiny spoon I was talking about in my analogy at the beginning.

Just try serving up a bandwidth hungry 800Mbps Firewire device using a 64KB spoon. A huge and coordinated effort is required in the code and then it will only work up to a point. After that point the Firewire device (usually a high res high fps digital camera) will be shooting data at the PC so fast that with a 64KB spoon you are just out of luck (data flies on the cable and your spoon is not there to receive it).

I don’t know how or why this 64KB value was decided upon. This is an interesting topic for speculation. Some said it was historical issues dating from the EISA bus or something. I personally can’t figure it out. It just can’t be stupidity. There must be some reason behind that. Or may be indeed it comes from the EISA days and they just forgot about it.
I would be very interested if you sent me some comments with your speculations on this.

So, it’s high time we brought this to a closing:

How can you tell if you are infected (other than by witnessing sluggish behavior)?

Well, to the best of my knowledge, you can only get this information from a kernel driver. There is a considerable chance that Windows does not use one single value as the DMA limit for all devices. May be they are using different values depending on the type of bus the device is found on, or even the type of device, so there might be no global value to report.
Based on my discussions on NTDEV and private emails, it seems like it is a per-bus setting, which means that all PCI devices probably get the same value.

Doing a SysInternals-like project to display this value on your system, with a self registering driver hiding in its resources, etc, is interesting, it requires several hours of careful work, but is otherwise trivial for a DDD. Did I forgot to mention the endless support afterwards?

So I am not going to do it. Or should I put it better, I am not going to redo it, since I have already done it somewhere else.

Seeing the DMA Limit from userland is a feature that I have added to Unibrain’s Firewire drivers (ubCorePro 5.21) after the technical investigation of this issue came to a close. If your motherboard has a 1394 port or you happen to have a Firewire adapter you can use our software to see the DMA Limit.

This is a f.r-e^e download from www.unibrain.com, mostly harmless to install :-)
Just make sure you download the Pro version.

Install ubCorePro, reboot, login and wait until Windows starts up all the drivers, then run FireCommander and type the DMALIMIT command to see the DMA limit that your system granted to our drivers.

Some words of caution for those who will not bother reading the manuals:

  • You don’t have to uninstall ubCore in order to get back to using the Microsoft 1394 drivers. We have a tool called UBSWITCH that does exactly that, in both directions.
  • There is no significant performance difference between the Microsoft SBP2 driver and our own. Don’t bother trying to see if you will gain anything on that aspect. Remember we are focused on industrial applications not end users. Industrial applications don’t use SBP2 so there is no incentive for us to try to make the driver faster than the MS driver (supposing SBP2 devices can go any faster).

Finally, if you care for the technical discussions of this issue as they took place on OSR Online, you can go to the NTDEV forum, select advanced search and search for "Maximum 16 map registers" without the quotes. You should see my name on the post that started the thread.

I have also posted a technical explanation for FireAPI developers on our informal newsgroup.

Have Fun!
Dimitris Staikos