Archived

This topic is now archived and is closed to further replies.

NegativeGeForce

Talking to hardware

Recommended Posts

Hey im fairly new to programming in general. I understand most of C. I understand how the whole language works as you write code, and then you compile it to make it into machine code, but I dont understand how the hardware can interperet the 0''s and 1''s and make images on the monitor. Put it another way...how would the directx and opengl libraries communicate to the video hardware? Im sorry if this question is a little to general or nubish, but I cant really find the answer in any of my many programming books. Id apreciate a response...thanks alot. GG gamedev.net! Drive it like you stole it.

Share this post


Link to post
Share on other sites
Just like any other software does it, they instruct the CPU to send data and instructions (technically more data) to the I/O subsystem.

What really happens though is more of a layered approach. The OS dictates what gets sent to the hardware when; your program makes requests to the libraries, which then make requests to the drivers, which then pass it on to the OS.

So, when you make a DirectX/OpenGL call, you''re calling your code, which invokes code in some resident library, that propogates down the abstraction sandwich, nd eventually turns into electrical signals going across the I/O bus to your video card or sound card or what have you.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Here is an explaination of the pentium 4 instruction set:
http://developer.intel.com/design/pentium4/manuals/245471.htm

It''s about 1000 pages times 3 volumes. Before you understand all that, you need a deep understanding of electrical engineering, much deeper than my understanding. I don''t think there are many people on this earth who truly understand how a modern CPU works under the hood.

Share this post


Link to post
Share on other sites
You dont really need to have a deep understanding of electrical engineering unless you are trying to understand the electrical properties of the processor itself. In order to understand the instructions set you just need to have an understanding of digital design. Basically the processor has been built to recognize certain patterns of bits to represent instructions which tell it where to send data or to do something to the data (add, subtract, multiply etc.) When you get down to the nitty gritty of it, the computer is nothing more than a really fast calculator. Isnt it amazing what you can make a calculator do?

"I may not agree with what you say but I will defend to the death your right to say it."
--Voltaire

[edited by - cmptrgear on May 7, 2003 5:03:03 PM]

Share this post


Link to post
Share on other sites