ATI Rage 128

From OSDev Wiki
Revision as of 11:04, 22 September 2025 by Jackscott (talk | contribs) (→‎See Also: Added link to QEMU code for ATI emulation.)
Jump to navigation Jump to search

This article is a stub! This page or section is a stub. You can help the wiki by accurately contributing to it.

The ATI Rage 128 is a series of graphics cards from the late 1990s. It's noteworthy as a candidate for device driver development as the Rage 128 Pro is emulated in QEMU.

Models sharing this register programming interface include:

  • ATI Rage 128 VR
  • ATI Rage 128 GL
  • ATI Rage 128 Pro
  • ATI Rage 128 Ultra
  • ATI Rage Fury MAXX

It has the usual three compatibility programming modes, which won't be discussed further here:

Apart from that, it has its own programming mode exposed on the PCI/AGP bus. This is what the rest of this article will focus on.

We will focus on the 2D framebuffer and 2D drawing engine.

Getting a 2D Framebuffer

Prerequisites: PCI Bus Probing, knowledge of VGA signal timing.

Basically, you want to do the following things:

  1. Detect the card via PCI and read BAR0 (framebuffer memory) and BAR2 (memory mapped I/O). BAR1 can be ignored as it just provides a subset of BAR2.
  2. (Optional) enable AGP speed
  3. If using paging, map the MMIO and framebuffer into accessible address space.
  4. Enable the accelerator CRTC (rather than VGA CRTC).
  5. Set the CRTC with VGA timings that will work.
  6. Start drawing pixels

CRTC Setup

For a 1024x768x32 screen:

// Set horizontal total width and display width.
regs[CRTC_H_TOTAL_DISP]=0xD0|(0x7F<<16);
// Set horizontal sync start, width, and polarity.
regs[CRTC_H_SYNC_STRT_WID]=(0x82<<2)|(0x31<<16)|(1<<23);
// Set vertical total width and display width.
regs[CRTC_V_TOTAL_DISP]=0x325|(0x2FF<<16);
// Set vertical sync start, width, and polarity.
regs[CRTC_V_SYNC_STRT_WID]=(0x302)|(0x26<<16)|(1<<23);
// Set number of bytes per line.
regs[CRTC_PITCH]=1024*4;
// Enable accelerator CRTC, switch off VGA CRTC, set 32bpp mode.
regs[CRTC_GEN_CTRL]=(6<<8)|(1<<24)|(1<<25);

These values are (mostly) from page E-8 of the Rage Pro (NOT 128 Pro) programmer's guide, but corrected for the newer 128 hardware. Make your own on the Video Signals And Timing page.

These CRTC values work in QEMU but have not (yet) been tested on real hardware.

See Also

Retrieved from "https://wiki.osdev.org/index.php?title=ATI_Rage_128&oldid=29681"