Page 1 of 1
VGA/VESA ???
Posted: Sun Mar 28, 2010 7:16 pm
by Sam111
Ok , I have my kernel in protected mode and wrote to display text to the screen using the MMIO
base address 0xB8000 works fine.
I think the display is 80x24 text mode (just got to remember the even array elements are for the characters and the odd ones are for their color/text attributes...etc
)
I am wondering how I can switch modes to graphics 1024 x 720 or so?
I have read thru the
http://pdos.csail.mit.edu/6.828/2008/re ... e/vbe3.pdf
But most of this stuff works with the int 10h interrupt in real mode. Their should be away to do all this stuff in protected mode. ( I would like it if I didn't have to switch back to real mode everytime I have to set the graphics display setting to something different)
I am pretty lost what spec's I have to look at for doing a driver program.
I saw in one osdev post that 0xA0000 was used for graphics mode (curious on how this can be used and how to set the resolution with this if possible for graphics mode)
I am using NVidia card on AGP bus
Thanks
Re: VGA/VESA ???
Posted: Sun Mar 28, 2010 7:23 pm
by pcmattman
Virtual 8086 mode or x86emu works.
However, I consider the following to be prerequisites before you even think about anything other than text-based modes:
- Proper memory management: virtual memory and a physical memory manager. Paging that works.
- Processes and threads: required for a virtual 8086 mode task anyway, and processes and threads are a fundamental part of most operating systems
- Some form of driver interface: abstract away important driver functionality. Something like CDI or UDI helps, but both require OS support which you might not want to write
- A decent userspace. The main reason I say this is that by the time you reach proper graphics modes, you should already prove that your kernel actually works. Easiest way to do that: run applications in userspace, preferably some that use threads.
Only after you've completed the above prerequisites should you start thinking about graphics modes and things like that. After all, if your foundations aren't stable and secure, the beautiful mansion will topple down eventually
EDIT: Also, following the above prerequisites teaches you fundamental skills which you absolutely need to know when implementing any type of graphical interface.
EDIT 2:
I am using NVidia card on AGP bus
My suggestion is to not even try. To my knowledge there is absolutely no documentation about the nVidia cards, and therefore you're stuck either reverse engineering the card (illegal in some countries) or trying to comprehend some open source driver (which would have to be ported to your driver interface, a monolithic task).
VESA is good enough for what you want to do, and it's supported by a massive range of cards.
Re: VGA/VESA ???
Posted: Sun Mar 28, 2010 7:26 pm
by Gigasoft
Usage of non-VGA functionality is different for each display device, and it's often undocumented. So, either you must use VGA compatible modes, or write drivers for specific display device, or go back to real mode (or Virtual 8086 mode) and use VBE.
This page describes the operation of a display device in VGA mode:
http://www.stanford.edu/class/cs140/pro ... ga/vga.htm
Re: VGA/VESA ???
Posted: Sun Mar 28, 2010 8:20 pm
by Sam111
Well I kind of just wanted to beable to display a picture in 1024 x 720 resolution
Or beable to draw a picture on the screen other then text.
Re: VGA/VESA ???
Posted: Mon Mar 29, 2010 12:28 am
by KotuxGuy
I seem to remember you having trouble with linking(
http://forum.osdev.org/viewtopic.php?f=13&t=21753 &
http://forum.osdev.org/viewtopic.php?f=13&t=21750), and those posts were just
3 days ago. There is no way that you should be trying to handle VGA/VESA right now.
And please,
please, try to be a little more specific with your subject. It really helps those who can help you.
Look at this:
What order should i make things in at the "For the starter" section. I doubt you have all that stuff already implemented.
Then,
and only then, should you come back to us asking about VGA/VESA. And before you ask, look through the wiki, like
James T. Klik.
EDIT: You need to do some more research:
http://wiki.osdev.org/VGA_Hardware#Color_Logic. I found that in 30 seconds.
EDIT #2: There is no 80x24 or 1024x720 mode, that should be 80x25 and 1024x768 mode.
P.S to the mods: Could we rename "What order should i make things in" to "What order should I make things in"? It's grammatically correct
Re: VGA/VESA ???
Posted: Mon Mar 29, 2010 1:47 am
by Combuster
I might add, straight from the
FAQ (-1 you):
http://wiki.osdev.org/How_do_I_set_a_graphics_mode
P.S to the mods: Could we rename "What order should i make things in" to "What order should I make things in"? It's grammatically correct
Did you notice one is a redirect for the other - designed for those people who are too lazy to find the shift key
- Also, wiki editing doesn't need mod privileges
Re: VGA/VESA ???
Posted: Mon Mar 29, 2010 12:52 pm
by KotuxGuy
Yeah, I know wiki editing doesn't require a mod. I just wanted to make sure no one would be mad at my modifying. BTW, I didn't know about that redirect.
Re: VGA/VESA ???
Posted: Sun Apr 04, 2010 12:05 am
by TheDragon
If you want to look at some rather good VGA tutorials, I would suggest that you look at Denthor's Asphixia VGA Trainer (Grand name, isn't it?). I think it has something that you are looking for in one of the tutorials, somewhere. Ummm...I thought you could find them at gamedev.net, but apparently they are closed for some reason. Google around for them.
While his tutorials aren't exactly on the OS level (they are coded in Pascal, after all), they are rather informative, and they contain ASM snippets that you might be able to learn from. However, they mostly cover techniques like scrolling and fire demos and stuff.
It's worth a shot.
Re: VGA/VESA ???
Posted: Sun Apr 04, 2010 6:03 pm
by ehenkes
I think the display is 80x24 text mode
Typically you start with 80*25 text mode using two bytes for each character.
This will help you to have 80*50 text mode which helps a little bit until you have developed your high resolution OS.
You can use it during real mode stage (e.g. boot loader stage 1).
Code: Select all
; set 80x50 text mode and 8x8 font
mov ax, 0x1112
xor bl, bl
int 0x10