VGA code
Re:VGA code
Insults won't help but providing more info on what you want to do will! >:(
void set_mode(int mode);
_set_mode:
push bp
mov bp,sp
mov ax,[bp+4] ;get video mode
int 10h
ret
this is for 16 mode and will NOT WORK IN 32BIT mode
to call from C
set_mode(0x03); text mode 80*25*16 colors
set_mode(0x13); graphics mode 320*200*256 colors
hope it helps, find yourself vga docs
void set_mode(int mode);
_set_mode:
push bp
mov bp,sp
mov ax,[bp+4] ;get video mode
int 10h
ret
this is for 16 mode and will NOT WORK IN 32BIT mode
to call from C
set_mode(0x03); text mode 80*25*16 colors
set_mode(0x13); graphics mode 320*200*256 colors
hope it helps, find yourself vga docs
Re:VGA code
Nice try, but thanks. I need a piece of code that will work in 32 bit mode or as I call it Protected Mode. I have the code to it though, but the problem is that 70% is useless and complicates the code so it is impossible to do anything with it. I found it on the internet while searching for VGA code.
Re:VGA code
umm yea. youve been pretty rude, so i dont know why anyone should help you, but ill forgive you and help anyways. its not too hard, its just painstaking. you gotta find out the correct values of all the VGA registers for a particular video mode, id say go with 13h, seeing as how its easiest. I dont know about this arcane hardware hacking, but you might have to set aside, I think its 640K, of video memory, and put the memorys address into the vid card. from there, its jsut simple graphics programming, and if you dont know hwo to do that, all it is is putting the correct RGB value in the memory location corresponding to a pixel onscreen. there are plenty of mode 13h tutorials to tell you hwo to do graphics programming. it would be much easier to write your own VGA driver, which is what you will have to do to switch modes.
Re:VGA code
Yeah..seriously rude.
Incidentally 0x13H, is 320x200x8bit..giving a 64K framebuffer at 0xA0000. Set this mode before you enter protected mode.
You can then blit pixels to the memory area. Dead simple standard packed pixel stuff (i.e. one pixel is one byte).
You will ultimately need a proper video driver anyway.
Oh..one word of advice, if you are writing an OS, most people find it almost impossible to start coding the GUI for at least a year until several underlying sub-systems are in place. For example caching icons needs memory management and an IO driver which needs ***...you get the idea.
Daryl.
Incidentally 0x13H, is 320x200x8bit..giving a 64K framebuffer at 0xA0000. Set this mode before you enter protected mode.
You can then blit pixels to the memory area. Dead simple standard packed pixel stuff (i.e. one pixel is one byte).
You will ultimately need a proper video driver anyway.
Oh..one word of advice, if you are writing an OS, most people find it almost impossible to start coding the GUI for at least a year until several underlying sub-systems are in place. For example caching icons needs memory management and an IO driver which needs ***...you get the idea.
Daryl.
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:VGA code
fs2death
funny words you use and ... aren't you somewhat unpatient?
You post a question, and about ten or fifteen minutes later you come along moaning about getting no answer???!!!
Gosh, take your brain, and USE it!!
The people here sometimes use GOOGLE to find answers themselves and for other ones. And finding answers needs time.
Think about it and stay polite.
funny words you use and ... aren't you somewhat unpatient?
You post a question, and about ten or fifteen minutes later you come along moaning about getting no answer???!!!
Gosh, take your brain, and USE it!!
The people here sometimes use GOOGLE to find answers themselves and for other ones. And finding answers needs time.
Think about it and stay polite.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:VGA code
To FS2Death:
You really should mature a bit before posting here again. As already mentioned you posted your question (which really didn't say anything useful) and just a few minutes later you post again, complaining. First of all, people have other things to do than be on this forum all the time. Second, it takes time to answer questions (understand the question, find the information, consider what could be helpful and finally post it).
And really, use of insulting language will not help at all. I don't know so much about the topic but if I would, I would not help you until you had apologized. I think that those that help you even when you are this rude are great people but I could not be one of them.
However, I can make a hint. I have myself wondered about graphics and found some information about using the BIOS under Protected Mode (letting BIOS be in Virtual Mode).
So until next time:
* Scrap the insulting language.
* Think before you post a question. What are you trying to achieve? For what circumstances should the code be for? Etc...
* Be patient. We are not here to serve you. We are here to try helping if we can (and recieve help in return).
You really should mature a bit before posting here again. As already mentioned you posted your question (which really didn't say anything useful) and just a few minutes later you post again, complaining. First of all, people have other things to do than be on this forum all the time. Second, it takes time to answer questions (understand the question, find the information, consider what could be helpful and finally post it).
And really, use of insulting language will not help at all. I don't know so much about the topic but if I would, I would not help you until you had apologized. I think that those that help you even when you are this rude are great people but I could not be one of them.
However, I can make a hint. I have myself wondered about graphics and found some information about using the BIOS under Protected Mode (letting BIOS be in Virtual Mode).
So until next time:
* Scrap the insulting language.
* Think before you post a question. What are you trying to achieve? For what circumstances should the code be for? Etc...
* Be patient. We are not here to serve you. We are here to try helping if we can (and recieve help in return).
Re:VGA code
Hmm. Is this a help forum or a commentary? Anyway, I got 320*240 mode to work a long time ago by using dumped registers. Now I am trying to enter 640*480*16. I get an image with a vertical lines. Finally, the words you all call rude are just pep talk.
Re:VGA code
Have you ever heard of the saying that you're just making the hole deeper. It would be a lot easier to say Sorry than to make excuses.FS2Death wrote: Finally, the words you all call rude are just pep talk.
If you want code go to my.execpc.com/~geezer/osd/graphics/modes.c it looks complicated but if you strip it down to only the mode you want it becomes quite short. (I've only started looking through it and have already simplified it to 225 odd lines - from over 1000 - which I can learn from.)
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:VGA code
sorry for asking: what is "Pep Talk"?
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
-
- Member
- Posts: 1600
- Joined: Wed Oct 18, 2006 11:59 am
- Location: Vienna/Austria
- Contact:
Re:VGA code
well,
we are grown-ups, arent we? we decide ourselves which way we want to be "motivated", don't we?
Thanks for explaining, therx.
we are grown-ups, arent we? we decide ourselves which way we want to be "motivated", don't we?
Thanks for explaining, therx.
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
BlueillusionOS iso image
Re:VGA code
Well, you tell me. It was you that wrote "This is sad, no one knows how to do it????" in the first place, was it not?FS2Death wrote: Hmm. Is this a help forum or a commentary?
Well, you must have missunderstood the principes of pep talk. It is supposed to inspire people. Not agitate them.FS2Death wrote: Finally, the words you all call rude are just pep talk.
Re:VGA code
FS2Death: ask politely for help. Do not demand it. What seems like pep talk to you comes across as arrogance to everyone else.
Everyone else: if you can't contribute any VGA code (which is the subject of this thread), don't contribute anything.
BIOS-independent VGA code: http://cvs.sourceforge.net/cgi-bin/view ... ers/video/
Everyone else: if you can't contribute any VGA code (which is the subject of this thread), don't contribute anything.
BIOS-independent VGA code: http://cvs.sourceforge.net/cgi-bin/view ... ers/video/