Click here to Skip to main content
15,914,642 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
GeneralRe: Best way to send a signal to a piece of hardware Pin
Wjousts10-Aug-09 10:25
Wjousts10-Aug-09 10:25 
GeneralRe: Best way to send a signal to a piece of hardware Pin
Luc Pattyn10-Aug-09 10:51
sitebuilderLuc Pattyn10-Aug-09 10:51 
AnswerRe: Best way to send a signal to a piece of hardware Pin
supercat912-Aug-09 6:55
supercat912-Aug-09 6:55 
QuestionMonitoring CPU Pin
red_moon10-Aug-09 6:59
red_moon10-Aug-09 6:59 
AnswerRe: Monitoring CPU Pin
Luc Pattyn10-Aug-09 7:38
sitebuilderLuc Pattyn10-Aug-09 7:38 
QuestionWrite in pendrives's boot sector Pin
J.K.Sharma6-Aug-09 22:54
J.K.Sharma6-Aug-09 22:54 
QuestionSound device disable !! Pin
Hum Dum6-Aug-09 0:48
Hum Dum6-Aug-09 0:48 
QuestionControlling Ports, Device I/O Range and Device Memory Range Pin
eddy5115-Aug-09 11:49
eddy5115-Aug-09 11:49 
Hi all,
This is my first post in quite a while - it's good to be back.

I have a series of related questions for the experts out there. There's quite a lot of stuff below, and I would really appreciate any advice that anyone can give on any of the questions I have. Feel free to point out anything that i've understood wrong or got mixed up. The questions really are my way of trying to follow through to the lowest level possible some stuff about communicating with hardware programmatically. I always find i want to understand what i'm doing to as high a level as possible. Just so you know at what level to phrase your responses, I write best in C# and C++ and have limited knowledge of C and Assembly code. I'm currently an undergraduate physicist at Uni, but the questions i have aren't at all related to my course. If possible, im looking to complete this project using C/C++.

My questions started when I was looking into controlling the parallel port from a program. I didn't care which language I used, but wanted to understand what was going on. I discovered the inp and outp methods in the conio file, but was pointed to the CreateFile and Read/WriteFile functions in the API by MSDN. My first question is:
Am i correct in presuming that the API calls end up using the same method as inp and outp to do their stuff?

Either way, I would like to know how these functions actually work. I was told by one of my tutors that the inp and outp functions are converted pretty much straight into a single op-code - at least, there's no lower level between inp/outp and assembly code as i imagine there would be if you used the win API (for some reason i imagine the api eventually goes thru to calling inp and outp and that we use the api because you cant interact directly with I/O ports in user code). Anyway, my second question is:
Does anyone know the assembly code for reading/writing to, say, the parallel port (traditionally port at address 0x378) or ports in general.

If i am forced to use the win API CreateFile, WriteFile etc functions, is it actually possible to use these to send a single bit to one of the pins of the parallel port so that it goes high? If so, how would i go about doing this? I think i know how to do it using outp, but im not so sure when using the API.

Whilst researching this stuff i ended up on DeviceManager. I was looking at the Resource tabs for different devices. I saw that I/O range (4 numbers) was available for Devices classed as Ports, such as the Parallel port (beginning at 0x378 for example) and that using the command line Debug program (in cmd.exe) i could query and edit the pins on various ports. I again presume Debug does this through the use of inp and outp, or the API?

However, i was looking at my audio device. Its property page points to the audio controller (under System Devices). Under the Audio Controller properties page, I can look at the Memory Range. This is now 8 numbers, and is not a port address. However, i wanted to know whether it was still possible to communicate with the Audio Controller using this memory range? How would i go about doing so?

If i cant do that then the audio controller points me towards the PCI Bus, device 27. The PCI bus does have an I/O Range so i could communicate with it this way, but i have no idea at what address the Audio Controller begins...How can i find this out? I obviously don't want to accidentally access the wrong device or port!

Of course, going so low has its advantages, but it would be simpler to access the audio device through its driver - i've no doubt that the manufacturers offer such functions, but i have no idea how to find out how to access them. The properties page for the audio device shows me the driver file, but i don't know where to go from here. I'm aware of COM objects and the information in the registry, but not sure how link the stuff together.

Finally, does microsoft offer some decent API documentation, such as a functions/files list which i could use instead of Prof. Google...? There must be decent documentation somewhere, or how does anyone get anything done using it?!

Thank you for your time and patience. Any help at all is greatly appreciated.

Yours,
Ed

Edit:
I've just found the article on controlling LED's using C# and the API functions there. Whilst this is a very good article, i'm still keen to have a deeper understanding of how these API functions work, what they end up calling (e.g. inp, outp) and the other questions in my post above. The functions used in that article are actually wrapped from some random site, and so again, i wish to go deeper in my understanding, and actually know how the stuff works!
Questionhow can driver be loaded in dynamic? Pin
buffering834-Aug-09 21:22
buffering834-Aug-09 21:22 
AnswerRe: how can driver be loaded in dynamic? Pin
Randor 5-Aug-09 5:23
professional Randor 5-Aug-09 5:23 
Questioni have question about USB Filter Driver~ [modified] Pin
buffering834-Aug-09 8:33
buffering834-Aug-09 8:33 
AnswerRe: i have question about USB Filter Driver~ Pin
Randor 4-Aug-09 10:44
professional Randor 4-Aug-09 10:44 
GeneralRe: i have question about USB Filter Driver~ Pin
buffering834-Aug-09 20:25
buffering834-Aug-09 20:25 
Questionquestion about mouse filter INF Pin
buffering833-Aug-09 6:23
buffering833-Aug-09 6:23 
AnswerRe: question about mouse filter INF Pin
Randor 3-Aug-09 7:09
professional Randor 3-Aug-09 7:09 
GeneralRe: can i ask one more? Pin
buffering833-Aug-09 8:56
buffering833-Aug-09 8:56 
GeneralRe: can i ask one more? Pin
Randor 3-Aug-09 12:46
professional Randor 3-Aug-09 12:46 
Generalreally thank you^^! Pin
buffering833-Aug-09 18:19
buffering833-Aug-09 18:19 
Questionhow can i make USB filter driver inf or regedit file? Pin
buffering833-Aug-09 2:14
buffering833-Aug-09 2:14 
AnswerRe: how can i make USB filter driver inf or regedit file? Pin
Randor 3-Aug-09 6:38
professional Randor 3-Aug-09 6:38 
GeneralRe: thank you but i want to make this by using Device Driver~ Pin
buffering833-Aug-09 8:43
buffering833-Aug-09 8:43 
GeneralRe: thank you but i want to make this by using Device Driver~ Pin
Randor 3-Aug-09 9:56
professional Randor 3-Aug-09 9:56 
Questionwhere is kbilfer.c ? Pin
buffering8331-Jul-09 9:49
buffering8331-Jul-09 9:49 
AnswerRe: where is kbilfer.c ? Pin
Randor 1-Aug-09 6:43
professional Randor 1-Aug-09 6:43 
GeneralTnank you! Pin
buffering832-Aug-09 21:43
buffering832-Aug-09 21:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.