A couple of things make this difficult on a PC:*Quote:
So, maybe an easy example of how to 'talk' to the hardware or 'addresses' so I can see how it's done, if at all possible?
- The current versions of Windows do not allow a user mode program to directly access the hardware. When you use the '&' (address-of) operator, you are getting a virtual address, not necessarily the true physical address in RAM. In order to access a physical address, you have to use the DDK (Driver Development Kit) to write a kernel mode driver. (I've never done this.)
- Most of the hardware information is proprietary to the hardware manufacturer. Your modem might have a particular bit in a particular register that enables the full-duplex mode. Only the modem manufacturer knows the address of the register and the purpose of the data. The modem manufacturer writes the driver so that it interfaces to Windows as specified by Microsoft, so your (user mode) program can use the modem without accessing the hardware or knowing the hardware details.
I once wrote a program to make sounds from the internal PC speaker. I had to access particular hardware addresses, and I think I had to do some bit manipulation to set-up registers. This program works on Windows 98, but it generates an "access error" with Win2K and above.
* It's not nearly as hard if you are working on an embedded system with its dedicated compiler... The Pic Microcontrollers are frequently programmed by hardware hobbyists. In this type of system, there is usually not an operating system getting in the way, and the supplied compiler library will include functions for reading/writing hardware addresses. (You might write the program on a Windows system, but it runs on a non-Windows system.)