OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 25, 2024 2:50 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: linear frame buffer
PostPosted: Thu Jan 15, 2004 2:48 pm 
How can I use linear frame buffer?(I read vbe3 stuff, but I dont understand how can I use it (my poor English)). Is that the video area to use or what? If some one give a simple example about it Ill be so glad... Thanks...


Top
  
 
 Post subject: Re:linear frame buffer
PostPosted: Thu Jan 15, 2004 3:39 pm 
Offline
Member
Member
User avatar

Joined: Wed Oct 18, 2006 2:31 am
Posts: 5964
Location: In a galaxy, far, far away
actually, yes: the Linear Frame Buffer is one contiguous memory area that maps your video memory. Unlike what happens with conventionnal SVGA (where you had only a 64KB window at 0xA0000.. 0xAFFFF) to access up to 4MB of VRAM, the LFB maps all your video ram, usually at high memory addresses.

What you have to do is call a VBE BIOS interrupt with the requested mode and one bit of the mode says "Enable VBE please", which should be 0x4000, but i'm unsure, so better check it ;)
Once this is done, the BIOS will return you the physical address of the LFB, which you usually cannot use in real mode (for it is beyond your address space), but that you can nicely access or map through paging once in protected mode (unreal mode can access it too)

Hope it helps. Je peux le dire en Fran?ais, aussi, si ?a aide ;-p

_________________
Image May the source be with you.


Top
 Profile  
 
 Post subject: Re:linear frame buffer
PostPosted: Fri Jan 16, 2004 1:43 am 
the desired vbe mode | 0x4000 is for using this mode and enabling the linear framebuffer. [nods to pype]

The location of the linear framebuffer is located in the vbe mode info structure returned by VESA bios upon request. One has to do some providing of buffers and some copying. Usually one takes the adress and maps it to another convenient region. I 've got biiig trouble to map the adress, bochs VBE bios (VGA_LGPL_LATEST) passes. It does no good things to me to map from 0xe000 at a size of 0xbffff to somewhere else. writing there simply overwrites kernel code. *lol* Bad paging settings of me these are...

@pype --> Ca gaze? (merde est que je ne trouve pas la cedille a un keyboard avec du layout allemagne.) Ici, il fait du soleil et de l'air froid *brrr* mais on dit: c'est la vie.


Top
  
 
 Post subject: Re:linear frame buffer
PostPosted: Fri Jan 16, 2004 6:57 am 
must I have to map lfb addr to another? Or can I use it like just:
*ptrLFB = (byte) Color;
?


Top
  
 
 Post subject: Re:linear frame buffer
PostPosted: Fri Jan 16, 2004 7:08 am 
Offline
Member
Member

Joined: Sat Nov 25, 2006 12:50 am
Posts: 454
..


Last edited by Perica on Tue Dec 05, 2006 9:25 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re:linear frame buffer
PostPosted: Fri Jan 16, 2004 7:10 am 
well: you can't use the lfb adress directly except you have 4 gb ram installed in your system. You need to create ( in example of paging ) a representation of the delivered PHYSICAL adress in the virtual adress space, be it 1:1 be it 1:n.

say you find following linear frame buffer adress in your mode info struct after querying the vesa bios: 0xe4000000
you have 512 mb on board.

you can't access this adress, for it is out of reach. But you have some pagedirectories: you map the physcal adress directly (poor method, I do it, it doesn't work as expected under certain circumstances) to its virtual equivalent: 0xe4000000 phys = 0xe4000000 virtual. It has drawbacks but it works as an interims experience.

then you can take this adress and say *vga++=color;

hope this helps. I am not an expert, just have som eexperience with this kind of stuff - oh but beware of the ghosts I ve summonded, seldom I get rid of them...


Top
  
 
 Post subject: Re:linear frame buffer
PostPosted: Sat Jan 17, 2004 4:13 pm 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
BI lazy wrote:
well: you can't use the lfb adress directly except you have 4 gb ram installed in your system. You need to create ( in example of paging ) a representation of the delivered PHYSICAL adress in the virtual adress space, be it 1:1 be it 1:n.

say you find following linear frame buffer adress in your mode info struct after querying the vesa bios: 0xe4000000
you have 512 mb on board.

you can't access this adress, for it is out of reach. But you have some pagedirectories: you map the physcal adress directly (poor method, I do it, it doesn't work as expected under certain circumstances) to its virtual equivalent: 0xe4000000 phys = 0xe4000000 virtual. It has drawbacks but it works as an interims experience.


Of course you can! As long as you use a segment that gives a window on that place in memory, it works. That means, if you make a segment with base=0xe4000000 then you can access it in that segment as it was at 0x0. If you make a flat memory layout, you can access memory between 0x0 and 0x20000000 and access the frame buffer between 0xe4000000 and on. No problem to that, whatsoever.


Top
 Profile  
 
 Post subject: Re:linear frame buffer
PostPosted: Sun Jan 18, 2004 4:25 am 
*shrugs* Didn't try that out yet, so I didn't recommend it.

Well,but you say, what I say, one has to do something to the adress of the linear framebuffer prior to being able to access it, eh? Giving it a segment descriptor or mapping it into adress space - to make it *present* in adress space.

Thank's for correcting anyway.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: DotBot [Bot], Google [Bot] and 213 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group