Introduction ============ Microsoft has added many performance enhancements to Windows since its initial release. One of these enhancements has been the 32-bit Disk Access feature. Many people use this feature without actually knowing what it does and without actually knowing if it really helps! Microsoft has since extended this feature and has now implemented 32-bit File Access as well. There have been several questions on exactly what 32-bit disk access is, inside of Microsoft Windows 3.1 and also 32-bit file access now available in Microsoft Windows for Workgroups 3.11. This document will explain the definition of each feature in detail along with performance results when using 32-Bit File Access. 32-Bit Disk Access ================== The 32-Bit Disk Access feature of Windows, also know as FastDisk, was first introduced with Windows 3.1. It brought new technology to users of the Windows operating system and delivered improved performance over Windows 3.0 when running DOS based applications under Windows. 32-Bit Disk Access is a set of protected-mode device drivers that work together to direct INT13 calls to the hard disk controller and direct them in the most efficient way for the system - either through the 32-bit interface with the hard disk controller or through the system BIOS. Since 32-Bit Disk Access works directly with the hard disk controller, it can only support a disk controller that supplies an appropriate virtual device driver to support that controller. Windows 3.1 ships with one such device WDCTRL which supports only disk controllers that are compatible with the Western Digital 1003 controller interface standard. Most IDE drives fall under this standard however SCSI drives do not. Some SCSI controller manufactures have decided to develop their own 32-Bit Disk Access drivers but Adaptec has decided not to for reasons explained later. 32-Bit Disk Access is only available under 386 Enhanced mode. In Enhanced mode, Windows and Windows applications run in protected mode whereas DOS programs run in real or virtual mode. The system must switch to virtual mode whenever a DOS program is executed from within Windows. This mode switching is time consuming. The following is the process that takes place while running a DOS application from within Windows. When a DOS application makes a call to read from a file, Windows traps this interrupt (INT21) and switches to protected mode, where several virtual devices check the call for actions they need to perform. Once the call is checked, Windows returns the call back to DOS, switching back to virtual mode. DOS finds the requested location on the disk and generates an INT13 call to the disk controller BIOS. Again, Windows traps this interrupt, switches to protected mode, checks the call, and returns the INT13 call to the controller BIOS which is in virtual mode. The BIOS then performs the function on the disk and returns from the call. At this point Windows switches back to protected mode to perform more processing, then returns back to virtual mode to let DOS see the return from the original INT21 call. Here are the steps that take place during a DOS application call to the disk. 1. Application - INT21 call to read from the disk 2. Windows - Traps the call, switch to protected mode 3. Windows - Returns to DOS, switch to virtual mode 4. DOS - INT13 call to disk controller 5. Windows - Traps the call, switch to protected mode 6. Windows - Returns to BIOS, switch to virtual mode 7. BIOS - Performs INT13 function call 8. Windows - Traps the return, switch to protected mode 9. Windows - Returns to DOS the result, switch to virtual mode 10. DOS - Receives the result, supplies the result to application 11. Windows - Traps the return from DOS, switch to protected mode 12. Windows - Returns result to application, switch to virtual mode 13. Application - Application receives the result from the original INT21 call Many things happen during a simple call to read from a disk! As you can see, Windows switches from virtual mode to protected mode and back again many times which can be very time consuming. This is where 32-Bit Disk Access is applied. The 32-Bit Disk Access driver replaces the Disk controller BIOS. The 32-Bit Disk driver can perform all of its functions from within protected mode. From the steps shown above, you can see that with the 32-Bit Disk driver, you can eliminate steps 6 and 8, a savings of at least two mode switches per disk request. Another function of the 32-Bit Disk Access driver is to supply multiple non-Windows applications with virtual memory. Without 32-Bit Disk Access, Windows needs to provide non-Windows DOS applications physical memory only. Virtual memory is also known as the Windows swap file and is used when there is not enough actual memory for the application. So, the times you benefit most from the use of the 32-Bit Disk Access driver are when you are running Non-Windows DOS applications and you don't have much physical memory and must use the swap file. Benchmark programs under Windows that don't execute DOS programs or don't use the swap file, will not show any performance improvement when using 32-Bit Disk Access. 32-Bit File Access ================== Windows for Workgroups 3.11 extends the 32-Bit Disk Access to provide 32-Bit File Access as well. 32-Bit File Access provides a 32-bit code path for Windows to access and manipulate information on disk by intercepting the DOS INT21 services in protected mode, rather than handling the INT21 services in virtual mode by DOS. INT21 services manipulate the DOS File Allocation Table (FAT), which governs the way information is written to and read from a FAT-based disk volume. In addition to protected mode INT21 services, 32-Bit File Access also provides a 32-bit protected mode replacement for DOS based disk cache programs such as SmartDrv. The 32-Bit File Access functionality provided in Windows 3.11 is implemented as two Windows virtual device drivers, VFAT.386 and VCACHE.386. The requirements for 32-Bit File Access are different from that of 32-Bit Disk Access. 32-Bit Disk Access intercepts INT13 calls destined for the disk controller BIOS that communicates with the hard disk. 32-Bit File Access intercepts DOS INT21 calls which manipulate information stored on a disk device. The VFAT virtual device provides support for the protected mode INT21 services. In order for VFAT to load on a given disk volume, one of the following conditions must be true. 1. A 32-Bit Disk driver is used, or 2. The real mode mapper is installed (supplied with Windows 3.11) to provide a 32-bit Disk Access interface to the DOS device driver chain. In order for VFAT to mount on disk volumes, VFAT must see a 32-Bit Disk Access interface for a given disk volume. A special virtual device driver called the real-mode mapper (RMM.D32) provides a mapping service to take protected mode file I/O calls from VFAT and sends them through the DOS device driver chain (in our case ASPI). The real-mode mapper is installed by the Virtual Memory dialog box in Windows automatically when 32-Bit File Access is enabled. This will be the method used when an Adaptec Host Adapter is installed. With VFAT there are only two mode transitions to process an INT21 request from a DOS-Based application and only one mode transition when processing an INT21 request from a Windows-Based application. A companion driver to VFAT is VCACHE. VCACHE provides a 32-bit protected-mode replacement for the DOS based SmartDrv disk cache program. Where VFAT is responsible for reading and writing information to the disk, VCACHE is responsible for managing the information VFAT writes to or is present in the cache. The caching routines provided as parts of 32-Bit File Access differ from that offered by SmartDrv in the following ways: 32-Bit File Access caching routines are implemented as 32-bit protected mode code, thus reducing the need to transition to real mode to cache disk information 32-Bit File Access read-ahead routines work on a per-file basis rather than on a per-sector basis, thus helping to ensure that information read into the disk cache will be used with a higher probability. 32-Bit File Access caching routines share cache memory with the protected-mode network redirector (VREDIR.386), thus reducing the extra memory overhead for maintaining multiple cache buffers. 32-Bit File Access caching routines cache information on a per-file basis providing improved performance over SmartDrv, which caches on a contiguous sector basis. Performance Results =================== The tests were run on a 486-66 MHz system with 16MB RAM. The SCSI subsystem consisted of a 1540C and a Maxtor 540S hard drive. The benchmark used was WinBench 4.0 and the tests run were the Disk WinMark and Disk Tests. Comparisons were between running Windows for Workgroups 3.11 with 32-Bit File Access turned off and with it turned on. Performance Summary =================== It is interesting to note that while 32-Bit File Access gives you substantial improvement during Random Read/Writes and Sequential Writes, it gives you less performance during Sequential Reads! When using a disk cache such as SmartDrv or VCACHE the majority of your disk access will be Sequential Reads. However, WinBench weighs the results differently and gives a WinMark disk mix score of 354KB/Sec with 32-File Disabled and 1080KB with 32-Bit File Enabled. The individual scores as well as the overall score should both be noted when comparing performance results. Conclusion ========== Windows disables both 32-bit Disk Access and 32-bit File Access by default. Some computers such as laptops, notebooks, and systems that use INT13 to detect disk access for power conservation, will not properly identify when the 32-bit Disk Access driver is accessing the hard disk. If the hard disk powers down in the middle of a write or read action, data loss may result. As with 32-Bit Disk Access, the 32-Bit File Access feature is disabled by default when Windows for Workgroups 3.11 is installed. Both 32-Bit Disk and 32-Bit File Access can be enabled through the 386 Enhanced dialog box. The benefits you might gain from having 32-Bit Access enabled will depend entirely on your individual configuration and environment. Performance will vary from machine to machine. If you encounter problems, or a decrease in performance, simply turn off 32-bit Access through the 386 Enhanced dialog box. If you don't enable 32-bit File Access, be sure to continue using SmartDrive to provide disk caching functionality.