i tried the following code on my computer. i tried it from a tutorial on the net. It explains the Linux-2.4 parallel port subsystem.
#include<linux/ppdev.h> #include<sys/types.h> #include<sys/ioctl.h> .....
#define DEVICE_FILE "/dev/parport0"
main() {
int p_fd; p_fd = open(DEVICE_FILE,O_RDWR); if(p_fd < 0) { perror(" in open "); exit(0); }
if( ioctl(p_fd, PPCLAIM)) { perror("in ioctl"); exit(0); }
}
i'am planning to write a driver for it, so i decided to first understand the Parport subsystem on Linux-2.4. Now, ioctl() fails and perror reports :
in ioctl : no such device or address.
i get a message in /var/log/messages saying :
ppdev0: no associated port.
could someone explain why this could happen and how i could get out of this ?
cheers, Amith
PS: i tried with parport0, parport1,parport2 - device files , without any change in errors :-( !
tried to print documents on my printer from Windows applications like MS-Word, just to check whether the parallel port is working and iam able to print .