Go Back   Technology Questions > Software Questions > Operating System Questions > Linux

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 10-05-2007, 04:50 PM
Unruh
Tablet PC Guest
 
Posts: n/a
parallel port frezing up


I am trying to run ntp with a gps PPM given the time base, and thus I am
trying to use a program called shmpps. It opens the parallel port,
/dev/lp0, and then tries to send the ioctl PPEXCL, but the system give back
the error or invalid argument to the ioctl function. HOwever thereafter the
parallel port seems to have been destroyed, and nothing can use it. If I
try to run another program it says it cannot find 0x378, the parallel port
port ( and it has no trouble before I tried to run the ioctl. )

Here is the code fragment from the sshpps program.

pp_fd = open (*pps_dev,O_RDWR);
if (pp_fd<0) {
if (nodive) {
fprintf(stderr, "%s: r/w open on %s failed.\n", prog, *pps_dev);
perror("open");
}
exit(1);
}

if (ioctl (pp_fd, PPEXCL) == -1) {
if (nodive) {
fprintf(stderr, "%s: open exclusive on %s failed.\n", prog, *pps_dev);
perror ("ioctl_ppexcl");
}
ioctl(pp_fd, PPRELEASE);
close (pp_fd);
exit(1);
}


The device, pps_dev is /dev/lp0, and the open call succeeds. However the
following ioctl throws an error which perror reports as
"invalid argument".

and forever after the parallel port does not work for anything.
Even if I unload
rmmod lp parport_pc parport lp
and then reload
modprobe lp
I still get the same error messages.
Eg another program does a request_region on 0x378 and throws and error.

Somehow the ioctl call is destroying the access to the port.

Any clues as to what is going on here (unfortunately my knowledge of ioctls
is not great enough to figure it out myself. )



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

 
Old 10-05-2007, 04:50 PM
Xploder HD Movie Player for PS3. Manage, convert and transfer media files between the PC and PS3.
  #2 (permalink)  
Old 10-06-2007, 02:00 PM
David W. Hodgins
Tablet PC Guest
 
Posts: n/a
Re: parallel port frezing up

On Fri, 05 Oct 2007 20:38:37 -0400, Unruh <unruh-spam@physics.ubc.ca> wrote:

> I am trying to run ntp with a gps PPM given the time base, and thus I am
> trying to use a program called shmpps. It opens the parallel port,
> /dev/lp0, and then tries to send the ioctl PPEXCL, but the system giveback


A couple of things to try.

In /etc/modprobe.conf, add the line
options parport_pc irq=7 dma=3 io=0x378
to ensure the port is using interupts, instead of polling.

Check the bios setup program, to ensure ECP mode is enabled.

Regards, Dave Hodgins

--
Change nomail.afraid.org to ody.ca to reply by email.
(nomail.afraid.org has been set up specifically for
use in usenet. Feel free to use it yourself.)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
USB hard drive won't work on a USB 2 port but will on a USB 1.1 port.Why? Gary Schnabl Windows Vista 0 05-24-2007 12:40 AM
new laptop with parallel port for a parallel dot matrix printer? PiErre Notebooks 7 05-05-2007 10:28 PM
Access to parallel port 0x378 Jose Manuel Lopez. Windows XP 2 01-25-2007 07:15 AM
Connecting laptop via serial or parallel port - w/virtual drive letter jim_b@mailinator.com Mobile PC Hardware 16 01-19-2007 10:22 PM
Parallel Port address LPT1 on T41p Quigi Windows XP 4 01-04-2007 03:59 AM


All times are GMT -8. The time now is 11:36 AM.


2003 - 2008 All Rights Reserved. Technology Questions

SEO by vBSEO 3.1.0