(12) Patent Application Publication (10) Pub. No.: US 2012/0159520 A1 Ueltschey, III Et Al
Total Page:16
File Type:pdf, Size:1020Kb
US 20120159520A1 (19) United States (12) Patent Application Publication (10) Pub. No.: US 2012/0159520 A1 Ueltschey, III et al. (43) Pub. Date: Jun. 21, 2012 (54) EMULATING LEGACY VIDEO USING UEFI (52) U.S. Cl. ........................................................ 719/323 (76) Inventors: Charles Marion Ueltschey, III, (57) ABSTRACT Beaverton,SnaW SEOR (US): is". Timoth S Techniques for Supporting legacy VGA video using UEFI CA (US) s s standard and extended UEFI graphics drivers. When an oper ating system that does not natively support the UEFI display (21) Appl. No.: 13/190,343 protocols requires video services provided by firmware, the operating system communicates a request for video services (22) Filed: Jul. 25, 2011 to a generic video option ROM. The generic video option ROM notifies a generic video SMM driver of the request for Related U.S. Application Data Video services. Such notification may be performed using a Software system management interrupt (SMI). Upon notifi (60) Provisional application No. 61/424,396, filed on Dec. cation, the generic video SMM driver notifies a third party 17, 2010. UEFI video driver of the request for video services. The third O O party video driver provides the requested video services to the Publication Classification operating system. In this way, a third party UEFI graphics (51) Int. Cl. driver may support a wide variety of operating systems, even G06F 9/44 (2006.01) those that do not natively support the UEFI display protocols. LEGACY OPERATING SYSTEM 110 GENERIC VIDEO OPTION ROM 120 GENERIC VIDEO SMMDRIVER 130 THIRD PARTY UEF VIDEO DRIVER 140 Patent Application Publication Jun. 21, 2012 Sheet 1 of 7 US 2012/O159520 A1 LEGACY OPERATING SYSTEM 110 GENERIC VIDEO OPTION ROM 120 GENERIC VIDEO SMMDRIVER 130 THIRD PARTY UEF VIDEO DRIVER 140 10 FIG. 1 Patent Application Publication Jun. 21, 2012 Sheet 2 of 7 US 2012/O159520 A1 210 INITIALIZE GENERIC VIDEO SMMDRIVER 130 220 INITIALIZE GENERIC VIDEO OPTION ROM 120 230 SERVICE REAL-MODE INTERRUPTS FIG. 2 Patent Application Publication Jun. 21, 2012 Sheet 3 of 7 US 2012/O159520 A1 INITIALIZING GENERIC VIDEO SMMDRIVER 130 310 LOCATE INSTANCES OF GRAPHICS OUTPUT PROTOCOL INSTALLED ON THE COMPUTER SYSTEM 320 ALLOCATE A SOFTWARE SM COMMAND-PORT VALUE FIG. 3 Patent Application Publication Jun. 21, 2012 Sheet 4 of 7 US 2012/O159520 A1 INITIALIZING GENERIC VIDEO OPTION ROM 120 410 RECORD THE SOFTWARE SM COMMAND-PORT VALUE 420 DISCOVERATTRIBUTES OF THE GRAPHICS OUTPUT DEVICES 430 UPDATE REAL-MODE INTERRUPT VECTOR TABLE 440 EXIT WITH SUCCESS STATUS CODE FIG. 4 Patent Application Publication Jun. 21, 2012 Sheet 5 of 7 US 2012/O159520 A1 Graphics Output Device (1440 x 800 %Virtual Output Device (800x600 6 Virtual Text Screen (100x31 W/8X19font) 2 FIG. 5A Reported Frame Buffer Address Reported Scan Line Size - Reported Horizontal ReSolution - Graphics Output Device (1440 x 800 % Virtual Output Device (800x600) 2 FIG. 5B Patent Application Publication Jun. 21, 2012 Sheet 6 of 7 US 2012/O159520 A1 (TEXldHBdSELÅG 9"SDI 1)HEHH08BWVH+ (TEXldHBdBLÅG Patent Application Publication Jun. 21, 2012 Sheet 7 of 7 US 2012/O159520 A1 LEGACY OPERATING SYSTEM 110 GENERIC VIDEO OPTION ROM 120 GENERIC VIDEO SMMDRIVER 130 THIRD PARTY SMM UEF VIDEO THIRD PARTY UEF DRIVER VIDEO DRIVER (OPTIONAL) 710 FIG. 7 US 2012/O 159520 A1 Jun. 21, 2012 EMULATING LEGACY VIDEO USING UEF is also larger in size than is desirable, as each of the two drivers contain roughly the same level of executable code, CLAIM OF PRIORITY and, in many cases, must be placed inside of non-volatile storage (flash, EEPROM, etc.) on a plug-in card or on the 0001. The present application claims priority to U.S. pro system motherboard. In either case, this could cause the cost visional application 61/424,396, entitled, “Emulation of of the product to rise. Another disadvantage to the first Legacy Video Using UEFI Graphics Output Protocol, filed approach is that it is difficult to maintain, as bug fixes and Dec. 17, 2010, by Chip Ueltschey et al., which is hereby feature updates must be made in both the option ROM and the incorporated by reference for all purposes as if fully set forth UEFI driver. herein. 0008. The second approach for making manufacturer-pro FIELD OF THE INVENTION vided executable code available to the firmware also exhibits problems with size and speed. The option ROM is run in 0002 The present invention relates to approaches for Sup 16-bit real mode, which is a slower and more constrained porting legacy VGA video interfaces using the facilities pro mode of x86 CPUs. The UEFI driver is run in either 32-bit or vided by standard and extended UEFI graphics drivers. 64-bit protected mode, which is a faster mode, but efficient access to the graphics frame buffer used for high-perfor BACKGROUND OF THE INVENTION mance graphics is not possible. Also, the option ROMs can 0003. Today there are two major approaches for booting a only execute in a relatively small area of memory (roughly PC. The first approach (the “legacy approach') originated from 768K to 1 MB). Finally, as system firmware makes the with IBM in the 1980s, while a more modern approach (the transition to UEFI, the number of third party vendors who “EFI/UEFI approach') was initially developed by Intel Cor will either produce or optimize for performance their option poration in 1999 and was later enhanced by others. These two ROMs will dwindle over time. approaches are not necessary compatible as these standards 0009 Discussion in this section is meant to provide an use a different model to launch the operating system and understanding of prior approaches to the reader as they relate initialize hardware resources. to embodiments of the invention. However, the disadvantages 0004 Operating systems are generally designed to be of prior approaches discussed in this section are not meant to booted using either the legacy approach or the EFI/UEFI be an admission that such disadvantages were publicly approach for booting. Typically, older operating systems known. Consequently, recognition of the disadvantages of the (“legacy operating systems) expect to be booted using the prior art discussed herein is not meant to be construed as legacy approach and do not support being booted using the being within the prior art simply by virtue of its inclusion in EFI/UEFI approach. On the other hand, newer operating sys this section alone. tems (“UEFI operating systems) typically expect to be booted using the EFI/UEFI approach and do not support SUMMARY OF THE INVENTION being booted using the legacy approach. This presents a chal lenge for firmware manufacturers as firmware needs to Sup 00.10 Embodiments of the invention use the graphics port not only newer operating systems which generally expect frame buffer provided by the UEFI graphics driver to emulate to be booted using the EFI/UEFI approach, but also older both legacy text and video modes. Attempts to access legacy operating systems which generally expect to be booted using video services provided by the UEFI graphics driver are the legacy approach. translated by a generic video option ROM into software SMI 0005 Certain optional or peripheral devices may be service calls made to a generic SMM video driver. The coupled or plugged into a PC to provide additional capabili generic SMM video driver uses information previously gath ties to the PC. Some less-complex peripheral devices (such as ered from the UEFI video driver to emulate the call to the a mouse or keyboard) may be directly supported by the firm UEFI graphics driver. In some cases, embodiments also pro ware. However, more complex devices. Such as a network vide emulation for the hardware text buffer or direct access to card or video card, may be Supported by executable code, a portion of the graphics device's frame buffer. provided by the manufacturer of the device, which may be 0011. The approaches described herein are not meant to called or referenced by the firmware. describe all the embodiments of the invention, as other 0006 With respect to video cards, there are generally two embodiments of the invention may differ in their operation approaches for making the executable code provided by the compared to the illustrative approaches discussed in this sec manufacturer of the video card accessible to the firmware of tion. the PC. According to a first approach, a third party option ROM and a third party UEFI video driver are used to support the two classes of operating systems (legacy operating sys BRIEF DESCRIPTION OF THE DRAWINGS tems and UEFI operating systems). In a second approach, a third party option ROM is provided and a generic UEFIVideo 0012 Embodiments of the invention are illustrated by way Driver uses the real mode services provided by the option of example, and not by way of limitation, in the figures of the ROM to create an instance of the UEFI Graphics Output accompanying drawings and in which like reference numer protocol. als refer to similar elements and in which: 0007 Both of these approaches for supporting legacy 0013 FIG. 1 is a high-level block diagram of an embodi Video Suffer from disadvantages. The first approach is slow, ment of the invention; especially on systems which must boot legacy and UEFI 0014 FIG. 2 is a flowchart illustrating the steps of a third operating systems, since, in the course of booting, the system party UEFI video driver to support the video requirements of firmware may have to load first the option ROM and then load legacy operating systems according to an embodiment of the the UEFI driver, perhaps more than once.