SigOps:
i386 PC Text Mode Information



Video Memory Structure

The text mode video screen in the PC is memory-mapped to physical address 0xb0000 on monochrome adapters and 0xb8000 on color adapters. (Our PCs all have color adapters, and most likely any machine you find will too. I merely include the monochrome adapter information for completeness).

You can access a specific physical address in the PC by merely assigning it to a pointer, and then treating the pointer as a reference to an array. Assigning a numeric value to a pointer is just a matter of using a typecast:

char *vidmem = (char *) 0xb8000;

The text mode is 80 columns by 25 rows, with 2 bytes per character that appears on the screen. The first byte is the ASCII value of the character itself, and the second is the attribute byte. 0x07 is white on black, and works fine. You may want to experiment with other colors.



Cursor manipulation

The cursor can be moved. Check out our code snippets resource.