×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

VGA cards.

VGA cards.

VGA cards.

(OP)
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.

RE: VGA cards.

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.

RE: VGA cards.

(OP)
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.

RE: VGA cards.

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

John.

RE: VGA cards.

(OP)
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.

RE: VGA cards.

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.
 

RE: VGA cards.

(OP)
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.   

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close