Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VGA cards. 1

Status
Not open for further replies.

johndoe19700101

Technical User
Feb 21, 2011
5
SE
Hi everyone,

I have some questions:

1. Im using gnu(as) assembly for x86 platform and I like to know how the VGA system works from the assembly point of view. Any good books avaible?

2. And how do i access the VGA card directly? I need to be able to use resolutions in the following range 1024x768 1280x1024 1600x1200 and 1280x800 currently so i can adress and manipulate pixels directly.

3. Off topic: Any good ideas on how to access audio cards from assembly, and howto access ethernet cards trought assembly? Guess the polite question would be: How to find a good guide or book on assembly and interfaceing with the hardware mainly for the x86 platforms.

Cheers John.
 
Before you go into all that, what operating system is in control of the hardware (the one that boots on your machine).

Modern desktop operating systems are protected, in that unlike say bad-old DOS, you can't just pick memory addresses and start writing bytes from user-land programs.

Video / audio / network (and everything else) are driven by drivers, which provide an API to user-land processes. You can call these API's in ASM just as in any other language.



--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Yes I understand the part about protected mode vs unprotected and sutch, I have full priority in the system that means that I can access any memory or instruction i whant.

And maybe the questions are somewhat unclear I whant to build the driver interface to the users so in short i will build the mechanism for komunication with devices I don't plan to be dependant on other API's.

I just wonder if anyone know how to do it. And could point to some good reading material and maybe trow in if possible the instructions to get into these hi resolutions with the graphics card, on a x86.

I have someting close to a bare minimum OS, but in some respects even less than that since there is no REAL kernel so to speak.

Cheers John.
 
Oh and just to add I'm not in any known OS, the bare system I am in is of my own creation.

John.
 
Thanks Salem, link nr:1 exites me. link nr_2 drives me to the thing I was hopeing to avoid, namely reverse engineering other systems. Alltho I use FreeBSD as my developing platform I'm not so fond of reading their sourcecode.

Tanks again John.

----

More info are still welcome.
 
I believe that there was never any standard for VGA cards for higher resolutions than 640*480 (16 colours). The reason was that VGA never had enough memory-mapped memory to go that high. Individual manufacturers began to add extra memory (and various sorts of memory-banking to allow the extra memory to be accessed via the original smaller address-range) and ways to access higher resolutions, but because they were extending the original VGA definition, they all did it in different, non-standard ways. These were the sVGA cards of many flavours.

To get round this, VESA was invented.

Basically the problem you have is that original VGA manufacturers supplied drivers for DOS (including VESA) and for Windows, so the way to get hardware-independant interaction with the graphics card was to do it via these drivers. If you want to do your own, then you will have to write individual code for all the different VGA cards that might have existed.

VGA programming is very well handled in Michael Abrash's black book, but I have no idea where it's still available.
 
Found the black book, yes after some research I found out that the way to go is the VESA extension witch is integrated with almost every new BIOS, downloading VESA extension version 3, and experimenting with it leads to every basic VGA support one ever needs without special microcodes and such for specific cards, although microcodes and things like that is necessary if one want full 3D acceleration from the graphics card.

VESA specifies that everything is available trough the 10h instruction in real mode, and some other in the protected mode.

Thought I write this here so other people can find it to.

Still no real luck on the general hardware in assembly programming tho.

Cheers John.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top