VESA Bios Extension

Core Functions, Version 2.0



This is _NOT_ an official version of the VBE/Core 2.0 standard, but is provided as is by SciTech Software until the official specification is made available electronically. This document contains a summary of the important portions of the standard related to developing working code for VBE 2.0.

For more information on the official specification, please contact VESA at the address listed below:


Table of Contents



1. Introduction
    1.1. Scope of the VBE Standard
    1.2. Backgrounder
2. VBE Overview
    2.1. VBE  Features
    2.2. VBE Affected Devices
    2.3. Providing Vendor Information
3. VBE Mode Numbers
4. VBE Functions

1.    Introduction

This document contains the VESA BIOS Extension (VBE) specification for standard software access to graphics display controllers that support resolutions, color depths, and frame buffer organizations beyond the VGA hardware standard.  It is intended for use by both applications programmers and system software developers.

System software developers may use this document to supplement the System and INT 10h ROM BIOS functions to provide the VBE services. Application developers can use this document as a guide to programming all VBE compatible devices.

To understand the VBE specification, some knowledge of 80x86 assembly language and the VGA hardware registers may be required.  However, the services described in this specification may be called from any high-level programming language that provides a mechanism for generating software interrupts with the 80x86 registers set to user-specified values.

In this specification, 'VBE' and 'VBE 2.0' are synonymous with 'VBE Core Functions version 2.0'.

1.1. Scope of the VBE Standard

The primary purpose of the VESA VBE  is to provide standard software support for the many unique implementations of Super VGA (SVGA) graphics controllers on the PC platform that provide features beyond the original VGA hardware standard.  This is to provide a feasible mechanism by which application developers can take advantage of this nonstandard hardware in graphics applications.

The VBE specification offers an extensible software foundation which allows it to evolve as display and audio devices evolve over time, without sacrificing backward software compatibility with older implementations.  New application software should be able to work with older hardware, and application software that has already shipped should work correctly on new hardware devices.

VBE services provide standard access to all resolutions and color depths provided on the display controller, and report the availability and details of all supported configurations to the application as necessary.

VBE implementations facilitate the field support of audio and display hardware by providing the application software with the manufacturer's name and the product identification of the display hardware.

Since graphics controller services on the PC are typically implemented in ROM, the VBE services are defined so that they should be implemented within the standard VGA ROM.  When ROM implementations of VBE are not possible, or when field software upgrades to the onboard ROM are necessary, the VBE implementation may be also offered as a device driver or DOS Terminate & Stay Resident (TSR) program.

The standard VBE functions may be supplemented by OEM's as necessary to support custom or proprietary functions unique to the manufacturer. This mechanism enables the OEM to establish functions that may be standard to the product line, or provide access to special hardware enhancements.

Although previous VBE standards assumed that the underlying graphics architecture was a VGA device, the display services described by VBE 2.0 can be implemented on any frame buffer oriented graphics device.

The majority of VBE services facilitate the setup and configuration of the hardware, allowing applications high performance, direct access to the configured device at runtime.  To further improve the performance of flat frame buffer display devices in extended resolutions, VBE 2.0 provides new memory models that do not require the traditional frame buffer "banking" mechanisms.

VBE is expected to work on all 80x86 platforms, in real and protected modes.

Since some modern display devices are designed without any VGA support, two display controllers may be present in the system.  One display controller would be used for VGA compatibility, and the other used for graphic extensions to the basic VGA modes, resolutions, and frame buffer models.  Therefore, VBE must be able offer the application automatic access to the appropriate device based on the mode or resolution that is requested by the application.

Currently beyond the scope of the VBE specification is the handling of hardware configuration and installation issues.  It was originally considered to become part of VBE 2.0, however we have deferred the issues to the Graphics Configuration Supplemental Specification.  In addition, it is also possible for an OEM to define their own extensions using the OEM Supplemental Specification if required.

1.2. Backgrounder

The IBM VGA  has become a de facto standard in the PC graphics world. A multitude of different VGA offerings exist in the marketplace, each one providing BIOS or register compatibility with the IBM VGA. More and more of these VGA compatible products implement various supersets of the VGA standard. These extensions range from higher resolutions and more colors to improved performance and even some graphics processing capabilities. Intense competition has dramatically improved the price/performance ratio, to the benefit of the end user.

However, several serious problems face a software developer who intends to take advantage of these "Super VGA"  environments. Because there is no standard hardware implementation, the developer is faced with widely disparate Super VGA hardware architecture. Lacking a common software interface, designing applications for these environments is costly and technically difficult. Except for applications supported by OEM-specific display drivers, very few software packages can take advantage of the power and capabilities of Super VGA products.

The VBE standard was originally conceived to enable the development of applications that wished to take advantage of display resolutions and color depths beyond the VGA definition.  The need for an application or software standard was recognized by the developers of graphic hardware to encourage the use and acceptance of their rapidly advancing product families.  It became obvious that the majority of software application developers did not have the resources to develop and support custom device level software for the hundreds of display boards on the market.  Therefore the rich new features of these display devices were not being used outside of the relatively small CAD market, and only then after considerable effort.

Indeed, the need for a standard for SVGA display adapters became so important that the VESA organization was formed to seek out a solution.  The original VBE standard was devised and agreed upon by each of the active display controller manufacturers, and has since been adopted by DOS application developers to enable use of non-VGA extended display modes.

As time went along VBE 1.1 was created to add more video modes and increased logical line length/double buffering support.  VBE 1.2 was created to add modes and also added high color RAMDAC support.

In the three years since VBE 1.2 was approved we have seen the standard become widely accepted and many successful programs have embraced VBE.  However, it has become obvious that the need for a more robust and extensible standard exists.  Early extensions to the VGA standard continued using all of the original VGA I/O ports and frame buffer address to communicate with the controller hardware.  As we've seen, the supported resolutions and color depths have grown, intelligent controllers with BITBLT and LineDraw Functions have become common, and new flat frame buffer memory models have appeared along with display controllers that are not based on VGA in any way.  VBE 2.0 and future extensions will support non-VGA based controllers with new functions for reading and writing the palette and for access to the flat frame buffer models.

VBE 2.0, as designed, offers the extensibility and the robustness that was lacking in the previous specifications, while at the same time offering backwards compatibility.

In the future, we see the need for adding supplemental specifications for issues like Multimedia; Advanced Graphics Functions; and "Plug and Play" features.
 

2. VBE Overview

This chapter outlines the various features and limitations of the VBE standard.

2.1. VBE  Features

Standard application interface to Graphics Controllers (SVGA Devices) Standard method of identifying products and manufacturers. Provision for OEM extensions through Sub-function 14h Simple protected mode interface. Extensible interface through supplemental specifications.

2.2. VBE Affected Devices

All frame buffer-based devices in the IBM PC platform (with the exception of Hercules, Monochrome (MDA), CGA and EGA devices) are suitable for use within the VBE standard to enable access to the device by VBE-compliant applications.

2.3. Providing Vendor Information

The VGA specification does not provide a standard mechanism to determine what graphic hardware it is running on. Only by knowing OEM- specific features can an application determine the presence of a particular graphics controller or display board. This often involves reading and testing registers located at I/O addresses unique to each OEM. By not knowing what hardware an application is running on, few, if any, of the extended features of the underlying hardware can be used.

The VESA BIOS Extension provides several functions to return information about the graphics environment. These functions return system level information as well as graphics mode specific details. Function 00h returns general system level information, including an OEM identification string. The function also returns a pointer to the supported VBE and OEM modes. Function 01h may be used by the application to obtain additional information about each supported mode. Function 03h returns the current VBE mode.

3. VBE Mode Numbers

Standard VGA mode numbers are 7 bits wide and presently range from 00h to 13h. OEMs have defined extended display modes in the range 14h to 7Fh. Values in the range 80h to FFh cannot be used, since VGA BIOS Function 00h (Set video mode) interprets bit 7 as a flag to clear or preserve display memory.

Due to the limitations of 7 bit mode numbers, the optional VBE mode numbers are 14 bits wide. To initialize a VBE mode, the mode number is passed in the BX register to VBE Function 02h (Set VBE mode).

The format of VBE mode numbers is as follows:
 

D0-D8 Mode number D8 = 0 - this is not a VESA defined mode 
D8 = 1 - this is a VESA defined mode
D9-D13 Reserved = 0
D14 Linear/Flat Frame Buffer 0 - Use VGA Frame Buffer 
1 - Use Linear/Flat Frame Buffer 
D15 Preserve Display Memory 0 - Clear display memory 
1 - Preserve display memory 
Thus, VBE mode numbers begin at 100h. This mode numbering scheme implements standard 7-bit mode numbers for OEM-defined modes.  Standard VGA modes may be initialized through VBE Function 02h (Set VBE mode) simply by placing the mode number in BL and clearing the upper byte (BH). 7-bit OEM-defined display modes may be initialized in the same way.  Note that modes may only be set if the mode exists in the Video Mode List returned in Function 0.

Note: Starting with VBE version 2.0 VESA will no longer define new VESA mode numbers and it will not longer be mandatory to support these old mode numbers.  However, it is highly recommended that BIOS implementations continue to support these mode numbers for compatibility with old software.  VBE 2.0-aware applications should follow the guidelines in Appendix 5 - Application Programming Considerations - for setting a desired mode.

Note:  Mode 81FFh is a special mode designed to preserve the current memory contents and to give access to the entire video memory.  This mode is especially useful for saving the entire video memory contents before going into a state that could lose the contents (e.g. set this mode to gain access to all video memory to save it before going into a volatile power down state).  This mode is required because the entire video memory contents are not always accessible in every mode.  It is recommended that this mode be packed pixel in format, and a ModeInfoBlock must be defined for it.  Look in the ModeInfoBlock to determine if paging is required and how paging is supported if it is. Also note that there are no implied resolutions or timings associated with this mode.

Note:  Future display resolutions will be defined by VESA display vendors.  The color depths will not be specified and new mode numbers will not be assigned for these resolutions.  For example, if the VESA display vendors define 1600x1200 as a VESA resolution, application developers should target their display resolution for 1600x1200 rather than choosing an arbitrary resolution like 1550x1190.  The VBE implementation should be queried to get the available resolutions and color depths and the application should be flexible enough to work with this list.  Appendix 5 gives a detailed summary of the way an application should go about selecting and setting modes.

4. VBE Functions

This chapter describes in detail each of the functions defined by the VBE standard.  VBE functions are called using the INT 10h interrupt vector, passing arguments in the 80X86 registers.  The INT 10h interrupt handler first determines if a VBE function has been requested, and if so, processes that request.  Otherwise control is passed to the standard VGA BIOS for completion.

All VBE functions are called with the AH register set to 4Fh to distinguish them from the standard VGA BIOS functions.  The AL register is used to indicate which VBE function is to be performed. For supplemental or extended functionality the BL register is used when appropriate to indicate a specific sub-function.

Functions 00-0Fh have been reserved for Standard VBE function numbers;
Functions 10-FFh are reserved for VBE Supplemental Specifications.

In addition to the INT 10h interface, a Protected Mode Interface is available and is described below.

4.1. VBE Return Status

The AX register is used to indicate the completion status upon return from VBE functions.  If VBE support for the specified function is available, the 4Fh value passed in the AH register on entry is returned in the AL register.  If the VBE function completed successfully, 00h is returned in the AH register.  Otherwise the AH register is set to indicate the nature of the failure.

VBE return status
 

AL  = 0x4Fh - Function is supported
!= 0x4Fh - Function is not supported
AH  0x00 - Function call successful 
0x01 - Function call failed 
0x02 - Software supports this function, but the hardware does not support function
0x03 - Function call invalid in current video mode 
Note: Applications should treat any non-zero value in the AH register as a general failure condition as later versions of the VBE may define additional error codes.

4.2. Protected Mode considerations

VBE services may be called directly from 32-bit Protected mode only. For 32 bit protected mode, 2 selector/segment descriptors for 32-bit code and the data segment are needed. These will be allocated and initialized by the caller. The segment limit fields will be set to 64k. These selectors may either be in the GDT or LDT, but must be valid whenever the VBE is called in protected mode. The caller must supply a stack large enough for use by VBE and by potential interrupt handlers. The caller's stack will be active if or when interrupts are enabled in the VBE routine, since the VBE will not switch stacks when interrupts are enabled, including NMI interrupts. The 32-bit VBE interface requires a 32-bit stack.

When the VBE services are called, the current I/O permission bit map must allow access to the I/O ports that the VBE may need to access. This can be found in the Sub-table (Ports and Memory) returned by VBE
Function 0Ah.

To summarize, it is the calling application's responsibility to ensure to that it has the appropriate I/O and memory privileges, a large enough stack and appropriate selectors allocated.  It is also the calling application's responsibility to preserve registers if it needs them.

4.3. Function 00h - Return VBE Controller Information

This required function returns the capabilities of the display controller, the revision level of the VBE implementation, and vendor specific information to assist in supporting all display controllers in the field.

The purpose of this function is to provide information to the calling program about the general capabilities of the installed VBE software and hardware. This function fills an information block structure at the address specified by the caller. The VbeInfoBlock information block size is 256 bytes for VBE 1.x, and 512 bytes for VBE 2.0.
 
 

Input AX 4F00h  Return VBE Controller Information
ES:DI  Pointer to buffer in which to place VbeInfoBlock structure (VbeSignature should be set to 'VBE2' when function is called to indicate VBE 2.0 information is desired and the information block is 512 bytes in size.)
Output:  AX VBE Return Status
Note: All other registers are preserved.

The information block has the following structure:

class VbeInfoBlock {
public:
    char VbeSignature[4] = {'V', 'E', 'S', 'A};        // VBE Signature
    short VbeVersion = 0x0200;                         // VBE Version
    char *OemStringPtr;                                // Pointer to OEM String
    unsigned long Capabilities;                        // Capabilities of graphics cont.
    short *VideoModePtr;                               // Pointer to Video Mode List
    unsigned short TotalMemory;                        // Number of 64kb memory blocks

    // Added for VBE 2.0
    short OemSoftwareRev;                              // VBE implementation Software revision
    char *OemVendorNamePtr;                            // Pointer to Vendor Name String
    char *OemProductNamePtr;                           // Pointer to Product Name String
    char *OemProductRevPtr;                            // Pointer to Product Revision String

    char Reserved[222];                                // Reserved for VBE implementation

    // scratch area
    char OemData[256];                                 // Data Area for OEM Strings
};

Note: All data in this structure is subject to change by the VBE implementation when VBE Function 00h is called.  Therefore, it should not be used by the application to store data of any kind.

Description of the VbeInfoBlock structure fields:

 
D0 0 - DAC is fixed width, with 6 bits per primary color 
1 - DAC width is switchable to 8 bits per primary color 
D1 0 - Controller is VGA compatible 
1 - Controller is not VGA compatible 
D2 0 - Normal RAMDAC operation 
1 - When programming large blocks of information to the RAMDAC use blank bit in Function 09h. i.e. RAMDAC recommends programming during blank period only. 
D3-31  Reserved
 

4.4. Function 01h - Return VBE Mode Information

This required function returns extended information about a specific VBE display mode from the mode list returned by VBE Function 00h. This function fills the mode information block, ModeInfoBlock, structure with technical details on the requested mode.  The ModeInfoBlock structure is provided by the application with a fixed size of 256 bytes.

Information can be obtained for all listed modes in the Video Mode List returned in Function 00h.  If the requested mode cannot be used or is unavailable, a bit will be set in the ModeAttributes field to indicate that the mode is not supported in the current configuration.
 
 

Input: AX 0x4F01 - Return VBE mode information
CX Mode number
ES:DI Pointer to ModeInfoBlock structure
Output: AX VBE Return Status

Note: All other registers are preserved.

The mode information block has the following structure:

class ModeInfoBlock {
public:
    // Mandatory information for all VBE revisions
    unsigned short ModeAttributes;                    // mode attributes
    unsigned char WinAAttributes;                     // window A attributes
    unsigned char WinBAttributes;                     // window B attributes
    unsigned short WinGranularity;                    // window granularity
    unsigned short WinSize;                           // window size
    unsigned short WinASegment;                       // window A start segment
    unsigned short WinBSegment;                       // window B start segment
    void (*WinFuncPtr)();                             // pointer to window function
    unsigned short BytesPerScanLine;                  // bytes per scan line

    // Mandatory information for VBE 1.2 and above
    unsigned short XResolution;                       // horizontal resolution in pixels or chars
    unsigned short YResolution;                       // vertical resolution in pixels or chars
    unsigned char XCharSize;                          // character cell width in pixels
    unsigned char YCharSize;                          // character cell height in pixels
    unsigned char NumberOfPlanes;                     // number of memory planes
    unsigned char BitsPerPixel;                       // bits per pixel
    unsigned char NumberOfBanks;                      // number of banks
    unsigned char MemoryModel;                        // memory model type
    unsigned char BankSize;                           // bank size in KB
    unsigned char NumberOfImagePages;                 // number of images
    unsigned char Reserved;                           // reserved for page function

    // Direct Color fields (required for direct/6 and YUV/7 memory models)
    unsigned char RedMaskSize;                        // size of direct color red mask in bits
    unsigned char RedFieldPosition;                   // bit position of lsb of red mask
    unsigned char GreenMaskSize;                      // size of direct color green mask in bits
    unsigned char GreenFieldPosition;                 // bit position of lsb of green mask
    unsigned char BlueMaskSize;                       // size of direct color blue mask in bits
    unsigned char BlueFieldPosition;                  // bit position of lsb of blue mask
    unsigned char RsvdMaskSize;                       // size of direct color reserved mask in bits
    unsigned char RsvdFieldPosition;                  // bit position of lsb of reserved mask
    unsigned char DirectColorModeInfo;                // direct color mode attributes

    // Mandatory information for VBE 2.0 and above
    char *PhysBasePtr;                                // physical address for flat frame buffer
    char *OffScreenMemOffset;                         // pointer to start of off screen memory
    unsigned short OffScreenMemSize;                  // amount of off screen memory in 1k units

    char Reserved[206];                               // remainder of ModeInfoBlock
};

Field descriptions:

The ModeAttributes field describes certain important characteristics
of the graphics mode.
 

D0 Mode supported by hardware configuration 
0 - Not supported 
1 - Supported 

This bit is reset to indicate the unavailability of a graphics mode if it requires a certain monitor type, more memory than is physically installed, etc

D1 Reserved (=1) 

Was used by VBE 1.0 and 1.1 to indicate that the optional information following the BytesPerScanLine field were present in the data structure.  This information became mandatory with VBE version 1.2 and above, so D1 is no longer used and should be set to 1.  The Direct Color fields are valid only if the MemoryModel field is set to a 6 (Direct Color) or 7 (YUV)

D2 TTY Output functions supported by BIOS 
0 - Not supported 
1 - Supported 

Indicates whether the video BIOS has support for output functions like TTY output, scroll, etc. in this mode.  TTY support is recommended but not required for all extended text and graphic modes. If bit D2 is set to 1, then the INT 10h BIOS must support all of the standard output functions listed below. 

All of the following TTY functions must be supported when this bit is set: 

01   Set Cursor Size 
02   Set Cursor Position 
06   Scroll TTY window up or Blank Window 
07   Scroll TTY window down or Blank Window 
09   Write character and attribute at cursor position 
0A   Write character only at cursor position 
0E   Write character and advance cursor

D3 Monochrome/color mode (see note below) 
0 - Monochrome mode 
1 - Color mode 

Set to indicate color modes, and cleared for monochrome modes

D4 Mode type 
0 - Text mode 
1 - Graphics mode 

Set to indicate graphics modes, and cleared for text modes 

Note: Monochrome modes map their CRTC address at 3B4h. Color modes map their CRTC address at 3D4h. Monochrome modes have attributes in which only bit 3 (video) and bit 4 (intensity) of the attribute controller output are significant. Therefore, monochrome text modes have attributes of off, video, high intensity, blink, etc. Monochrome graphics modes are two plane graphics modes and have attributes of off, video, high intensity, and blink. Extended two color modes that have their CRTC address at 3D4h, are color modes with one bit per pixel and one plane. The standard VGA modes, 06h and 11h would be classified as color modes, while the standard VGA modes 07h and 0Fh would be classified as monochrome modes. 

D5 VGA compatible mode 
0 - Yes 
1 - No 

Used to indicate if the mode is compatible with the VGA hardware registers and I/O ports.  If this bit is set, then the mode is NOT VGA compatible and no assumptions should be made about the availability of any VGA registers.   If clear, then the standard VGA I/O ports and frame buffer address defined in WinASegment and/or WinBSegment can be assumed

D6 VGA compatible windowed memory mode is available 
0 - Yes 
1 - No 

Used to indicate if the mode provides Windowing or Banking of the frame buffer into the frame buffer memory region specified by WinASegment and WinBSegment.  If set, then Windowing of the frame buffer is NOT possible.  If clear, then the device is capable of mapping the frame buffer into the segment specified in WinASegment and/or WinBSegment.  (This bit is used in conjunction with bit D7, see table following D7 for usage)

D7 Linear frame buffer mode is available 
0 - No 
1 - Yes 

Indicates the presence of a Linear Frame Buffer memory model. If this bit is set, the display controller can be put into a flat memory model by setting the mode (VBE Function 02h) with the Flat Memory Model bit set. (This bit is used in conjunction with bit D6, see following table for usage)

D8-D15  Reserved 
D7  D6 
Windowed frame buffer only  0 0
n/a 0 1
Both windowed adn linear 1 0
Linear frame buffer only 1 1
 
D0 Relocatable window(s) supported 
0 - Single non-relocatable window only 
1 -  Relocatable window(s) are supported
D1 Window readable 
0 - Window is not readable 
1 - Window is readable
D2 Window writeable 
 0 - Window is not writeable 
 1 - Window is writeable
D3-D7  Reserved
 
0x00 Text mode
0x01 CGA graphics
0x02 Hercules graphics
0x03 Planar
0x04 Packed pixel
0x05 Non-chain 4, 256 color
0x06 Direct Color
0x07 YUV
0x08-0x0F Reserved, to be defined by VESA
0x10-0xFF To be defined by OEM
D0 0 - Color ramp is fixed 
1 - Color ramp is programmable 
D1 0 - Bits in Rsvd field are reserved 
1 - Bits in Rsvd field are usable by the application 

4.5. Function 02h  - Set VBE Mode

This required function initializes the controller and sets a VBE mode. The format of VESA VBE mode numbers is described earlier in this document. If the mode cannot be set, the BIOS should leave the graphics environment unchanged and return a failure error code.
 
Input: AX 0x4F02 - Set VBE Mode
BX  D0-D8 Mode number
D9-D13  Reserved (must be 0)
D14 0 - Use windowed frame buffer model 
1 - Use linear/flat frame buffer model 

If set, the mode will be initialized for use with a flat frame buffer model.  The base address of the frame buffer can be determined from the extended mode information returned by VBE Function 01h.  If D14 is set, and a linear frame buffer model is not available then the call will fail, returning AH=01h to the application.

D15 Clear display memory 

If bit D15 is not set, all reported image pages, based on Function 00h returned information NumberOfImagePages, will be cleared to 00h in graphics mode, and 20 07 in text mode.  Memory over and above the reported image pages will not be changed.  If bit D15 is set, then the contents of the frame buffer after the mode change is undefined. Note, the 1-byte mode numbers used in Function 00h of an IBM VGA compatible BIOS use D7 to signify the same thing as D15 does in this function.  If D7 is set for an IBM compatible mode set using this Function (02), this mode set will fail.  VBE aware applications must use the memory clear bit in D15.

Output: AX  VBE Return Status 

If the requested mode number is not available, then the call will fail, returning AH=01h to indicate the failure to the application.

Notes:

4.6. Function 03h - Return current VBE Mode

This required function returns the current VBE mode. The format of VBE mode numbers is described earlier in this document.
 
Input: AX 0x4F03 - Return current VBE Mode
Output:  AX VBE Return Status
BX  D0-D13 Mode number
D14 0 - Windowed frame buffer model 
1 - Linear/flat frame buffer model
D15 
 
0 - Memory cleared at last mode set 
1 - Memory not cleared at last mode set
Notes:

4.7. Function 04h  - Save/Restore state

This required function provides a complete mechanism to save and restore the display controller hardware state. The functions are a superset of the three subfunctions under the standard VGA BIOS Function 1Ch (Save/restore state) which does not guarantee that the extended registers of the video device are saved or restored. The complete hardware state (except frame buffer memory) should be saveable/restorable by setting the requested states mask (in the CX register) to 000Fh.
 
 
Input: AX 0x4F04 - Save/Restore state
DL 0x00 Return save/restore state buffer size
0x01 Save state
0x02 Restore state
CX D0 Save/restore controller hardware state
D1 Save/restore BIOS data state
D2 Save/restore DAC state
D3 Save/restore Register state
ES:BX Pointer to buffer (if DL <> 00h)
Output: AX VBE Return Status
BX Number of 64-byte blocks to hold the state buffer (if DL=00h)
 
Note: All other registers are preserved.

4.8. Function 05h - Display Window Control

This required function sets or gets the position of the specified display window or page in the frame buffer memory by adjusting the necessary hardware paging registers.  To use this function properly, the software should first use VBE Function 01h (Return VBE Mode information) to determine the size, location and granularity of the windows.

For performance reasons, it may be more efficient to call this function directly, without incurring the INT 10h overhead.  VBE Function 01h returns the segment:offset of this windowing function that may be called directly for this reason.  Note that a different entry point may be returned based upon the selected mode.  Therefore, it is necessary to retrieve this segment:offset specifically for each desired mode.
 
 

Input: AX  0x4F05 - VBE Display Window Control
BH 0x00 Set memory window
0x01 Get memory window
BL 0x00 Window A
0x01 Window B
DX Window number in video memory in window 
granularity units
(Set Memory Window only)
Output: AX VBE Return Status
DX Window number in window granularity units (Get Memory Window only)
 

4.9. Function 06h - Set/Get Logical Scan Line Length

This required function sets or gets the length of a logical scan line. This allows an application to set up a logical display memory buffer that is wider than the displayed area. VBE Function 07h (Set/Get Display Start) then allows the application to set the starting position that is to be displayed.
 
 
Input: AX  0x4F06 - VBE Set/Get Logical Scan Line Length
BL 0x00 Set Scan Line Length in Pixels
0x01 Get Scan Line Length
0x02 Set Scan Line Length in Bytes
0x03 Get Maximum Scan Line Length
Output: AX VBE Return Status
BX Bytes Per Scan Line
CX Actual Pixels Per Scan Line (truncated to nearest complete pixel)
DX Maximum Number of Scan Lines
Notes:

4.10. Function 07h - Set/Get Display Start

This required function selects the pixel to be displayed in the upper left corner of the display.  This function can be used to pan and scroll around logical screens that are larger than the displayed screen.  This function can also be used to rapidly switch between two different displayed screens for double buffered animation effects.
 
 
 
Input: AX  0x4F07 - VBE Set/Get Display Start Control
BH Reserved Must be 0x00
BL 0x00 Set Display Start
0x01 Get Display Start
0x80 Set Display Start during Vertical Retrace
CX First Displayed Pixel In Scan Line (Set Display Start only)
DX First Displayed Scan Line (Set Display Start only)
Output: AX VBE Return Status
BH 00h Reserved and will be 0  (Get Display Start only)
CX First Displayed Pixel In Scan Line (Get Display Start only)
DX First Displayed Scan Line (Get Display Start only)
Notes:

4.11. Function 08h - Set/Get DAC Palette Format

This required function manipulates the operating mode or format of the DAC palette. Some DACs are configurable to provide 6 bits, 8 bits, or more of color definition per red, green, and blue primary colors. The DAC palette width is assumed to be reset to the standard VGA value of 6 bits per primary color during any mode set
 
 
Input: AX  4F08h   VBE Set/Get Palette Format
BL 0x00 Set DAC Palette Format
0x01 Get DAC Palette Format
BH Desired bits of color per primary Set DAC Palette Format only
Output: AX VBE Return Status
BH Current number of bits of color per primary

Notes:

4.12. Function 09h - Set/Get Palette Data

This required function is very important for RAMDAC's which are larger than a standard VGA RAMDAC.  The standard INT 10h BIOS Palette function calls assume standard VGA ports and VGA palette widths.  This function offers a palette interface that is independent of the VGA assumptions.
 
 
Input: AX 0x4F09 - VBE Load/Unload Palette Data
BL 0x00 Set Palette Data
0x01 Get Palette Data 
0x02 Set Secondary Palette Data
0x80 Set Palette Data during Vertical Retrace with Blank Bit on
CX Number of palette registers to update
DX First palette register to update
ES:DI  Pointer to table of palette values  (see below for format)
Output: AX VBE Return Status

Notes:

4.13. Function 0Ah - Return VBE Protected Mode Interface

This required function call returns a pointer to a table that contains code for a 32-bit protected mode interface that can either be copied into local 32 bit memory space or can be executed from ROM providing the calling application sets all required selectors and I/O access correctly. This function returns a pointer (in real mode space) with offsets to the code fragments, and additionally returns an offset to a table which contains Non-VGA Port and Memory locations which an Application may have to have I/O access to.
 
 
Input: AX  0x4F0A - VBE 2.0 Protected Mode Interface
BL 0x00 - Return protected mode table
Output: AX VBE Return Status
ES Real Mode Segment of Table
DI Offset of Table
CX Length of Table including protected mode code (for copying purposes)

The format of the table is as follows:
 

ES:DI + 00h Word Offset in table of Protected mode code for Function 5 for Set Window Call
ES:DI + 02h Word Offset in table of Protected mode code for Function 7 for set Display Start
ES:DI + 04h Word Offset in table of Protected mode code for Function 9 for set Primary palette data
ES:DI + 06h Word  Offset in table of Ports and Memory Locations that the application may need I/O privilege for. (Optional:  if unsupported this must be 0000h) (See Sub-table for format)
ES:DI + ? Variable remainder of Table including Code

The format of the Sub-Table (Ports and Memory locations)

Notes:  

Vesa 2.0 specification

Notes:
Blue: E0DFEE (224, 223, 238)
Red: EEDFDF (238, 223, 223)

<End of file>