I've been writing an OS (my first) for about 6 weeks now and am having a problem getting the 32bit address of the LFB using VESA function 4F01h. Basically, before entering protected mode I use function 4F00h to get the list of supported modes and then query each mode number with function 4F01h to find the one closest to 1024x768x32. My problem is that the 4 bytes that should contain the LFB address are always 0x00000000. I've tried this on 2 computers which support VBE3 and VMWare which supports VBE2, according to the 'version' word found in function 4F00h. I've also checked the 'attributes' word within function 4F01h which indicates support for a LFB (bit 7 is set to 1) according to the VBE2.0 documentation. Lastly, I've tried setting bit 14 to 1 in the mode number before switching to the mode via function 4F02h and then rechecking the mode information to see if the LFB address has appeared.
The video cards I'm using were all manufactured within the past few years so I'm assuming a LFB must be supported in some form or another, especially given the 'attributes' field indicating support on all of them. Is there a way to explicitly set a LFB address assuming its supported? Do I need to initialize something first? I feel as though I've missed something basic. My apologies if this problem is common and has been answered already, I haven't been able to find anything.
Linear FrameBuffer Issue
Re: Linear FrameBuffer Issue
Are you sure you've defined your ModeInfoBlock correctly? It's a rather big structure, so it's easy to miss something in it.
Re: Linear FrameBuffer Issue
Well I certainly feel stupid now. Going back through my code and re-checking the value of the di register for the 10th time, I realized I was 1 byte short (I just keep adding/incrementing di as I read the fields I'm interesting in). Because my LFB is at 0xD0000000 that one byte made a big difference.
Thanks -m32
Thanks -m32
Re: Linear FrameBuffer Issue
Happens to everyone