Use more screen than 80x25, how ?

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.
Post Reply
yee1
Member
Member
Posts: 42
Joined: Sun Feb 10, 2013 4:02 pm

Use more screen than 80x25, how ?

Post by yee1 »

Hey,
Currently I am using screen by 8000h with such descriptor:

Code: Select all

...

descriptor struc
lim dw 0
bas1 dw 0
bas2 db 0
attr1 db 0
attr2 db 0
base3 db 0
descriptor ends

...

screengdt descriptor <4095, 8000h, 0bh, 92h, 0, 0>

How to use full resolution of screen like BIOS uses when enter it after pc is being powered on ?
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: Use more screen than 80x25, how ?

Post by Combuster »

"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 ]
yee1
Member
Member
Posts: 42
Joined: Sun Feb 10, 2013 4:02 pm

Re: Use more screen than 80x25, how ?

Post by yee1 »

Combuster wrote:FAQ :roll:

In connection with http://wiki.osdev.org/How_do_I_set_a_graphics_mode
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 ;)
User avatar
eino
Member
Member
Posts: 49
Joined: Fri Sep 16, 2011 10:00 am
Location: Finland

Re: Use more screen than 80x25, how ?

Post by eino »

You can set the videomode before switching to protected mode
I'm Eino Tuominen from Finland, a web software dev learning low level stuff and reading / trying out kernel dev
yee1
Member
Member
Posts: 42
Joined: Sun Feb 10, 2013 4:02 pm

Re: Use more screen than 80x25, how ?

Post by yee1 »

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 ?

Thank you for answering :)
madanra
Member
Member
Posts: 149
Joined: Mon Sep 07, 2009 12:01 pm

Re: Use more screen than 80x25, how ?

Post by madanra »

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.
yee1
Member
Member
Posts: 42
Joined: Sun Feb 10, 2013 4:02 pm

Re: Use more screen than 80x25, how ?

Post by yee1 »

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 ?
User avatar
neon
Member
Member
Posts: 1567
Joined: Sun Feb 18, 2007 7:28 pm
Contact:

Re: Use more screen than 80x25, how ?

Post by neon »

Hello,

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();}
Post Reply