2

I started programming in 32-bit protected mode. Im using it for high graph resolutions like 1280x1024 256 colors:

mov ax,0x4F02
mov bx,0x107
int 0x10

but I have a problem with size of video memory (VRAM) because after switching to this resolution I need 1,280 * 1,024 = 1,310,720 bytes of VRAM but standard BIOS VRAM is only 131,072 bytes wide (address range: 0xa0000-0xbffff). Is there any possible way how to extend BIOS VRAM or to set mine custom base address of VRAM ? (I want to bypass programming my own driver.)

Segy
  • 213
  • 2
  • 12
  • 3
    Use a linear framebuffer mode. Possible [duplicate](https://stackoverflow.com/questions/37576407/how-to-make-a-vesa-linear-frame-buffer-in-real-mode-to-use-it-after-in-protected) – Jester Jun 29 '18 at 11:52
  • You might check out http://osdev.org - They have a variety of low level articles dealing with VGA/VESA memory access and frame buffer creation. – David Hoelzer Jun 29 '18 at 13:59

1 Answers1

4

For protected mode, the linear framebuffer is the easiest method. But if you want to map it in the real mode style:

The video memory is divided into 64k pages. In graphics modes, these will sit in the range of 0xA0000-0xAFFFF; you don't actually get 128k contiguous at one time. To change which page is currently mapped, call INT 10h with AX = 4F05h, BX = 0, and DX = the page number. Page 0 starts at the top-left of the screen (by default), page 1 is the memory right after the first 64k, etc.

So for example, with the mode you specify: On page zero, 0xA0000 will be the top-left corner. If you write to 0xAFFFF, you'll set pixels somewhere in the middle of the screen. Call INT 10h, AX=4F05h/BX=0000h/DX=0001h, then write to 0xA0000 again. You'll change the pixels immediately to the right of what previously showed as 0xAFFFF.

jmccracken
  • 53
  • 8