Hi,
Is dynamically mapping of VESA memory to virtual memory reliable?
Has anyone done this in their OS?
Thanks,
Sheena
VESA MEMORY TO VIRTUAL MEMORY
-
- Posts: 16
- Joined: Wed Jan 02, 2008 10:44 pm
- Location: USA
Hi,
I want to think it is reliable, because otherwise my OS wouldn't run
I always map vesa frame buffer to virtual 0xA0000000 for my gui process even if real physical is at 0xD8000000 or 0xD0000000 ( I read this from the vesa mode structure )
I disable the caching using page tables ( CD cache-disable bit ) at both page directory entry and page table entry and upto now, on real hw also, my gui is running fine.
Additionally one might want to configure caching using MTRRs also.
I think even with cache enabled but writethrough cache disabled ( NWT bit ) it should work fine.
PS: I also know that by using page tables on some systems, you can also simulate Vesa 2.0 linear frame buffer even if BIOS only supports Vesa 1.2 by calling vesa fxn5 at page fault handlers.
I want to think it is reliable, because otherwise my OS wouldn't run
I always map vesa frame buffer to virtual 0xA0000000 for my gui process even if real physical is at 0xD8000000 or 0xD0000000 ( I read this from the vesa mode structure )
I disable the caching using page tables ( CD cache-disable bit ) at both page directory entry and page table entry and upto now, on real hw also, my gui is running fine.
Additionally one might want to configure caching using MTRRs also.
I think even with cache enabled but writethrough cache disabled ( NWT bit ) it should work fine.
PS: I also know that by using page tables on some systems, you can also simulate Vesa 2.0 linear frame buffer even if BIOS only supports Vesa 1.2 by calling vesa fxn5 at page fault handlers.
- zaleschiemilgabriel
- Member
- Posts: 232
- Joined: Mon Feb 04, 2008 3:58 am
AFAIK the video memory is just system memory that is copied to the video memory at every refresh interval so you can access it just like any other physical memory (with or without paging). Whether you use identity mapping or not is up to you and both options should work the same. The only requirement is that the virtual address space be correctly mapped to the physical address space of the LFB.
Ummm... no, it's actually memory on the video card.zaleschiemilgabriel wrote:AFAIK the video memory is just system memory that is copied to the video memory at every refresh interval so you can access it just like any other physical memory (with or without paging). Whether you use identity mapping or not is up to you and both options should work the same. The only requirement is that the virtual address space be correctly mapped to the physical address space of the LFB.
Anyways, it is accessed in the same manner as system ram, and the CPU will use the page directory/page tables properly when accessing it so no issues.