<p>For modern GPUs it's commonly stored in VRAM which for discrete GPUs are separate from the CPU memory. This usually means there is a penalty associated with letting the CPU access this as the data typically has to be copied across some bus. Mobile devices tend to use shared RAM for both GPU and CPU.</p>

CC BY-SA 3.0
2016-04-13T10:06:14.970Z
But how does the OS ask the GPU for memory to write to when you plugged in an HDMI port. Do OSes manage their own framebuffer when doing "naive" drawing operations and send the 1920*1080 pixel big framebuffer to the GPU with some arbitrary and common standard that can be implemented or does one need a driver for each GPU type so that one can send a simple text message over HDMI ? How does  a tty or xserver send it's content through HDMI to the screen?
salbeira
CC BY-SA 3.0
2016-04-13T10:19:22.433Z
The video card in a PC will handle encoding VRAM to a video signal, the CPU is never involved in this. For unaccelerated OS's they will keep a system memory based frame buffer and use the CPU to draw into it, and then send regions of it over the PCIE bus to the card (typically 'dirty' regions or just areas of the screen that need updating), so some GPU driver/motherboard driver is required to do this.
PaulHK
CC BY-SA 3.0
2016-04-13T10:34:27.023Z
So implementing this in my very own OS will not really be possible using open and known standards?
salbeira
CC BY-SA 3.0
2016-04-15T06:26:36.063Z
You could have a look here for some more specifics: http://wiki.osdev.org/VGA_Hardware
PaulHK
CC BY-SA 3.0
2016-04-08T06:34:40.257Z
2016-04-08T06:34:40.257Z
PaulHK
<p>In a modern day desktop or mobile computer, you got the CPU, the RAM, the GPU and it's own video RAM. When a modern OS renderes an image to the screen, where is the actual image data for that screen located? (Talking about a default HDMI output port)</p>

<p>Is it within the memory of the OS Kernel in RAM, fetching the rendered image of an onscreen window from the GPU when preparing the next frame?</p>

<p>Is it within the GPUs VRAM, accessed and manipulated by low level CPU instructions?</p>

<p>Is it within the GPUs VRAM, mapped via DMA to the CPUs adress space?</p>

<p>And also, where can I read up on implementing some of these basic access patterns for a custom written science project OS? A friend of mine managed to get the SVGA mode running in assembly, but I guess one can do more.</p>

<memory>
Where is the shown display image actually stored and accessed?
salbeira
# Where is the shown display image actually stored and accessed?

(Asked by: username_0 on 2016-02-07)

In a modern day desktop or mobile computer, you got the CPU, the RAM, the GPU and it's own video RAM. When a modern OS renderes an image to the screen, where is the actual image data for that screen located? (Talking about a default HDMI output port)

Is it within the memory of the OS Kernel in RAM, fetching the rendered image of an onscreen window from the GPU when preparing the next frame?

Is it within the GPUs VRAM, accessed and manipulated by low level CPU instructions?

Is it within the GPUs VRAM, mapped via DMA to the CPUs adress space?

And also, where can I read up on implementing some of these basic access patterns for a custom written science project OS? A friend of mine managed to get the SVGA mode running in assembly, but I guess one can do more.

**Tags:** memory


---

## 1 answers

### Answer by username_1 on 2016-04-08. Score: 4

For modern GPUs it's commonly stored in VRAM which for discrete GPUs are separate from the CPU memory. This usually means there is a penalty associated with letting the CPU access this as the data typically has to be copied across some bus. Mobile devices tend to use shared RAM for both GPU and CPU.

> **Comments:**
> **username_0**: But how does the OS ask the GPU for memory to write to when you plugged in an HDMI port. Do OSes manage their own framebuffer when doing "naive" drawing operations and send the 1920*1080 pixel big framebuffer to the GPU with some arbitrary and common standard that can be implemented or does one need a driver for each GPU type so that one can send a simple text message over HDMI ? How does  a tty or xserver send it's content through HDMI to the screen?  
> **username_1**: The video card in a PC will handle encoding VRAM to a video signal, the CPU is never involved in this. For unaccelerated OS's they will keep a system memory based frame buffer and use the CPU to draw into it, and then send regions of it over the PCIE bus to the card (typically 'dirty' regions or just areas of the screen that need updating), so some GPU driver/motherboard driver is required to do this.  
> **username_0**: So implementing this in my very own OS will not really be possible using open and known standards?  
> **username_1**: You could have a look here for some more specifics: http://wiki.osdev.org/VGA_Hardware  

---

