Mapping video card memory to access via Intel compatible x86 processor

Asked

Viewed 881 times

8

Thinking of Intel compatible x86 computers, without considering the facilities provided by modern operating systems, anyone who wants to draw/write something on the computer screen can access some known addresses, such as B800:0000 (linear B8000h), A000:0000 (linear A0000h) etc, and through them can write characters or pixels on the screen.

However, thinking only of pixels, the A0000h address maps a very small region of video memory (128k), far from the capacity of current graphics cards.

In addition, using only the basic routines provided by the VGA and SVGA standard, it is not possible to change the resolution to, for example, 1366 x 768 (at least I could not identify how).

The question is, suppose I’m already running in 32 or 64 bit protected mode, in the ring0, how to map a region of video memory so that the processor can access it, and how to set up the graphics card for resolutions greater than 800 x 600?

With respect to memory mapping, this should be done in some TEM input?

I know Linux is open source, but the code is big, and I don’t have much experience with it. If the answer involves the Linux source code, I would ask, please, to indicate the version, the file and the corresponding lines.

  • Using framebuffer would be an option for you?

  • Yes, it would be a valid solution, as long as I could map a large region of the graphics card’s memory. For example, for a 256MB card, it would be nice to be able to access these 256MB. Worst-case scenario, I’d at least like to be able to map enough memory to make a double buffer: at a resolution of 1366x768 @ 32bpp, I would map at least (1366 768 4) 2 bytes.

  • 1

    I personally only wrote to the framebuffer so I can’t answer the question, but I found two interesting articles that might help: http://www.tldp.org/HOWTO/Framebuffer-HOWTO/ and https://www.kernel.org/doc/Documentation/fb/framebuffer.txt If you find an answer yourself you can answer your question (this is valid and encouraged by stackexchange).

  • 1

    Oops, thanks Pablo! I’ll analyze the links now :) I’m in other projects, and this direct access to framebuffer does not have high priority... If I can do something, you can let me answer ;)

1 answer

1

To utilize the memory card are not these addresses, this process involves direct access to the video card through "hardware interruptions", you would call on your Assembly:

int 0x00 ; o número passado é um código interno para uma função de hardware

and this command for example would pass data from RAM to Video Card or vice versa or call internal commands from it.

"honestly do not know how this process works specifically due to the manufacturer drivers, libraries like Directx, DXGI and Opengl do all the work."

  • In fact software interruptions are defined by the BIOS during boot. Each operating system has the freedom to then change its code. For example, the int 10h, which is the interruption to access video services on DOS (and other operating systems that depend 100% on BIOS - see here). Question addresses are used for direct access to memory in basic video modes, such as 320x240 @8bpp, or in text mode. What I’m looking for is more in line with Pablo’s comment.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.