parallel port in linux kernel
i would like to add a driver to /dev which can light the LEDS using the parallel port.Please tell me from where i should start.i am trying to learn device driver programming, which is quite difficult for me now.please guide me on how to start the task.pls..
thanks |
The 'usual' driver for controlling a parallel port is parport. You can write to /dev/parportX (where X is a low digit) from userspace to drive the data lines. The control lines will probably be under exclusive control of the driver itself. With root privileges, you can also write directly to the IO registers that make up a standard parallel port, thus gaining control of the control lines, and gaining the ability to read the status bits.
If you still feel a need to access the hardware from kernel space, you should consult the documentation and source code for the parport kernel driver. You will need the kernel sources, and the relevant code will be in the directory drivers/parport/... below the kernel source root. --- rod. |
It also may be that you can set your parallel port to be a serial port and use those tools also.
|
Quote:
--- rod. |
Same chip runs both. I have used parallel ports in place of serial before. I know it can be done. There might be an instance where you have the last version of chip for parallel. I suspect it can be altered too but I have never tried it. Very few computers had that chip.
|
Just because the function of each kind of port are on the same piece of silicon means nothing. There is next to zero chance that connecting a serial port to a device requiring a parallel interface or vice versa will work. There may be some odd cases where the logical and electrical signaling on a connector could be controlled through software, but I've never heard of such a thing. It would be very unlikely that you would ever find a cable that would work in such a circumstance. Please describe a case where you 'have used parallel ports in place of serial before'. It would be a very unusual application that could be served equally by either.
--- rod. |
So you don't know anything about the circuit, the os, the programming or the applications but you don't believe me?
|
Not the way you've described it, however vaguely that is. I'd be most interested to hear about it though. I'd be especially eager to see how the OS has any bearing on the how a serial interface can serve as a parallel interface, or vice versa. Especially if it can apply to tincy's problem.
--- rod. |
I think you mis understand what I had suggested. You don't use a parallel port as a parallel port. You set it as a serial port and use it as any serial port would be used. The OP wanted to use parallel but I feel it would be much easier to do this with serial.
|
All times are GMT -5. The time now is 09:17 PM. |