VESA MEMORY TO VIRTUAL MEMORY

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
sheena9877
Posts: 16
Joined: Wed Jan 02, 2008 10:44 pm
Location: USA

VESA MEMORY TO VIRTUAL MEMORY

Post by sheena9877 »

Hi,

Is dynamically mapping of VESA memory to virtual memory reliable?
Has anyone done this in their OS?

Thanks,
Sheena
Cemre
Member
Member
Posts: 31
Joined: Fri Nov 09, 2007 5:25 am

Post 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.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post 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
User avatar
zaleschiemilgabriel
Member
Member
Posts: 232
Joined: Mon Feb 04, 2008 3:58 am

Post 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.
Ready4Dis
Member
Member
Posts: 571
Joined: Sat Nov 18, 2006 9:11 am

Post 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.
sheena9877
Posts: 16
Joined: Wed Jan 02, 2008 10:44 pm
Location: USA

Post by sheena9877 »

Thank you guys.

Sheena
Post Reply