Direct memory access?
Hi. I need to access what other applications write to the parallel port address (0x378). Newer computers do not have a physical port, so I'm building myself an USB based extension. I have the hardware and driver ready for it, all I need is to find out what other applications write at the port's address.
This way, my device will behave like a real parallel port, when you will use an application like relais timer to change some pins, the driver will read the change and send it to my hardware.
I hope I'm clear, I asked in other forums and no one seems to understand what I want :p so, again, I don't want to read the parallel port's inputs, I want to read what other applications output to the port. The output is located at 0x378 on most motherboards.
That'll be difficult if we consider that the application wouldn't be writing to the parallel port itself, but to the Windows Driver that in turn writes to the port. If you have a gadget of some sort that connects to a parallel port, why not just get a USB-to-Parallel connector?
Because such a device is seen by the system as a printer. I want to have direct control over the individual bits, for using software such as relais timer, mach 3, etc.
I already built the hardware (gadget) and corresponding software for it, all I need now is to simply get what other applications are writing to the port. The problem is that, I want to emulate the parallel port, so I can connect other stuff to it - so I'm building the converter. There is no converter as of now, that can be addresed in the same way the parallel port is addressed. And that's my problem - I need to address the converter (gadget, as you call it, but another gadget wil attach to it) from software that normally addresses the parallel port.
To write to the parallel port, you simply put some data at RAM address 0x378. I think that is under the convetional memory limit. That's it - nothing special happens in software, just that the hardware on the mobo copies that value to the physical port.
I need a method of reading address 0x378 in windows.
I don't know why people can't get it through their heads that Windows doesn't let you talk to hardware directly unless your program is a driver.
PORT 0x378 [as referring to the parallel port] is not a MEMORY address, it's an IO-port, which is indicated by the processor signaling a different set of bits on the pins to indicate what type of bus cycle it is making. So it's not "data in RAM address 0x378".
Originally Posted by _izua_
Further, like MacGyver says, you can't just read/write to IO ports in Windows. You need a driver to do that. If you wish to figure out what goes to the parallel port, you'd need a printer-filter-driver for the parallel printer device [a filter driver can see what goes on, and decide if it wants to forward the data or not].
Study the device driver kit (DDK) that MS has - it's free of charge and can be dowloading directly from MS website.
However, writing a trivial filter driver is still a fairly complex task, and not something you can do in a couple of days [unless you have done it several times before, and have most of the code ready to just copy'n'paste].