Hardware Interfacing

Jones
Unregistered
 
Post: #1
Hardware programming has always been a subject that fascinates me. The closest thing I've come to it is a little robotic owl I have that you plug into a computer and then program with using C. I didn't use it much because I never managed to get it to use the compiled firmware the manual tells you to upload.

Recently I've been interested in how a computer interfaces with it's hardware. (Audio, graphics cards, etc...) I wondered how OS's talked to the computer so I downloaded the sources to Linux and ReactOS and poked around inside them. I understood none of it, naturally. Rasp

How does one send a message/signal to hardware using C or C++ (higher level languages I mean, rather than assembly) ? I assume that in all PC's there are standards like "Video card is at bus id 0x000034A" or something but at some stage there must be a way to send stuff to that bus to execute.

Does OpenGL do this directly or handle it through the OS?

I'm looking for texts on the subject and maybe a bit of sample code to look at. I took a peek at Apple's Kernel Extensions sample code for audio drivers but once again, understood none of it. It also appeared to use apple driver frameworks which is not what I want to learn about. I want to learn about how those frameworks were written, not how to use them.

So anyways, like I said, know of any texts or resources on the subject?

Thanks!
Quote this message in a reply
Member
Posts: 277
Joined: 2004.10
Post: #2
What kind of hardware interfacing?
Drivers?
LCD displays...
USB communication...
Robotics...

LCD and robotics like that owl are mostly the same though... fun... but the same :-P

Global warming is caused by hobos and mooses
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #3
I know OS X is a little more restrictive with its access than other systems. For example, they don't allow you to interface directly with the VRAM on your video card. However, if you were to have a USB peripheral, for example, you'd be completely free to implement it. It's just a matter of finding the address for it, then sending and receiving data. Unfortunately, I don't have any texts to explain it.
Quote this message in a reply
Jones
Unregistered
 
Post: #4
That's one of things I'd like to learn to do. Driver coding, as boring as it may sound.
Quote this message in a reply
Moderator
Posts: 1,140
Joined: 2005.07
Post: #5
Well, if everybody found it boring, then likely nobody would do it and we'd have a real problem. Rasp
Quote this message in a reply
Sage
Posts: 1,403
Joined: 2005.07
Post: #6
I suppose the best thing to do would be to learn to program with assembly and also learn in detail how a computer works (at the hardware level, acessing memory, fetch execute etc etc).
Then maybe take a look at macam source code, there is also probably a huge amount you could learn from various linux drivers as well.

Sir, e^iπ + 1 = 0, hence God exists; reply!
Quote this message in a reply
sh4ggy87
Unregistered
 
Post: #7
http://en.wikipedia.org/wiki/Memory-mapped_I/O

Though, you can't directly write to memory from a userspace program. To really understand drivers for OS X, you'll need to have a decent understanding of computer architecture and OS design.

IMHO, an easy (maybe) first step would be learning embedded systems programming with something like PIC, AVR, 6812, etc. This would give you a good start on computer architecture and how to use assembly as well as how to interface with hardware in a system without an OS.

Then you could learn OS principles, and hopefully, the linux code would start making sense Wink
Quote this message in a reply
Stalin55
Unregistered
 
Post: #8
Jones Wrote:Hardware programming has always been a subject that fascinates me.

Go and by the book "Code". The books first explains to you all of the basic foundations that you will need to know to gain a basic understanding of computer software and hardware. I cannot stress strongly enough how good a book this is.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  GLSL hardware support ia3n_g 4 4,453 Oct 6, 2006 08:28 PM
Last Post: ia3n_g
  Non-square, non-POT, hardware-accelerated surfaces... NekoYasha 13 5,862 Oct 25, 2005 03:06 PM
Last Post: NekoYasha
  Context Sharing and Hardware Matrix 3 2,866 May 5, 2005 07:23 PM
Last Post: Matrix
  What graphics cards qualify as DX9-class hardware? morgant 10 5,273 Feb 22, 2005 03:09 PM
Last Post: arekkusu
  VAR problem on NVidia hardware wadesworld 3 2,908 Feb 14, 2003 11:48 PM
Last Post: wadesworld