LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 12-28-2005, 09:36 AM   #1
tneto
LQ Newbie
 
Registered: Dec 2005
Location: Coimbra - Portugal
Posts: 3

Rep: Reputation: 0
[how] Install a parallel Port (LPT)


Hi

Iīm making a program which will access my computers parallel port (I made a simple device to attach to it).

But when i try to open the port at adress 0x378 it says that canīt find the port....
How can i install a parallel port on my system??
Iīm using Mandriva 2005 Limited Edition.
The sample program that i use to test the por is listed below.
Tks to all for an help.
Best regards!



include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <asm/io.h>

#define base 0x378 /* printer port base address */

main(int argc, char **argv)
{
int value;

if (argc!=2)
fprintf(stderr, "Error: Wrong number of arguments. This program needs one argument which is number between 0 and 255.\n"), exit(1);
if (sscanf(argv[1],"%i",&value)!=1)
fprintf(stderr, "Error: Parameter is not a number.\n"), exit(1);
if ((value<0) || (value>255))
fprintf(stderr, "Error: Invalid numeric value. The parameter number must be between 0 and 255\n"), exit(1);
if (ioperm(base,1,1))
fprintf(stderr, "Error: Couldn't get the port at %x\n", base), exit(1);

outb((unsigned char)value, base);
}
//Written and copyright by Tomi Engdahl 1998
 
Old 12-28-2005, 06:02 PM   #2
sekelsenmat
Member
 
Registered: Apr 2005
Location: São Paulo - Brazil
Distribution: Mageia Linux 1
Posts: 353

Rep: Reputation: 30
I'm not sure if it helps you, but I know how to do it in pascal (and in a multiplatform way).

Here are the explanations: http://wiki.lazarus.freepascal.org/i...ardware_Access

I tested with both a home-made ISA card and a small parallel port test hardware on:

variuos Linux distros
MS DOS
Windows XP
Windows 98

worked on all of them ^^
 
Old 12-28-2005, 06:31 PM   #3
tneto
LQ Newbie
 
Registered: Dec 2005
Location: Coimbra - Portugal
Posts: 3

Original Poster
Rep: Reputation: 0
Tks for the reply.
But the problem is that Mandriva donīt install the parallel port, and when the softw try to find the port it coudīt get it becose there is no port...
I need to install the port manually and i dont know how to do that....
 
Old 12-28-2005, 07:44 PM   #4
sekelsenmat
Member
 
Registered: Apr 2005
Location: São Paulo - Brazil
Distribution: Mageia Linux 1
Posts: 353

Rep: Reputation: 30
Quote:
Originally Posted by tneto
Tks for the reply.
But the problem is that Mandriva donīt install the parallel port, and when the softw try to find the port it coudīt get it becose there is no port...
I need to install the port manually and i dont know how to do that....
Are you sure your parallel port is not installed?

Do you have a /dev/lp0 device? That device represents the parallel port.

If you don't have it ... then this is trouble. I've never seen a system where this isn't installed.
 
Old 12-28-2005, 08:15 PM   #5
tneto
LQ Newbie
 
Registered: Dec 2005
Location: Coimbra - Portugal
Posts: 3

Original Poster
Rep: Reputation: 0
No i donīt have it........
My system donīt have this device /dev/lp0
I will try to change the lpt parameters (ecp/epp...)in the bios, maybe this can solve my problem....my computer is
a asus a6va laptop.
later i post here the results
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
parallel port cd install problem gwg300 Slackware - Installation 1 07-16-2005 03:12 AM
Installing Kouwell Multi IO Card with LPT Port jakkals Linux - Hardware 1 01-20-2005 11:00 AM
No LPT port for printer!! akudewan Linux - Hardware 2 08-20-2004 12:23 AM
Parallel port Zip install? SoulSe Red Hat 4 10-15-2003 11:18 AM
Install from parallel port CD problems... utabintarbo Slackware 0 05-22-2002 09:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 07:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration