how to use vga in protected mode?

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.
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: how to use vga in protected mode?

Post by Karlosoft »

ehm i've only now seen your answers, because i was on holiday!!! So i must use the vga-port to change the screen-resolution without using real mode?
User avatar
lukem95
Member
Member
Posts: 536
Joined: Fri Aug 03, 2007 6:03 am
Location: Cambridge, UK

Re: how to use vga in protected mode?

Post by lukem95 »

yes... it's been said many times on this forum. use the wiki
~ Lukem95 [ Cake ]
Release: 0.08b
Image
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: how to use vga in protected mode?

Post by Karlosoft »

Yes but i've some problems with English... i can't read other topics, i'll be crazy :)
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: how to use vga in protected mode?

Post by Karlosoft »

Karlosoft wrote:i'll be crazy
ehm i forgot the come of become in my keyboard :D! sorry :)
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: how to use vga in protected mode?

Post by Combuster »

Having a good knowledge of english is a pre. Just keep practicing until you are crazy, like the rest of us :twisted:
"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 ]
MichaelPetch
Member
Member
Posts: 799
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re:

Post by MichaelPetch »

crbenesch wrote: In my OS, I drop out of PMode, use BIOS and go right back, after having it do the function to get a linear framebuffer and the video mode info. Its really pretty easy, the whole code fits into 128 bytes of assembled code. I've attached the source file here. A few pointers though:

[snip]

In other words, youll have to tweak it to fit your OS design, but it does what you want.
On Stackoverflow.com (SO) we ended up having a question regarding your VESA code. As you mentioned you'd have to fit it into your OS design. The SO question was related to Multiboot code calling your VESA driver. As an addendum to your code, I answered with a variation on your code with a workable Multiboot 32-bit kernel.
User avatar
Schol-R-LEA
Member
Member
Posts: 1925
Joined: Fri Oct 27, 2006 9:42 am
Location: Athens, GA, USA

Re: Re:

Post by Schol-R-LEA »

MichaelPetch wrote:
crbenesch wrote: In my OS, I drop out of PMode, use BIOS and go right back, after having it do the function to get a linear framebuffer and the video mode info. Its really pretty easy, the whole code fits into 128 bytes of assembled code. I've attached the source file here. A few pointers though:

[snip]

In other words, youll have to tweak it to fit your OS design, but it does what you want.
On Stackoverflow.com (SO) we ended up having a question regarding your VESA code. As you mentioned you'd have to fit it into your OS design. The SO question was related to Multiboot code calling your VESA driver. As an addendum to your code, I answered with a variation on your code with a workable Multiboot 32-bit kernel.
<snark mode="petty and vindictive">
Does Sewage Overflow discourage users from checking the dates before replying?
</snark>

On a more serious note, a lot of this is in the OSDev wiki, as already stated. Still, any additional sources of information, I guess, and better late than never...
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
WaterOS
Member
Member
Posts: 25
Joined: Mon Jan 16, 2017 3:39 pm

Re: how to use vga in protected mode?

Post by WaterOS »

VGA is everywhere these days...
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: how to use vga in protected mode?

Post by dozniak »

WaterOS wrote:VGA is everywhere these days...
I'd say VGA is pretty much nowhere these days...
Learn to read.
User avatar
Agola
Member
Member
Posts: 155
Joined: Sun Nov 20, 2016 7:26 am
Location: Somewhere

Re: how to use vga in protected mode?

Post by Agola »

Using VGA in protected mode is easy, you need to write VGA registers directly, because you can't use BIOS interrupts in protected mode, assume you know :|
http://wiki.osdev.org/VGA_Hardware has a great reference for registers, and dumps for various VGA modes.

http://files.osdev.org/mirrors/geezer/o ... cs/modes.c has example codes and register dumps also.

After you set the mode, you can use VGA memory to set pixels.

If you want to use higher resolutions, you will need to write drivers for specific graphic card. You can use VBE also, but it needs BIOS interrupts that doesn't available in protected mode. VBE 3.0 has a Protected Mode Interface can be searched with "PMID" keyword, but support on graphic cards is plain bad. You can write a Virtual 8086 monitor to execute BIOS interrupts, or you can use a 8086 emulator and redirect virtual port in/outs to real hardware. (Look at http://wiki.osdev.org/Drawing_In_Protected_Mode)
Keyboard not found!

Press F1 to run setup.
Press F2 to continue.
MichaelPetch
Member
Member
Posts: 799
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Re:

Post by MichaelPetch »

Schol-R-LEA wrote: <snark mode="petty and vindictive">
Does Sewage Overflow discourage users from checking the dates before replying?
</snark>

On a more serious note, a lot of this is in the OSDev wiki, as already stated. Still, any additional sources of information, I guess, and better late than never...
Although you were being *snarky*, I was well aware that this thread was many years old. I'm not the one who dug up this code from this forum and then asked a question about it on Stackoverflow. One might ask the question - If this Forum is so good why don't people actually ask questions here? Maybe because responses like yours are a problem? (whether being funny or not).

I provided a link to the SO question for anyone else who stumbles on this thread. Clearly people are reading it years later.

It is rather unfortunate that a site like OSDev's Forum has so many egotistical, narcissistic douche bags responding that users feel compelled to use the services of a better run, better maintained site like Stackoverflow to get answers to questions related to information on the OSDev Wiki and Forum.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Re:

Post by Brendan »

Hi,
MichaelPetch wrote:
Schol-R-LEA wrote: <snark mode="petty and vindictive">
Does Sewage Overflow discourage users from checking the dates before replying?
</snark>

On a more serious note, a lot of this is in the OSDev wiki, as already stated. Still, any additional sources of information, I guess, and better late than never...
Although you were being *snarky*, I was well aware that this thread was many years old. I'm not the one who dug up this code from this forum and then asked a question about it on Stackoverflow.
Please don't. People are encouraged to search the wiki (and add information to the wiki) for anything that has been already covered; and the forums are more for "short term" (for things that haven't made it to the wiki yet, people asking things like "Where is the bug in this code" that aren't useful for other people and aren't suitable for the wiki, etc).
MichaelPetch wrote:One might ask the question - If this Forum is so good why don't people actually ask questions here? Maybe because responses like yours are a problem? (whether being funny or not).
The act of asking that question proves that the question is based on a false premise (the assumption that people don't ask questions).

If someone asks "I have a splinter in my finger and want to chop my arm off, so what is the best way to chop my arm off?"; on SO the correct advice ("I refuse to give you the answer because there are better ways of solving your actual problem") is virtually impossible.
MichaelPetch wrote:It is rather unfortunate that a site like OSDev's Forum has so many egotistical, narcissistic douche bags responding that users feel compelled to use the services of a better run, better maintained site like Stackoverflow to get answers to questions related to information on the OSDev Wiki and Forum.
It's equally unfortunate that SO is worse. Any question that is even slightly off-topic or might lead to a real discussion is quickly downvoted, locked and deleted without a trace; without any concern for the original poster and without any concern for whether or not the answers/discussion could benefit people. There's also a tendency towards "yes men" - people that only tell you what you want to hear for the sake of getting points (and won't find out what you need to know because that requires some discussion, and won't tell you what you actually need to know because they don't want to be downvoted).

Also note that "deleted without a trace" leads to deluded fan-boys that assume everything is fine because reality is hidden.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
iansjack
Member
Member
Posts: 4706
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: Childish Behaviour

Post by iansjack »

MichaelPetch wrote:It is rather unfortunate that a site like OSDev's Forum has so many egotistical, narcissistic douche bags responding that users feel compelled to use the services of a better run, better maintained site like Stackoverflow to get answers to questions related to information on the OSDev Wiki and Forum.
If you followed these forums you would be aware that many questions are asked here that have been previously asked on StackOverflow without success. So it's a two-way street.

Resurrecting dead threads (8 years old) is frowned upon on just about every forum that I frequent. It disturbs the flow of forums and, almost always, contains information that is of no use to anyone anymore. Hence people do tend to react badly when people revive dead threads.

On a larger scale, it is unedifying to see you and Brendan slagging off each other's web sites. There is a place for both of them (and no-one is forced to use either); such a reaction to another site reflects not on the site itself but on the one criticising it.

Grow up, both of you, and leave your egos at the door please.
Post Reply