PCI Latency patch
for VIA Chipsets
Questions and Answers

Copyright (C) 2001, George E. Breese. All Rights Reserved.

Version 0.10 4/13/01

Important notes:

This product CAN, IN SOME CASES, DAMAGE A COMPUTER. Use it carefully and at your own risk.

If you have installed a previous version of this driver, uninstall it before installing this version.

All credit for research on this patch is given to the site au-ja! Their page review-kt133a-1.html describes the problem and solution in German.

I wish to thank the staff of www.viahardware.com for promoting my work. They have been supportive of my drivers since I first began creating them.

License: This software is licensed, not sold. The author of this product has granted you a license to use this product, subject to the following conditions. By possessing, using, or attempting to use this product, you assume all liability for its use. You agree never to take legal action, civil or criminal, against its author for any reason. You may redistribute this product in its original form only. You may not charge money for distribution of the product, unless all such charges are remitted to the author immediately upon payment. The author retains ownership of all intellectual properties embodied in this product.

This driver has one known bug. If run on Windows 2000, it will not re-apply the patch when the computer returns from "hibernation".

What is it?

This is a driver for Windows 9X, NT, and 200X. It is intended to stabilize the PCI bus of computers that have Via chipsets.

When installed on a computer whose motherboard contains certain VIA chipsets, this driver will reprogram the VIA chipset in order to maximize the speed of the computer's RAM.

How does it work?

This driver takes control of the main VIA-branded chip on the computers' motherboard, which is the chip responsible for connecting the CPU to the RAM and ROM and PCI and AGP and so forth. This driver adjusts the way that the VIA chip communicates with the computer's PCI bus.

Do I need it?

If your computer has one of the following VIA chips on its motherboard, and your computer freezes when copying large files or when playing sounds, you might need this driver.

To confirm that your computer has the correct chipset, try any of the following.

Why do I need it?

ViaTech (www.viatech.com, or www.via.com.tw) offers a large amount of control over the computer's PCI bus. Motherboard makers have tried to adjust the settings in ViaTech chipsets in order to maximize the speed of the PCI bus. Some of these settings have been discovered by au-ja! to be causing the computer to freeze when the PCI bus is being used heavily. Users have also reported that, if a Creative SoundBlaster Live sound card is installed, the problem will happen more often.

How do I install it?

You should have received this in a .ZIP compressed file. Extract the entire .ZIP file to a suitable location.

If your computer is running Windows 95, 98, 98 Second Edition, or ME, then run SETUP_9X.BAT .

If your computer is running Windows NT 4.0 or 2000, then run SETUP_NT.BAT.

After running the appropriate .BAT file, restart the computer.

How do I know that it is working?

Copy large files to and from multiple hard disks while playing sound files. The files should be at least 100MB in size. If the computer freezes during such activity when this driver is absent, but works when the driver is present, then the driver is working.

What could go wrong with this driver?

Just about anything can go wrong. Your computer may display a "blue screen of death". The computer may become unstable. This driver may not help your computer at all.

How do I uninstall it?

The driver can be uninstalled from the Add / Remove Programs section of Control Panel. The driver will be removed immediately, but the PCI bus settings will continue to be in effect until the system is restarted.

If the computer is unstable, the driver can still be removed. Boot the computer in Safe Mode and then use the Add / Remove Programs section of Control Panel to uninstall the driver.

How much memory does this driver use?

This driver uses almost no memory at all. Its only job is to reprogram the chipset one time at startup.

Windows drivers are special programs. They have a special section that only occupies memory while the driver is starting. Nearly all of this driver's program code is located in this special section.

How did you make this driver?

I used notes from the Internet. I stumbled onto a thread of conversation at www.viahardware.com on the subject and became curious. A user finally reported that the au-ja site had a potential solution to the problem. Their site said the only solution was to use WPCREDIT and WPCRSET. I knew that some people, myself included, have problems with those utility programs, so I offered to implement the solution in a friendlier form.

I used portions of a driver I'd already written, one that speeds up Via-based motherboards by enabling memory interleave.

This driver was made using a mix of assembly-language and C++ code. To compile it, I use Microsoft Visual C++ 6.0 and Microsoft's free Windows 2000/ME DDK. My Windows 9X VxD is based upon Microsoft's generic sample VxD, and my NT kernel driver is actually an AppWizard-generated DLL file with some carefully-chosen compiler and linker options.

Will you give us the source code?

I do not wish to share the source code at this time. It is not formatted cleanly, and I may elect to use it in a commercial product later.

But, for technically-inclined people, here is the key portion of the source code. This is the only portion that I consider to be key to this problem.

//
// Modify the necessary PCI flags.
//
// In register 0x70, mask off bit 2 (PCI Master read caching)
// and 1 (Delay Transaction)
u70 = read_pci(0, 0, 0, 0x70, 1);
u70 &= 0xF9;
write_pci(0, 0, 0, 0x70, u70, 1);
//
// Turn off PCI Latency timeout (set to 0 clocks). I hate to force
// an entire byte of data into an already-set register, but the value
// 0x80 just looks so good! The only bit set is described by Via as
// "(enable) Fair arbitration between PCI and CPU". What could be
// fairer?
//
write_pci(0, 0, 0, 0x75, 0x80, 1);

How do I contact you?

If you wish to offer feedback on this driver, send email to feedback@networking.tzo.com . Please note that I do not check this mailbox frequently, and I do not answer questions about installation or use of this driver.