↓ Skip to main content

UEFI Graphics Explained: From Legacy INT 10h to GOP

UEFI Graphics Explained: From Legacy INT 10h to GOP

One question comes up frequently in firmware development: If UEFI has no INT 10h, how does firmware actually put an image on the screen?

It’s a reasonable question. From the original IBM PC in 1981 through the widespread adoption of UEFI, INT 10h was the standard BIOS video service. Assembly tutorials still demonstrate how to print a character using AH=0Eh and a software interrupt.

UEFI works differently. Search its specification for INT 10h and you will find no equivalent interrupt-based graphics interface. Yet the firmware setup screen appears, the UEFI Shell displays text, and motherboard logos show up during startup.

So who draws all those pixels?

The answer is Graphics Output Protocol (GOP), an interface that replaces the old BIOS video-service model with a discoverable protocol. To understand how it works, we need to trace the evolution from VBIOS and legacy interrupts to EFI graphics drivers, framebuffer access, and firmware text rendering.

The fundamental distinction is straightforward:

  • Legacy BIOS: Software requests a video operation through an interrupt, and the BIOS handles it.
  • UEFI: Software locates a graphics protocol and calls its function pointers directly. It can also access the framebuffer once the relevant information is available.

🧭 1. The Real Difference: No Interrupt-Based Service Interface
#

UEFI does not lack graphics support. It simply uses a different mechanism for exposing hardware services.

Legacy BIOS operates in 16-bit real mode and traditionally exposes hardware services through software interrupts. Common examples include:

  • INT 10h for video services.
  • INT 13h for disk services.
  • INT 16h for keyboard input.

The Interrupt Vector Table (IVT) acts as a lookup table for interrupt handlers. A program places a function number and its parameters in registers, executes an interrupt instruction, and transfers control to the corresponding BIOS handler.

UEFI uses a different execution and software architecture. On x86 platforms, UEFI firmware applications execute in the firmware’s supported 32-bit or 64-bit environment rather than relying on the traditional 16-bit real-mode BIOS interface.

Instead of dispatching hardware services through the IVT, UEFI components discover and communicate through Protocols.

A protocol is essentially a software interface published on a UEFI handle. Other components can locate that interface and invoke its functions through pointers.

This is the architectural change behind GOP: graphics becomes a service that firmware components can discover and use, rather than a collection of BIOS interrupt functions.

Dimension Legacy BIOS (INT 10h) UEFI (GOP)
Invocation Software interrupt and register arguments Function pointers in a protocol structure
Execution environment 16-bit real mode 32-bit or 64-bit UEFI environment
Provider System BIOS video services, backed by platform graphics firmware UEFI graphics driver
Mode discovery BIOS video modes and VBE mode numbers Dynamic enumeration through QueryMode()
Pixel access BIOS services or direct video-memory access, depending on the application Blt() or direct framebuffer access
Interface discovery Interrupt vector Protocol GUID and UEFI handle database

The key distinction is not simply that UEFI has no INT 10h. It is that UEFI replaces the old interrupt-based service interface with discoverable software objects.

For more background, see how x86 BIOS software interrupts and interrupt handlers work.

🖥️ 2. Legacy Graphics: How INT 10h Worked
#

Under Legacy BIOS, a program that wanted to display text or graphics could call INT 10h.

The calling convention depended on the requested function. The program placed a function number in AH, supplied additional parameters in other registers, and executed the interrupt instruction.

For example, BIOS teletype output used:

mov ah, 0Eh
mov al, 'A'
int 10h

The BIOS interrupt handler received the request and performed the corresponding video operation.

The graphics card’s VBIOS (Video BIOS) supplied low-level graphics initialization and video-related services. It commonly provided the implementation behind BIOS video functions, including support for the Video Electronics Standards Association’s VBE (VESA BIOS Extensions) interface.

VBE introduced more advanced graphics capabilities, including higher-resolution and higher-color-depth display modes. Its AX=4Fxx function family expanded what software could request, but the interface still relied on INT 10h and the legacy BIOS execution environment.

Why the legacy model was useful
#

The main advantage was compatibility.

A DOS application did not need to understand the internal design of every graphics card. It could use a standardized BIOS interface, allowing the same software to work across a wide range of machines.

This was particularly valuable during the DOS era, when hardware implementations varied considerably.

The limitations of INT 10h
#

The problem became more apparent as software moved beyond 16-bit real mode.

A 32-bit protected-mode application could not simply invoke the traditional BIOS interrupt handler as though it were running in real mode. It needed a transition mechanism, a virtual-8086 environment, or another compatibility technique.

DOS extenders and graphics libraries often handled these transitions, adding complexity to the display path.

There is also an important distinction: Legacy BIOS did not force every graphics application to route every pixel through an interrupt. After configuring a suitable graphics mode, software could access the framebuffer directly. VBE, for example, exposed information needed for linear framebuffer access when supported.

The interrupt interface was primarily the standardized mechanism for requesting video services and configuring display modes. It was not necessarily involved in every subsequent pixel write.

Key takeaway: Legacy BIOS centralized video initialization and services behind INT 10h, but applications could still access graphics memory directly when the selected mode and hardware supported it.

🎨 3. GOP: The UEFI Graphics Interface
#

UEFI replaces the legacy video interrupt interface with the Graphics Output Protocol, identified by:

gEfiGraphicsOutputProtocolGuid

GOP is a protocol published by a graphics driver during firmware initialization. Any UEFI application or driver that needs graphics can locate the protocol and call its functions.

Its central structure is compact:

typedef struct {
  UINT64                                  Revision;
  EFI_GRAPHICS_OUTPUT_PROTOCOL_QUERY_MODE QueryMode;
  EFI_GRAPHICS_OUTPUT_PROTOCOL_SET_MODE   SetMode;
  EFI_GRAPHICS_OUTPUT_PROTOCOL_BLT        Blt;
  EFI_GRAPHICS_OUTPUT_PROTOCOL_MODE       *Mode;
} EFI_GRAPHICS_OUTPUT_PROTOCOL;

The structure contains three function pointers and a pointer to the current mode information.

There is no interrupt dispatch, no IVT lookup, and no requirement to switch back to 16-bit real mode.

Where does GOP come from?
#

On a discrete graphics card, GOP is commonly provided by an EFI driver embedded in the card’s PCI Option ROM.

During the DXE (Driver Execution Environment) phase, firmware discovers devices and dispatches the relevant drivers. A graphics driver initializes the display hardware and installs the GOP interface.

Integrated graphics can follow a similar model, but the implementation may be supplied by platform or processor firmware rather than a separate graphics card ROM.

The important point is that GOP is installed by a graphics driver. It is not simply a function built into the motherboard’s traditional BIOS video interrupt handler.

What changes for developers?
#

GOP makes graphics access independent of the old BIOS interrupt convention.

A UEFI application can:

  1. Locate the GOP protocol.
  2. Enumerate available display modes.
  3. Select a resolution.
  4. Draw through the Blt() function.
  5. Access the framebuffer directly when appropriate.

The last option is particularly important. GOP exposes the physical framebuffer address and its size through the current mode structure, allowing software to write pixels without routing every operation through Blt().

💿 4. One Graphics Card ROM Can Contain Two Generations of Firmware
#

An often-overlooked detail is that a graphics card’s Option ROM can contain both Legacy and UEFI firmware images.

The PCI Option ROM format supports multiple images. Each image has a PCIR data structure containing a Code Type field that identifies the image’s intended execution environment.

Two common values are:

Code Type Meaning
0x00 x86 Legacy Option ROM image
0x03 EFI-compatible Option ROM image

The Legacy image contains the traditional VBIOS code. The EFI image contains an EFI driver that can initialize the graphics hardware and provide GOP.

These images use different executable formats and serve different firmware environments. They do not need to depend on one another.

What CSM changes
#

The Compatibility Support Module (CSM) allows UEFI firmware to support legacy BIOS boot behavior.

When CSM is enabled, the firmware can follow the legacy compatibility path and dispatch an appropriate x86 Option ROM image. This allows the traditional VBIOS services, including INT 10h, to remain available.

When CSM is disabled, the firmware uses the native UEFI graphics path. It must have a compatible EFI graphics driver available, either from the graphics card’s Option ROM or another platform-provided source.

In practical terms:

  • CSM enabled: The platform can use the Legacy Option ROM image.
  • CSM disabled: The platform needs a working UEFI graphics driver to initialize the display and install GOP.

This explains a common troubleshooting scenario: an older graphics card works when CSM is enabled but produces no display during a native UEFI boot.

One possible reason is that its Option ROM contains only the Legacy image and lacks a usable EFI image.

A quick diagnostic
#

When investigating an older GPU that fails to display output with CSM disabled, inspect its Option ROM rather than immediately assuming the card is defective.

Dump the ROM and examine its PCIR structures. Look for an image with:

Code Type: 0x03

If no EFI-compatible image exists, the card may lack the firmware support required for native UEFI display initialization.

The presence of an EFI image is not, by itself, proof that the driver will work on every platform. Compatibility, driver initialization, and firmware policy still matter.

🔧 5. GOP’s Three Functions: Query, Set, and Blt
#

GOP exposes three main operations:

Function Purpose Important Parameters
QueryMode() Retrieves information about a supported display mode Mode number and output information
SetMode() Changes the active display mode Mode number
Blt() Transfers blocks of pixels between video memory and a buffer Operation type, coordinates, dimensions, and buffer stride

The Mode pointer is equally important because it exposes information about the current display configuration.

Mode field Meaning
MaxMode Number of supported display modes
Info Information about the current mode
SizeOfInfo Size of the mode information structure
FrameBufferBase Physical base address of the framebuffer
FrameBufferSize Size of the framebuffer in bytes

The following example demonstrates how to locate GOP, enumerate display modes, select one, and fill the screen with red.

EFI_GRAPHICS_OUTPUT_PROTOCOL *Gop;
EFI_STATUS Status;

Status = gBS->LocateProtocol(
                &gEfiGraphicsOutputProtocolGuid,
                NULL,
                (VOID **)&Gop
                );

if (EFI_ERROR(Status) || Gop == NULL) {
  return EFI_NOT_FOUND;
}

// 1. Enumerate available display modes.
for (UINT32 Index = 0;
     Index < Gop->Mode->MaxMode;
     Index++) {

  EFI_GRAPHICS_OUTPUT_MODE_INFORMATION *Info;
  UINTN SizeOfInfo;

  Info = NULL;
  SizeOfInfo = 0;

  Status = Gop->QueryMode(
                  Gop,
                  Index,
                  &SizeOfInfo,
                  &Info
                  );

  if (EFI_ERROR(Status)) {
    continue;
  }

  Print(
    L"[%u] %u x %u\n",
    Index,
    Info->HorizontalResolution,
    Info->VerticalResolution
    );

  FreePool(Info);
}

// 2. Select a display mode.
// Mode 0 is only an example; it is not necessarily the best mode.
Status = Gop->SetMode(Gop, 0);

if (EFI_ERROR(Status)) {
  return Status;
}

// 3. Fill the screen with red.
// EFI_GRAPHICS_OUTPUT_BLT_PIXEL uses BGRA field order.
EFI_GRAPHICS_OUTPUT_BLT_PIXEL Red = {
  0,    // Blue
  0,    // Green
  255,  // Red
  0     // Reserved
};

Status = Gop->Blt(
               Gop,
               &Red,
               EfiBltVideoFill,
               0,
               0,
               0,
               0,
               Gop->Mode->Info->HorizontalResolution,
               Gop->Mode->Info->VerticalResolution,
               0
               );

if (EFI_ERROR(Status)) {
  return Status;
}

The first important operation is LocateProtocol(). If it fails, the application has not obtained a usable GOP interface.

Possible causes include:

  • No compatible graphics driver has installed GOP.
  • The graphics Option ROM’s EFI image is missing or failed to load.
  • The graphics driver has not been dispatched yet.
  • The platform does not expose a GOP instance through the expected handle or protocol database.

In firmware debugging, checking the return status is much more useful than assuming the display hardware itself is broken.

🖌️ 6. Blt: Four Operations for Pixel Transfers
#

UEFI does not provide separate GOP functions for drawing individual pixels, lines, circles, or rectangles.

Instead, it exposes one general-purpose block-transfer function: Blt().

The function supports four operations:

Operation Purpose
EfiBltVideoFill Fills a rectangular area of video memory with one color
EfiBltVideoToBltBuffer Copies pixels from video memory into a memory buffer
EfiBltBufferToVideo Copies pixels from a memory buffer to video memory
EfiBltVideoToVideo Copies a rectangular region within video memory

This design provides a small, standardized interface for common graphics operations.

The BGRA ordering trap
#

One of the most common mistakes in UEFI graphics programming is assuming that EFI_GRAPHICS_OUTPUT_BLT_PIXEL uses RGBA ordering.

Its actual layout is:

typedef struct {
  UINT8 Blue;
  UINT8 Green;
  UINT8 Red;
  UINT8 Reserved;
} EFI_GRAPHICS_OUTPUT_BLT_PIXEL;

Therefore, pure red is:

EFI_GRAPHICS_OUTPUT_BLT_PIXEL Red = {
  0, 0, 255, 0
};

Not:

EFI_GRAPHICS_OUTPUT_BLT_PIXEL Red = {
  255, 0, 0, 0
};

The second version places the value in the Blue field, so the result is blue rather than red.

This is a simple structure-layout issue, not necessarily a graphics driver bug.

Why you should avoid pixel-by-pixel Blt calls
#

Blt() is designed for block transfers, not repeated single-pixel drawing operations.

If an application needs to display a bitmap, a better approach is to prepare the image in a memory buffer and submit it using one EfiBltBufferToVideo operation.

Calling Blt() separately for every pixel creates unnecessary function-call overhead and can make rendering much slower.

For more advanced rendering, direct framebuffer access is usually the next step.

🧱 7. Direct Framebuffer Access: Pay Attention to Stride
#

GOP does more than provide drawing functions. It also exposes the framebuffer’s physical address and size.

The relevant fields are:

Gop->Mode->FrameBufferBase
Gop->Mode->FrameBufferSize

Once the application has selected a display mode, it can use this information to access framebuffer memory directly, subject to the platform’s memory-access requirements.

However, there is an important detail: the number of pixels per scanline is not necessarily equal to the visible horizontal resolution.

The active mode information contains:

Gop->Mode->Info->PixelsPerScanLine

This value describes the actual scanline pitch in pixels.

A common mistake is to calculate a pixel’s address using:

Offset = (Y * HorizontalResolution + X) * BytesPerPixel;

That calculation assumes the physical scanline contains exactly as many pixels as the visible display width.

A safer calculation uses the reported scanline pitch:

Offset = (Y * PixelsPerScanLine + X) * BytesPerPixel;

For example, a display mode might show 1920 visible pixels per row while the framebuffer uses a larger scanline pitch for alignment.

Ignoring that difference can cause diagonal tearing, skewed images, or corrupted rows.

Direct framebuffer access also requires attention to pixel format. GOP mode information can describe different pixel formats, so code should not blindly assume every framebuffer uses the same channel layout.

In short, before writing directly to framebuffer memory, check:

  • FrameBufferBase
  • FrameBufferSize
  • PixelsPerScanLine
  • PixelFormat

These fields determine how the framebuffer should be accessed safely.

⌨️ 8. Who Draws Text in the UEFI Shell?
#

If GOP only transfers pixel blocks, how does the UEFI Shell display characters?

The answer is that text is rendered as graphics.

With CSM disabled, UEFI does not depend on the traditional VGA text-mode memory interface. Instead, firmware uses a graphics console driver to turn characters into pixels.

The relevant interface is Simple Text Output Protocol, commonly accessed through ConOut.

A graphics console driver, typically implemented as GraphicsConsoleDxe, provides the connection between text output and GOP.

Its general process looks like this:

  1. A UEFI application calls a text-output function through ConOut.
  2. The graphics console driver receives the character data.
  3. It looks up the corresponding glyph bitmap in its available font data.
  4. It converts the glyph into pixels.
  5. It uses GOP block transfers to draw those pixels on the display.

The console infrastructure can also involve ConSplitter, which coordinates multiple console devices and output paths.

Why resolution changes affect text sharpness
#

Because characters are rendered as pixel patterns, changing the display resolution can affect how sharp or readable the text appears.

The firmware does not necessarily scale every glyph smoothly to match every resolution. Different modes can produce different results depending on the available font dimensions and rendering behavior.

Why missing characters appear as boxes
#

Localized firmware interfaces need the corresponding font glyphs.

For example, displaying Chinese characters in Setup requires suitable font data to be available to the firmware. Such resources may be packaged in firmware volumes and exposed through HII-related services.

If a glyph is missing, the firmware may display a replacement character, an empty box, or another fallback symbol.

That does not automatically indicate an encoding problem. The font package may simply lack the required glyph.

Even the blinking cursor is drawn
#

A graphical text cursor is also a visual element.

The console can implement cursor blinking by saving or restoring the underlying pixels and drawing the cursor at the appropriate position.

This is why cursor artifacts can sometimes be related to rendering or redraw timing rather than a failure of the graphics hardware.

🧪 9. Five Common GOP Troubleshooting Problems
#

The following issues account for many of the problems developers encounter when working with UEFI display output.

# Symptom Likely Cause How to Investigate
1 Black screen with CSM disabled, but display works with CSM enabled Missing or unusable EFI graphics Option ROM image Dump the ROM and inspect its PCIR Code Type entries
2 LocateProtocol() cannot find GOP Graphics driver has not loaded or failed to initialize Inspect DXE driver-dispatch logs and Option ROM handling
3 Only one or a few display modes are available EDID was not read correctly or the driver exposes limited modes Check the monitor’s EDID and the I2C communication path
4 Direct framebuffer output appears skewed or diagonal Incorrect scanline pitch or pixel-offset calculation Check PixelsPerScanLine and pixel format
5 Red appears blue, or colors are otherwise incorrect BGRA/RGBA channel-order mismatch Inspect the EFI_GRAPHICS_OUTPUT_BLT_PIXEL layout and active pixel format

Understanding the EDID problem
#

The third issue deserves additional attention.

Display modes are commonly determined using EDID (Extended Display Identification Data), which communicates the monitor’s supported resolutions and display capabilities to the graphics hardware.

The data is typically obtained over an I2C-based display communication channel.

If a cable, adapter, KVM switch, or monitor connection prevents EDID from being read correctly, the graphics driver may expose only a conservative fallback mode.

For example, a 4K monitor might appear as 1024x768 during firmware startup.

That does not necessarily mean the GPU cannot drive the display at 4K. The firmware may simply have failed to obtain the monitor’s capability information.

Separate GOP discovery from display-mode problems
#

The first two troubleshooting cases are related, but they are not identical.

If LocateProtocol() fails, the application has not obtained a GOP interface.

If GOP is available but the display is black or stuck at a low resolution, the problem may instead involve mode selection, driver initialization, display detection, or the connection between the GPU and monitor.

Keeping those stages separate makes firmware debugging considerably easier.

🧩 10. From Interrupt Vectors to Discoverable Protocols
#

Returning to the original question: how can UEFI display graphics without INT 10h?

Because the graphics interface is no longer based on BIOS software interrupts.

Legacy firmware exposed video services through INT 10h, with VBIOS providing much of the graphics-specific implementation. UEFI instead relies on a graphics driver that installs GOP as a discoverable protocol.

Applications locate the protocol, query supported modes, change the display configuration, and transfer pixel blocks through Blt(). When appropriate, they can also use the framebuffer directly.

The deeper architectural change extends well beyond graphics. UEFI uses the same general protocol model for many other hardware and firmware services.

Block I/O, Simple File System, PCI I/O, network interfaces, and other components all follow the same broad pattern: a provider publishes an interface, and consumers locate and use it.

That is the mental shift worth remembering when moving from Legacy BIOS development to UEFI.

Legacy BIOS developers think in interrupt vectors and function codes. UEFI developers think in GUIDs, handles, and protocols.

The old approach was to call the BIOS switchboard. The new approach is to locate the interface that provides the service.

Related