linear frame buffer
linear frame buffer
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...
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:linear frame buffer
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
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
Re:linear frame buffer
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.
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.
Re:linear frame buffer
must I have to map lfb addr to another? Or can I use it like just:
*ptrLFB = (byte) Color;
?
*ptrLFB = (byte) Color;
?
Re:linear frame buffer
..
Last edited by Perica on Tue Dec 05, 2006 9:25 pm, edited 1 time in total.
Re:linear frame buffer
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...
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...
Re:linear frame buffer
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.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.
Re:linear frame buffer
*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.
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.