Modern GPU programming

Peter Stuge stuge-linuxbios at
Sat Sep 21 01:51:01 CEST 2002


I found this on the sourceforge page about xbox-linux.  It briefly discusses
the capabilities of a modern graphics processing unit, specifically the
nVidia model found in Xboxes.  It also shows how to set up 80x25 text mode
on these chips.  This should be useful information for the LinuxBIOS project
as well.

Basically it contains this code:

void crtcout(unsigned char reg, unsigned char data) {
	/* a single 16 bit access might also work */
	_asm {
		mov al, reg
		mov ebx, 0xFD6013d4
		mov [ebx], al
		mov al, data
		mov 1[ebx], al

void settextmode() {
	crtcout(0x00, 0x5F);
	crtcout(0x01, 0x4F);
	crtcout(0x04, 0x54);
	crtcout(0x05, 0x80);
	crtcout(0x07, 0x1F);
	crtcout(0x10, 0x9C);
	crtcout(0x17, 0xA3);

crtcout() uses MMIO to access the CRTC registers since legacy IO is disabled
in the Xbox.  The MMIO memory region is programmed into the GPU by the BIOS.
(0xFD000000 with vanilla Xbox kernel)  However, the offset of the CRTC in
this memory region is "magic" and probably only known by the chipset
manufacturer, unless reverse engineered.  The web page also mentions the
need to set up a font on that particular hardware, however most PC graphics
cards should already have a font onboard, right?

Anyway, I thought this might be of interest to members of this list.


More information about the coreboot mailing list