Page 1 of 1
VESA MEMORY TO VIRTUAL MEMORY
Posted: Tue Feb 05, 2008 8:09 am
by sheena9877
Hi,
Is dynamically mapping of VESA memory to virtual memory reliable?
Has anyone done this in their OS?
Thanks,
Sheena
Posted: Tue Feb 05, 2008 8:22 am
by Cemre
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.
Posted: Tue Feb 05, 2008 8:36 am
by AJ
Hi,
Another 'yes' here - I have a 64 bit OS and VESA RAM is mapped somewhere above 0xFFFFF08000000000 (canonical on a 48 virtual bit system) and the VESA LFB works perfectly. At present, I have experienced no problems with caching but then, at present my OS doesn't do a lot!
Cheers,
Adam
Posted: Thu Feb 07, 2008 5:06 am
by zaleschiemilgabriel
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.
Posted: Thu Feb 07, 2008 5:57 am
by Ready4Dis
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.
Ummm... no, it's actually memory on the video card.
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.
Posted: Thu Feb 07, 2008 2:35 pm
by sheena9877
Thank you guys.
Sheena