vga memory in Long Mode

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
jcmatias
Posts: 11
Joined: Mon Nov 08, 2004 12:00 am
Location: Ribeirao Preto SP Brasil

vga memory in Long Mode

Post by jcmatias »

How to acess video memory in Long Mode using 1024x768 32 bits colors resolution.
There are a 64KB bank limitation ?
How to perform Bank switch ?
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: vga memory in Long Mode

Post by AJ »

Hi,

Firstly, this isn't really VGA if you are using 1024x768x32.

Your best bet is to switch the mode to something that supports a LFB before you enter long mode.

An alternative is to use the VBE PMode interface, but a) you cannot rely on this being present (and have to handle the case where it is not) and b) I'm not sure if it works in compatibility mode.

Of course, you can't rely on a LFB-compatible mode being present either, so you probably still need a basic VGA driver.

Cheers,
Adam
User avatar
djsilence
Member
Member
Posts: 70
Joined: Wed Oct 01, 2008 11:18 am
Location: Ukraine, Kiev
Contact:

Re: vga memory in Long Mode

Post by djsilence »

You have to get VBEModeInfo (read VBE 3.0 Spec from vesa.org). One of the fields is PhysBasePtr - this is pointer to LFB. But your mode number have to be ORed with 0x4000 (if you mode number is 0x11B in Bank switching, so in LFB - 0x411B) and using it you can write dirrectly to the video memory area without bank switching.
Don't think a ****, but in ukrainian schools English is TOO BAD!
Post Reply