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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
Use Virtual 8086 Mode. The most common good solution for protected mode. This way you can run the BIOS from a virtual machine style environment, thus maintaining control over the process. Virtual 8086 mode is however not available from Long Mode.
Correct me if i am wrong... the only method to drawing via BIOS is to do it via VIRTUAL MODE? ehh Making small project and if yes then it will make some mess in my current code
eino wrote:You can set the videomode before switching to protected mode
So you mean that I can use videomode in protected mode - I need only switch it ON before going to protected mode (in real mode) and no need to back to real mode from protected / ude virutal mode, is it right ?
Yes - typically you would switch to a video mode with a linear frame buffer (LFB) using the BIOS while still in real mode, and then switch to protected mode (the video mode will stay the same). You can then write to the LFB the same way you write to any other memory.
madanra wrote:Yes - typically you would switch to a video mode with a linear frame buffer (LFB) using the BIOS while still in real mode, and then switch to protected mode (the video mode will stay the same). You can then write to the LFB the same way you write to any other memory.
Thank you, but how about getting resolution of user's monitor ? What if I want to draw an animal and there are to monitors like 600x300 and 1377x766. What then ?
With regards to supporting multiple monitors or obtaining monitor information or control, either use the VBE DDC extensions or, if writing a custom driver for a card that supports the DDC or I²C interface protocols, the card would provide a set of control registers that software can use to use these protocols.
Getting the resolution of the monitor is obtained by either using the associative VBE service or, if writing own driver, following the specification as to the requirements for what to configure.
If you set the video mode at the start, never to change it later with the purpose of avoiding any video interface (not recommended) you will just have to assume a video mode resolution will always be the same, and, of course, not worry about supporting multiple monitors or getting video information.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}