Hardware port access

Started by
2 comments, last by Monder 17 years ago
I am trying to access the sound card on my computer and have got a good base for this. The problem now is that I have not found anything on how to access a hardware port in Win32, there seems to be quite bit on accessing serial ports but that is not what I am looking for. Does anyone know how to access a hardware port?
.sehkteeah erthyahr gahro
Advertisement
Do you just want to play sound or do you want to directly access your sound-card hardware for some reason?

If it's the former then just use an appropriate API, like FMOD. If it's the latter then on a modern system you'll need to write a driver to actually get access to the hardware. Futhermore the documentation for the hardware interface for your soundcard is probably not publically available so you won't be able to do anything with it. It may have a soundblaster emulation mode or something in which case you might be able to write a driver for it.
I am trying to access the sound card's Sound Blaster 2.0 functionality. I am just using the sound card as a test. Later on I will connect to a special IR-unit that I have.
Does it really matter? All I want to do at the moment is to connect to hardware port #220, read, write, and close it again.
.sehkteeah erthyahr gahro
Well the ASM instructions for writing ports, are privledged instructions which means normal programs running in user mode can't use them. AFAIK there's no way to read and write directly from and to an arbitrary port in a user-mode application under Windows.

Quote:I am just using the sound card as a test


As in a test to make sure you can read and write ports directly? Presumably so you know it all works when you attach this IR-unit you have.

So this begs the question how does this IR-unit interface with your computer? It may be you don't need to read and write directly to hardware ports to access it. If you do you're either gonna have to find a driver or write one probably.

This topic is closed to new replies.

Advertisement