Mail Archives: djgpp/1997/08/19/19:06:31
Sampo Niskanen wrote:
>
> How can I make a selector to access the memory of a linear framebuffer
> (VESA VBE 2.0, __dpmi_set_selector doesn't work) and how can I write in
> it? When I try to write to it (with a selector which can access all 4GB
> of memory), it always segfaults. Is there something else to do than
> just to set a (vesa) videomode with bit 14 set and to check the position
> of the framebuffer to get a linear framebuffer?
>
> --
> __________________________________________________
> /____\ Sampo Niskanen <=> sampo AT compart DOT fi \
> \ http://www.compart.fi/~sampo \
> \ ________________________________________\___
> \___/___________________________________________/
<begin code-dump>
// User linear frame buffering.
__dpmi_meminfo memInfo;
memInfo.address = (int)ModeInfo.PhysBasePtr;
memInfo.size = (ModeInfo.XResolution * ModeInfo.YResolution *
ModeInfo.BitsPerPixel) / 8;
if(__dpmi_physical_address_mapping(&memInfo)) return false;
VideoSelector = __dpmi_allocate_ldt_descriptors(1);
if(VideoSelector == -1) return false;
__dpmi_set_segment_base_address(VideoSelector, memInfo.address);
__dpmi_set_segment_limit(VideoSelector, memInfo.size | 0xfff);
...
// write a pixel using the new selector in the upper-left corner
_farpokeb(VideoSelector, 0, color);
<end code-dump>
--
Jeremiah Zanin
Email: strider7 AT unm DOT edu
Webpage: http://www.unm.edu/~strider7
- Raw text -