Patentamt Europaisches ||| || 1 1| || || || ||| ||| || || || ||| || (19) J European Patent Office

Office europeen des brevets (11) EP 0 805 399 A1

(12) EUROPEAN PATENT APPLICATION

(43) Date of publication:ation : (51 ) Int. CI 6 : G06 F 1 3/1 0 05.11.1997 Bulletin 1997/45

(21) Application number: 97201082.1

(22) Date of filing: 11.04.1997

(84) Designated Contracting States: (72) Inventor: Berliner, Brian DE FR GB NL SE Colorado Springs, Colorado 8091 9 (US)

(30) Priority: 01.05.1996 US 640670 (74) Representative: Hanna, Peter William Derek et al Tomkins & Co., (71 ) Applicant: SUN MICROSYSTEMS INC. 5 Dartmouth Road Mountain View, California 94043-1 1 00 (US) Dublin 6 (IE)

(54) Method for creating a single binary virtual for a windowing

(57) A method for creating a virtual device driver dows 3.x will load the driver. The second that runs under both Windows 3.x and Windows 95 obstacle, that of partial functional incompatibility, is operating systems is disclosed. There are two cured by appending additional logic and supplementary obstacles to be overcome in creating a virtual device Windows 3.x emulation routines to the Windows 95 driver VxD that will operate under both Windows 95 and driver. The logic works in the following manner: When- Windows 3.x. The first obstacle, that of identificational ever a Windows 3.x operating system call is made to the incompatibility, is cured by disguising a Windows 95 driver, the standard Windows 95 driver interface is compatible driver as a Windows 3.x compatible driver. granted control (307) whenever that interface is compat- This is done by renaming (202) the Windows 95 driver ible with Windows 3.x. However, whenever direct control with a file name having the three-character extension by the standard Windows 95 driver interface is incom- "386". The version number within a Device Descriptor patible with Windows 3.x, the Windows 3.x driver inter- Block must also be changed (203) in order to effect a face is emulated (306) by the supplementary routines. total disguise. Once the identificational incompatibility has been cured through the aforementioned steps, Win-

Gel the version of the Virtual Machine Manager 2

Set a "win3x" variable to be non-zero if VMM major version- "3" 3 <7> <7> CO LO O Fig. 3 CO o Q_ LU Printed by Rank Xerox (UK) Business Services 2.14.18/3.4 1 EP 0 805 399 A1 2

Description use, multi-user data processing systems. Distributed data processing (i.e., multiple LANs FIELD OF THE INVENTION: interconnected via a long-distance data link) using either MP/M or TurboDOS was also difficult, as it would This invention relates to non-volatile caching sys- 5 have required loading a communication program into terns for data processing systems, and methods for memory, in addition to the operating system, before implementing such systems. application software could be loaded. However, with the introduction of IBM-compatible computers based on the DESCRIPTION OF RELATED ART: 80286 , which was designed to 11 address several megabytes of random-access memory, Caching has long been employed to increase per- the development of practical LANs and distributed data formance of a relatively slow computer memory processing systems became feasible. Although Novel resource when a faster memory resource, which typi- Corporation initially captured a majority share of the cally has a higher cost per stored bit, is available. Typi- LAN market, the number of networks utilizing LAN soft- cally, a temporary memory block within the faster 15n ware from Corp. has been growing. memory resource (i.e., a cache) is established for stor- Present-day LANs generally use a twisted wire pair ing only a portion of the information stored within the or a coaxial cable to interconnect individual user com- slower memory resource. Rather than store within the puter systems to a server system. The interconnection faster memory resource an entire application program of LANs is accomplished via telephone lines, special or an entire data file that may be resident on the slower 202t dedicated data lines, fiber optic lines, microwave, or sat- memory resource, certain algorithms are employed to ellite links. For acoustic links, each end of the link gen- determine which portions of the program or data file are erally requires a modem. The other links typically utilize most likely to be accessed. When the system's central a "bridge" and a "router" at each end. processing unit (CPU) calls a memory location that is Distributed data processing networks and the LANs not stored in the cache, the cache (if completely filled) 2521 within those distributed networks can often benefit from must be at least partially overwritten with the required caching. Typically, links between LANs of a distributed data from the slower memory resource. Likewise, when processing network are slower than the interconnec- permanent changes are made to data, data in both the tions between the nodes (i.e., individual computers) of a cache and the slower memory resource must be LAN. Furthermore, though a distant memory resource updated to reflect that change. 303< (e.g. a disk drive on a distant server system) may be as As this is written, there are roughly 150 million com- fast or even faster than local memory resources, long puters throughout the world capable of performing gen- distance interconnections over a data link can dramati- eral business-related tasks. When the rapid proliferation cally slow access time to that distant resource. Regard- of personal computers began in the early 1 980s, nearly less of the type of link between the LANs of a distributed all of them were employed as stand-alone units. How- 353; processing network, or between the nodes (i.e., individ- ever, multi-user systems were soon developed. These ual systems) of a LAN, each data link has a given band- early multi-user systems ran software written for the width which will permit only a finite amount of data to be CP/M disk operating system, which had been written by simultaneously transferred over the link. Once the band- Gary Kildall and was marketed by his company, Digital width is exceeded, as for example when more than a Research, Inc. The multi-user disk operating system 404t certain number of users are attempting to communicate MP/M supplied by , Inc. connected sev- over the same link (whether between LANs or within a eral "dumb" terminals to a single microprocessor and a LAN), response time over that link typically degrades as shared disk drive, while TurboDOS--a much more each user's request is delayed in order to evenly accom- sophisticated product supplied by an unrelated com- modate all competing requests. Consequently, caching pany-utilized a master/slave arrangement much like the 45« of data read over a network can generally increase sys- Local Area Networks (LANs) in use today. tem performance both by reducing data link loading and Both the MP/M and the TurboDOS disk operating by providing the end user with a cache of rapidly acces- systems ran on computer systems based on either the sible data. Intel 8080 microprocessor or the Zilog Z-80 microproc- Within the last several years, compact disc read- essor. Neither of these early could 50st only-memory devices (CD-ROMs) have become directly address more than 65,536 bytes of random- extremely popular due to the availability of low-cost, access memory. As a consequence of MP/M and Turbo- high-capacity compact disk storage media and rela- DOS requiring a minimum of about 50,000 bytes of ran- tively low cost CD-ROM readers (drives). In fact, nearly dom access memory, only about 15,000 bytes of all new personal computers being sold in the U.S. addressable memory remained for application pro- st include an installed CD-ROM drive. Although current grams. As few application programs, other than simple CD-ROM media are capable of storing approximately word processors, required 15,000 bytes or less, the 450-500 megabytes of data, access to that data is con- early multi-user systems were, for the most part, more siderably slower than data stored on a modern hard disk intellectual curiosities than they were practical, general- drive. For example, the current standard for a high-per-

2 3 EP 0 805 399 A1 4 formance CD- ROM drive, known as a "6X" drive is A virtual device driver is typically written to achieve capable of reading, at most, about 600 kilobytes of data optimum performance with only a particular version of per second. A modern high-speed IDE , Windows (e.g., either 3.x or 95). Each VxD incorporates on the other hand, is capable of reading about six meg- a Device Descriptor Block (DDB) which includes a ver- abytes per second-roughly ten times the speed of a 6X 5 sion number, in addition to other descriptive information. CD-ROM drive. Thus, CD-ROM drive performance may The DDB of each device driver is read by a Windows also be greatly enhanced through caching. operating system at boot-time initialization. Although, Many graphical (GUI) environments, because of the need for backward compatibility, the such as Microsoft® Windows™ ver. 3.X, Microsoft Win- Windows 95 operating system will load a Windows 3.x dows 95, Windows NT®, IBM Corporation's OS/2®, 10 driver, the reverse is not true. and Geoworks® have been developed over the years. Rather than create separate caching products for Of the aforementioned products, only Windows NT and Windows 3.X and Windows 95, the PC-CacheFS cach- OS/2 are true operating systems, as Geoworks and ing VxD has been designed so that it will run under both Windows 3.x must be loaded and run under the venera- operating systems. This has decreased product devel- ble Microsoft MS-DOS operating system. Windows 95 is is opment time and costs and will surely result in a reduc- somewhat of a hybrid, as it also requires portions of MS- tion of the product support burden. One of the obstacles DOS for its operation. For the sake of simplicity, though, which had to be overcome before a cross-platform both Windows 3.X and Windows 95 are referred to here- caching VxD could be developed was the absence of a inafter as operating systems. IFSMGR virtual device driver within Windows 3.x. Sun's As this is written, ver. 3.X is far 20 PC-CacheFS development team surmounted this and away the most used operating system, having been obstacle by writing a Windows 3.x IFSMGR VxD from bundled with nearly every personal computer sold scratch using the Windows 95 IFSMGR specification between 1989 and mid-1995. However, from the date of provided by Microsoft Corporation as a guide. When the its release in 1995, the Microsoft Windows 95 operating PC-CacheFS VxD is run under Windows 3.x, calls to the system from Microsoft Corporation has been bundled 25 Windows 95 IFSMGR VxD are replaced by calls to the with most new, high-performance personal computers. Windows 3.x IFSMGR VxD. By using this arrangement, In less than a year, it has become the operating system neither the PC-CacheFS caching product nor the Win- of choice for most business applications, and is dows operating systems, themselves, need be rewritten expected to rapidly supplant Windows 3.X as the most to achieve compatibility. used operating system for personal computers. The 30 This invention includes a method for creating a vir- potential exists for significantly increasing the perform- tual device driver that runs under both Windows 3.x and ance of both CD-ROM drives and distributed processing Windows 95 operating systems. Although the invention networks operating under Windows 3.x and Windows was developed in connection with the provision of a 95 operating systems through caching. caching VxD, the is applicable to any virtual 35 device driver. The following steps are taken to build the SUMMARY OF THE INVENTION driver, before it is loaded and executed on a data processing system under the Windows operating sys- Microsoft Windows 3.x and Windows 95 operating tem: system platforms include compiled, 32-bit program components, each of which runs at Ring-0 and which is 40 (a) building the driver according to the Windows 95 called a Virtual Device Driver or VxD, for short. Win- interface specification to produce a driver. vxd file (a dows 95 incorporates a VxD known as the Installable driver file having the three-character file extension Manager (IFSMGR). All file system required for Windows 95 driver files); input/output requests received by Windows 95 are (b) copying the driver. vxd file to driver.386 (a driver "hooked" to the IFSMGR VxD. 45 file having the three-character file extension Shortly after the release of Windows 95, Sun Micro- required for Windows 3.x driver files); and systems, Inc. (hereinafter also "Sun") set about to cre- (c) patching the driver.386 file's Device Descriptor ate a network and CD-ROM caching product that runs Block to render it compatible with the Windows 3.x under both Windows 3.X and Windows 95, is com- operating system. pletely transparent to end-users, and works with a wide so variety of file systems running under both Windows 3.X Brief Description of Drawings and Windows 95. In order to fulfill these requirements in its recently released caching product, Sun utilizes the Fig. 1 illustrates a computing system for performing services provided by the IFSMGR VxD and effectively the computer implemented steps of the method in "layers" its product between the IFSMGR VxD and the ss accordance with the invention; generic file system of Windows 95. Sun's new caching Fig. 2 is a flow chart depicting the steps required to product, which also fits the definition of a virtual device build the cross-platform-compatible virtual device driver, is named "Solstice PC-CacheFS" (hereinafter driver; and "PC-CacheFS"). Figure 3 is a flow chart depicting the logical opera-

3 5 EP 0 805 399 A1 6

tion of the cross-platform-compatible virtual device Windows 3.x, neither the PC-CacheFS caching product driver. nor the Windows operating systems, themselves, required rewriting to achieve compatibility. Detailed Description of Preferred Embodiments There are two basic obstacles to be overcome in 5 creating a virtual device driver VxD that will operate The embodiments of the invention described herein under both Windows 95 and Windows 3.x. The first may be implemented as logical operations in a distrib- obstacle is that of identificational incompatibility. The uted processing system having client and server com- second obstacle is that of partial functional incompatibil- puting systems. The logical operations of the present ity. invention are implemented (1) as a sequence of compu- 10 The identificational incompatibility occurs for two ter implemented steps running on the computing sys- reasons. First, a Windows 95 VxD has a file name such tem and (2) as interconnected machine modules within as "drvrname.vxd". That is to say, a name of up to eight the computing system. The implementation is a matter characters followed by a period and the three-character of choice that is dependent on the performance require- file extension "vxd". A Windows 3.x VxD, on the other ments of the computing system implementing the inven- is hand, has the same format, but with the three-character tion. Accordingly, the logical operations making up the extension "386". The second identificational incompati- embodiments of the invention described herein are bility occurs because each VxD~whether for Windows referred to variously as operations, steps or modules. 3.x or for Windows 95--incorporates a Device Descrip- The operating environment in which the present tor Block (DDB) which includes a version number, in invention is used encompasses the general distributed 20 addition to other descriptive information. The DDB of computing system, wherein general purpose comput- each device driver is read by the Windows operating ers, workstations, or personal computers (hereinafter system at boot-time initialization. Although, because of local nodes) are connected via communication links of the need for backward compatibility, the Windows 95 various types, in a client-server arrangement, wherein operating system has been designed so that it can load programs and data, many in the form of objects, are 25 and successfully execute a Windows 3.x driver, the made available by various members of the system. reverse is not true. Some of the elements of a general purpose workstation The Windows 95 operating system may be viewed computer are shown in Figure 1 , wherein a processor 1 as a super set of Windows 3.x. This, of course, is shown, the processor having an input/output (I/O) accounts for the partial functional incompatibility of Win- section, a central processing unit (CPU) 3 and a mem- 30 dows 95 virtual device drivers with Windows 3.x. In ory section 4. The I/O section 2 is connected to a key- order to create a virtual device driver (VxD) that runs board 5, a display unit 6, a disk storage unit 9 and a CD- under both Windows version 3.x or Windows 95, Sun's ROM drive unit 7. The CD-ROM unit 7 can read a CD- development team began by writing a VxD that fully ROM medium 8 which typically contains programs 10 complies with Windows 95 specifications. The obstacle and data. The computer program products containing 35 of identificational incompatibility is cured by disguising mechanisms to effectuate the apparatus and methods the Windows 95 compatible VxD as a Windows 3.x of the present invention may reside in the memory sec- compatible driver. This is done by renaming the Win- tion 4, or on a disk storage unit 9, or on the CD-ROM 8 dows 95 VxD with the three-character extension "386". of such a system. Examples of such systems include The version number within the Device Descriptor Block SPARC systems offered by Sun Microsystems, Inc., 40 must also be changed in order to effect a total disguise. personal computers offered by IBM Corporation and by A number of third-party software tools are available for other manufacturers of IBM-compatible personal com- this purpose. For example, Vireo Software, Inc. pro- puters, and systems running the operating sys- duces a "VtoolsD" product which is marketed as a soft- tem. ware tool for building virtual device drivers. This product Rather than create separate caching products for 45 incudes a "sethdr.exe" program which can be used to Windows 3.X and Windows 95, the PC-CacheFS cach- modify information in the Device Descriptor Block of a ing VxD has been designed so that it will run under both VxD. Figure 2 depicts the sequence utilized for disguis- operating systems. This has decreased product devel- ing a Windows 95 compatible VxD as a Windows 3.x opment time and costs and surely will likely result in a compatible VxD. reduction of the product support burden. One of the so Once the identificational incompatibility has been obstacles which had to be overcome before a cross- cured through the aforementioned steps, Windows 3.x platform caching VxD could be developed was the will load the Windows 95 VxD. Loading of the driver, of absence of a IFSMGR virtual device driver within Win- course, does not insure code compatibility of the Win- dows 3.x. This obstacle was surmounted by modifying dows 95 VxD with Windows 3.x. Functional compatibil- the Windows 95 IFSMGR VxD so that it will run under 55 ity is achieved by additional logic and supplementary Windows 3.X. The Windows 95 IFSMGR specification Windows 3.x emulation routines to the Windows 95 provided by Microsoft Corporation was utilized as a compatible VxD. The logic works in the following man- guide during the modification effort. Thus, by using a ner: Whenever a Windows 3.x operating system call is modified version of the Windows 95 IFSMGR VxD for made to the VxD, the standard Windows 95 VxD inter-

4 7 EP 0 805 399 A1 8 face is granted control whenever the interface is com- compatible with both first and second operating patible with Windows 3.x. However, whenever the systems, said first and second operating systems standard Windows 95 VxD interface is incompatible with respectively recognising first and second sets of or simply non-existent in Windows 3.x, the Windows 3.x calls, only a portion of the calls of said second set VxD interface is emulated by the supplementary rou- 5 being fully compatible with said first operating sys- tines. tem, comprising the steps of: Figure 3 provides an operational logic flow diagram for the cross-platform compatible virtual device driver. providing a primary virtual device driver having When the driver is loaded and executed, the operational primary routines which make operating system stepwise flow is as follows: 10 calls that are fully compatible with said second operating system; (1) Is this boot-time initialization? appending supplementary logic and emulation routines to said primary virtual device driver to Yes: Goto Step 2. create a compatible virtual device driver, said No: Goto step 4. 15 supplementary logic being operable following execution of said primary virtual device driver (2) Get the version of the Virtual Machine Manager under either said first or second operating sys- (VMM) to determine which version of Windows is tems, and said supplementary logic providing running. for determining (304) under which of said two (3) Set a "win3x" variable to be non-zero if the VMM 20 operating systems said virtual device driver is major version is equal to "3". being executed, providing for said primary rou- (4) Is the win3x variable non-zero? tines to function (307) when said compatible virtual device driver is executed under said sec- Yes: Goto step 5. ond operating system and whenever said com- No: Goto step 7. 25 patible virtual device driver is executed under said first operating system and an operating (5) Does this call differ between Windows 3.x and system call corresponding to said portion of Windows 95? said calls of said second set is made, and pro- viding (305) for said emulation routines (306) to No: Goto Step 7. 30 function whenever said compatible virtual Yes: Goto Step 6. device driver is executed under said first oper- ating system and an operating system call not (6) Emulate the Windows 95 call in a manner com- corresponding to said portion of said calls of patible with Windows 3.x. said second set is made. (7) Call the Windows 95 interface, which for this call 35 will be compatible with the Windows 3.x interface. 2. The method of claim 1 in which said virtual device driver that is compatible with both first and second It should be obvious that cross-platform compatibil- operating systems is compatible with said first and ity of virtual device drivers can apply only to the internal second operating systems at a source code level. coding of the driver, and cannot extend to the identifica- 40 tional aspects of a driver. In other words, the cross-plat- 3. A method, encoded in the form of binary program form-compatible virtual device drivers created in instructions executable on a data processing sys- accordance with the present invention must be renamed tem, for implementing a virtual device driver that is for use under the various versions of Windows. compatible at a source code level with both first and Although the invention has been disclosed in the 45 second operating systems, said first and second context of a method for building and running a cross- operating systems recognising first and second platform-compatible virtual device driver for use in a Sets, respectively, of calls, only a portion of the calls caching product, the invention is certainly not limited to of said second set being fully compatible with said virtual device drivers used in a caching product. Fur- first operating system, said method comprising the thermore, while the invention has been particularly so steps of: shown and described with reference to a preferred embodiment thereof, it will be understood by those (a) providing for determining (301) whether or skilled in the art that various other changes in the form not an instance requiring driver activity is an and details may be made therein without departing from instance of boot-time initialisation, going to the spirit and scope of the invention. 55 step (b) if an instance of boot-time initialisation, going to step (d) if not an instance of boot-time Claims initialisation; (b) providing for determining (302) under which 1 . A method for creating a virtual device driver that is operating system the driver is running;

5 9 EP 0 805 399 A1 10

(c) providing for setting (303) a system identi- a virtual device driver that is compatible at a source fier to a set value if said first operating system code level with both first and second operating sys- is running; tems, said first and second operating systems rec- (d) providing for determining (304) whether or ognising first and second sets, respectively, of calls, not said system identifier equals said set value, s only a portion of the calls of said second set being going to step (e) if said system identifier equals fully compatible with said first operating system, said set value, going to step (g) if said system said process comprising the steps of: identifier does not equal said set value; (e) providing for determining (305) whether a (a) determining (301) whether or not an particular call differs between said first and 10 instance requiring driver activity is an instance second operating systems, going to step (f) of boot-time initialisation, going to step (b) if an whenever a call does not differ, going to step instance of boot-time initialisation, going to (g) whenever a call does differ; step (d) if not an instance of boot-time initialisa- (f) initiating (307) a call that is compatible with tion; both first and second operating systems; 15 (b) determining (302) under which operating (g) emulating (306) a differing call in a manner system the driver is running; that is compatible with said first operating sys- (c) setting (303) a system identifier to a set tem. value if said first operating system is running; (d) determining (304) whether or not said sys- 4. A computer program storage medium providing 20 tem identifier equals said set value, going to instructions for implementing a virtual device driver step (e) if said system identifier equals said set that is compatible at a source code level with both value, going to step (g) if said system identifier first and second operating systems, said first and does not equal said set value; second operating systems recognising first and (e) determining (305) whether a particular call second sets, respectively, of calls, only a portion of 25 differs between said first and second operating the calls of said second set being fully compatible systems, going to step (f) whenever a call does with said first operating system, said instructions not differ, going to step (g) whenever a call being readable and executable by a computer sys- does differ; tem, said process comprising the steps of: (f) initiating (307) a call that is compatible with 30 both first and second operating systems; (a) providing for determining (301) whether or (g) emulating (306) a differing call in a manner not an instance requiring driver activity is an that is compatible with said first operating sys- instance of boot-time initialisation, going to tem. step (b) if an instance of boot-time initialisation, going to step (d) if not an instance of boot-time 35 initialisation; (b) providing for determining (302) under which operating system the driver is running; (c) providing for setting (303) a system identi- fier to a set value if said first operating system 40 is running; (d) providing for determining (304) whether or not said system identifier equals said set value, going to step (e) if said system identifier equals said set value, going to step (g) if said system 45 identifier does not equal said set value; (e) providing for determining (305) whether a particular call differs between said first and second operating systems, going to step (f) whenever a call does not differ, going to step so (g) whenever a call does differ; (f) providing for initiating (307) a call that is compatible with both first and second operating systems; (g) providing for emulating (306) a differing call 55 in a manner that is compatible with said first operating system.

5. A computer implemented process for implementing

6 — I A

f—rl EP 0 805 399 A1

I 20 \ Build VxD according to Windows 95 interface to

produce driver.vxd tile 4

20Z

Copy the driver.vxd file to to driver.386 file.

Patch the Device Descriptor Block in the driver.386 file to support Windows 3.x platform £

Fig. 2

8

EP 0 805 399 A1

European Patent N— J) EUROPEAN SEARCH REPORT Office Ep 97 20 1082

DOCUMENTS CONSIDERED TO BE RELEVANT Category Citation of document with indication, where appropriate, Relevant CLASSIFICATION OF THE of relevant passages to claim APPLICATION (Int.CL6) US 5 459 867 A (ADAMS PHILLIP M ET AL) 17 1-5 G06F13/10 October 1995 * abstract * * column 4, line 31 - column 6, line 32 * * column 20, line 5 - line 57 *

A WO 96 07136 A ( INC) 7 March 1996 1,3-5 * the whole document *

A DR. DOBBS JOURNAL, 1-5 vol. 20, no. 11, November 1995, US, pages 64, 66-68, XP002O38674 MATTHEWS D: "PORTING VXDS FROM WINDOWS 3.1 TO WINDOWS 95" * page 64, column C, line 1 - line 16 *

TECHNICAL FIELDS SEARCHED (Int.CI.6) G06F

The present search report has been drawn up for all claims Place of ware* Dale of aunptetioa of Ike lean* Exaaaaer BERLIN 25 August 1997 MASCHE, C CATEGORY OF CITED DOCUMENTS T : theory or principle underlying the invention E : earlier patent document, but published on, or X : particularly relevant if taken alone after the filing date Y : particularly relevant if combined with another D : document cited in the application document of the same category L : document cited for other reasons A : technological background O : non-written disclosure & : member of the same patent family, corresponding P : intermediate document document

10