Hi....
I am a newbie .. and learning basics of device driver development
I found a tutorial at freesoftware magazine and followed it
www,freesoftwaremagazine,com/articles/drivers_linux
but it does not seem to work!!!!!!!!
whatever i do .. nothing happens to the leds ... ie whatever i write does not affect the state of the parallel port
AND i cannot read the parallel port either... all i get to read is 255
another thing that i noticed (using DMM) is that the voltage at the parallel port pin remains at about 3.5V when parport_pc module is loaded ... as soon as i remove parport_pc module.. the output voltage changes to 4.95V. (i presume it means that the port is not in use anmore). When using windows ...disabling the port also changes voltage from 3.5 to 4.95.
Loading my driver in linux.. does not do anything
My code is same as in another post (i cannot write the URL as it is my first post in the forum)and i have copied it here as well
int parlelport_init(void)
{
int result;
port = check_region(0x378, 1);
if (port)
{
printk("<1>parlelport: cannot reserve 0x378\n");
result = port;
}
request_region(0x378, 1, "parlelport");
/* Registering device */
result = register_chrdev(parlelport_major, "parlelport",&parlelport_fops);
if (result < 0)
{
printk("<1>parlelport: cannot obtain major number %d\n", parlelport_major);
return result;
}
return 0;
}
this is the code for read
parlelport_buffer = inb(0x378);
copy_to_user(buf,&parlelport_buffer,1);
/* We change the reading position as best suits */
if (*f_pos == 0)
{
*f_pos+=1;
return 1;
}
else
{
return 0;
}
this is the code for write
char *tmp;
/* Buffer writing to the device */
char parlelport_buffer;
tmp=buf+count-1;
copy_from_user(&parlelport_buffer,tmp,1);
printk("\n Inside Write\n");
printk(parlelport_buffer);
/* Writing to the port */
outb(parlelport_buffer,0x378);
return 1;
if someone has any idea why this is happening plz tell
Thanx in advance..