I want to switch to 1024*768*24 or *32. I understand the code from http://www.osdev.org/wiki/Drawing_In_Protected_Mode , is the address where I would write memory the variable dword physbase? Is it in the form segment:offset? What do I do with it?
Thanks.
Question about VESA addressing
So you have a vm86 mode setup or did you change the graphics mode back in realmode (via a bootloader or such)
First thing you need to do is change the video mode to whatever mode you wish to use.
You'll need vesa 2.0 for that unless you plan of using a hw driver (unlikely) Also would suggest using the Linear Frame Buffer
So using vesa you need to get the vbe data structure for that video mode.
In that structure will give you the base of the video memory...
From them you just write you bytes.
-Rich
First thing you need to do is change the video mode to whatever mode you wish to use.
You'll need vesa 2.0 for that unless you plan of using a hw driver (unlikely) Also would suggest using the Linear Frame Buffer
So using vesa you need to get the vbe data structure for that video mode.
In that structure will give you the base of the video memory...
From them you just write you bytes.
-Rich
I saw in the tutorial how to get the information. I'll do this in real mode as I load the OS because the console will be implemented in 1024*768 for more space. I just don't know how to address this. Should I load the high 2 bytes into es or something and offset it by the low two bytes. What happens when the length of the LFB is more than 64K? How do I address this? To do this in protected mode, do I just set up a segment descriptor in the GDT with the base at the base of the LFB?
Thanks.
Thanks.
I don't know if its possible to access the LFB from real mode, for all I know it could be at the 2gb mark or something like that. But remember in protected mode you have access to the whole 4gb address space, once you set up the segments descriptors you more than likely won't have to mess with them again. That being said you could just load the address of the the LFB into a variable and access it like an array. Example (in C)
Code: Select all
DWORD *lfb = address_of_lfb;
lfb[0] = 1; // access first pixel in 32 bit mode.
How would I address the areas above 64K since the pointer is a dword (16 bits for segment and offset)? 1024*768*24 is 3 megabytes. Also, how would I set up the segment (a level 0 as a data segment with read and write? would I call the function for VBE info and use the address returned as the data for the segment when I make the segment table?)