Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Mode attributes bit 0 (0x1) is set, so it's supported by hardware
Mode attributes bit 7 (0x80) is set, so linear framebuffer is supported
Memory model is 0x6, so direct color model
Then, when setting the mode, I make sure to set the bit 14 (0x4000) to enable a flat framebuffer.
This works in VirtualBox and VMWare, but when running in Parallels Desktop, only the top 20-or-so lines of pixels are displayed on screen. Did I forget to check anything other than that?
Dont forget that pixel width can be different (!= 4).
Thats why I filter all bpp's != 32 bit
EDIT: Check this list:
0: mode supported if set
1: optional information available if set
2: BIOS output supported if set
3: set if color, clear if monochrome
4: set if graphics mode, clear if text mode
5: (VBE2) non-VGA mode
6: (VBE2) No bank swiotching supported
7: (VBE2) Linear framebuffer mode supported
Last edited by Ch4ozz on Sun Aug 21, 2016 12:38 pm, edited 1 time in total.
thanks for your help. Why do you set the video mode with command 0x4F01? Shouldn't that be 0x4F02? Setting with 0x4F01 doesn't work at all for me...
I also tried putting the address in CX instead of BX, but still have the same issue :/ My implementation looks like this:
Greets
Dont worry, Im also using 0x4F02 to set the video mode, but I crawl all possible modes to find the best one and to avoid memcpying it all the time I just save the mode and query the saved id info again
Edited the post above and added the 4 lines to switch mode too now
Okay I've now found the difference between Parallels Desktop and VirtualBox...
In the mode attribute field, Parallels has bit 5 set for each video mode that is returned. Specification says this about this:
VBE 2.0 specification wrote:Bit D5 is used to indicate if the mode is compatible with the VGA hardware registers and I/O ports. If
this bit is set, then the mode is NOT VGA compatible and no assumptions should be made about the
availability of any VGA registers. If clear, then the standard VGA I/O ports and frame buffer address
defined in WinASegment and/or WinBSegment can be assumed.
There's no mode without bit 5 that I could use instead.. Anyone know if this issue could be related to that? I'd assume that all the VBE stuff should work normally even though not VGA-compatible..
EDIT: hmm I just noticed that, in addition, the lfb address value is returned with zero, even though the set-video call was successful. :/
Ch4ozz: you set bit 14 (0x4000) when calling VBE function 0x4F01. That works on Bochs, QEMU and VirtualBox, but it triple-faults my real laptop. I've done the same mistake long ago and it took me a while to discover this small bug. The numbers you pass to function 0x4F01 shouldn't have any bits set other that the plain mode number, from the array returned by function 0x4F00.
Just saying, in case you're not aware that this breaks compatibility on some HW.
You know your OS is advanced when you stop using the Intel programming guide as a reference.
omarrx024 wrote:Ch4ozz: you set bit 14 (0x4000) when calling VBE function 0x4F01. That works on Bochs, QEMU and VirtualBox, but it triple-faults my real laptop. I've done the same mistake long ago and it took me a while to discover this small bug. The numbers you pass to function 0x4F01 shouldn't have any bits set other that the plain mode number, from the array returned by function 0x4F00.
Just saying, in case you're not aware that this breaks compatibility on some HW.
Huh okay, thanks though.
It actually works on my tested laptop (Lenovo T400)
Gonna remove it then
max wrote:Okay I've now found the difference between Parallels Desktop and VirtualBox...
In the mode attribute field, Parallels has bit 5 set for each video mode that is returned. Specification says this about this:
VBE 2.0 specification wrote:Bit D5 is used to indicate if the mode is compatible with the VGA hardware registers and I/O ports. If
this bit is set, then the mode is NOT VGA compatible and no assumptions should be made about the
availability of any VGA registers. If clear, then the standard VGA I/O ports and frame buffer address
defined in WinASegment and/or WinBSegment can be assumed.
There's no mode without bit 5 that I could use instead.. Anyone know if this issue could be related to that? I'd assume that all the VBE stuff should work normally even though not VGA-compatible..
EDIT: hmm I just noticed that, in addition, the lfb address value is returned with zero, even though the set-video call was successful. :/