No subject


Tue Jun 11 15:59:36 CEST 2019


The argument value:
http://www.linuxdoc.org/HOWTO/mini/IO-Port-Programming-2.html
"The last argument is a Boolean value specifying whether to give access
to the
program to the ports (true (1)) or to remove access (false (0))."
-- 
 |-----------------------------|
| Luis R. Hilario               |
| http://www.luisdigital.2y.net |
 |-----------------------------|
--------------87121344032CB362C05E7568
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

X-Apparently-To: l_hilario at yahoo.com via web1202
X-Track: 1: 40
Received: from mail5.freeservers.com  (EHLO freeservers.com) (63.108.71.95)
  by mta547.mail.yahoo.com with SMTP; 05 Feb 2001 20:51:42 -0800 (PST)
Received: from deadlock.et.tudelft.nl (root at deadlock.et.tudelft.nl [130.161.36.93]) by freeservers.com (8.9.3/8.7.1) with ESMTP id WAA32178 for <luis at luis-digital.8m.com>; Mon, 5 Feb 2001 22:00:40 -0700
Received: from deadlock.et.tudelft.nl (daemon at localhost [127.0.0.1])
	by deadlock.et.tudelft.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id FAA17133;
	Tue, 6 Feb 2001 05:38:59 +0100
Received: from codetel.net.do (mail1.codetel.net.do [196.3.81.51])
	by deadlock.et.tudelft.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id FAA17113
	for <fpc-devel at lists.freepascal.org>; Tue, 6 Feb 2001 05:38:56 +0100
X-Authentication-Warning: deadlock.et.tudelft.nl: Host mail1.codetel.net.do [196.3.81.51] claimed to be codetel.net.do
Received: from luis-digital.8m.com ([12.128.176.20]) by codetel.net.do  with Microsoft SMTPSVC(5.5.1877.447.44);
	 Tue, 6 Feb 2001 00:36:51 -0400
Message-ID: <3A7F72DF.92E760D7 at luis-digital.8m.com>
Date: Tue, 06 Feb 2001 00:43:27 -0300
From: "Luis R. Hilario" <luis at luis-digital.8m.com>
Organization: Luis Digital
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.14 i586)
X-Accept-Language: es, en
MIME-Version: 1.0
To: FPC Devel <fpc-devel at lists.freepascal.org>
Subject: [Fwd: [fpc-devel]Ports under Linux]
Content-Type: multipart/mixed;
 boundary="------------D084DCC5EE31A7101B943858"
Reply-To: fpc-devel at deadlock.et.tudelft.nl
Sender: fpc-devel-admin at deadlock.et.tudelft.nl
Errors-To: fpc-devel-admin at deadlock.et.tudelft.nl
X-Mailman-Version: 1.1
Precedence: bulk
List-Id: FPC developers' list <fpc-devel.lists.freepascal.org>
X-BeenThere: fpc-devel at lists.freepascal.org
X-Mozilla-Status2: 00000000

This is a multi-part message in MIME format.
--------------D084DCC5EE31A7101B943858
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Uses linux, ports;
// Program based on:
http://www.linuxdoc.org/HOWTO/mini/IO-Port-Programming-9.html

Const
 BASEPORT = $0378;  // Normally it is LPT1

begin
 // Get access to the ports: $0378..$037A
 if not (ioperm(BASEPORT, 3, 1)) then Halt(1);

 // Set the data signals (D0-7) of the port to all low (0)
 Port[$378] := 0;

 // Read the port of data. It must read the previous value, in this case
a zero.
 Writeln(Port[$378]);

 // We don't need the ports anymore.
 if not (ioperm(BASEPORT, 3, 0)) then Halt(1);

// Important note:
// Bit 5 of the control port ($37A) selects the direction (In or Out) of
the port of data.
end.

"Under LINUX, your program must be run as root, or the IOPerm call..."
In the documentation it must go "and" instead of "or".

-- 
 |-----------------------------|
| Luis R. Hilario               |
| http://www.luisdigital.2y.net |
 |-----------------------------|
--------------D084DCC5EE31A7101B943858
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

X-Apparently-To: l_hilario at yahoo.com via web1201
X-Track: 1: 40
Received: from mail2.freeservers.com  (EHLO freeservers.com) (63.108.71.92)
  by mta524.mail.yahoo.com with SMTP; 05 Feb 2001 19:56:24 -0800 (PST)
Received: from deadlock.et.tudelft.nl (root at deadlock.et.tudelft.nl [130.161.36.93]) by freeservers.com (8.9.3/8.7.1) with ESMTP id VAA22722 for <luis at luis-digital.8m.com>; Mon, 5 Feb 2001 21:05:24 -0700
Received: from deadlock.et.tudelft.nl (daemon at localhost [127.0.0.1])
	by deadlock.et.tudelft.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id EAA14223;
	Tue, 6 Feb 2001 04:00:31 +0100
Received: from codetel.net.do (mail1.codetel.net.do [196.3.81.51])
	by deadlock.et.tudelft.nl (8.9.3/8.9.3/Debian 8.9.3-21) with ESMTP id EAA14198
	for <fpc-devel at deadlock.et.tudelft.nl>; Tue, 6 Feb 2001 04:00:18 +0100
X-Authentication-Warning: deadlock.et.tudelft.nl: Host mail1.codetel.net.do [196.3.81.51] claimed to be codetel.net.do
Received: from luis-digital.8m.com ([12.128.191.177]) by codetel.net.do  with Microsoft SMTPSVC(5.5.1877.447.44);
	 Mon, 5 Feb 2001 22:58:02 -0400
Message-ID: <3A7F5BB9.DBE1E0B1 at luis-digital.8m.com>
Date: Mon, 05 Feb 2001 23:04:41 -0300
From: "Luis R. Hilario" <luis at luis-digital.8m.com>
Organization: Luis Digital
X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.14 i586)
X-Accept-Language: es, en
MIME-Version: 1.0
To: fpc-devel at deadlock.et.tudelft.nl
Subject: Re: [fpc-devel]Ports under Linux
References: <3A7F2A21.25010.1071DC at localhost>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Reply-To: fpc-devel at deadlock.et.tudelft.nl
Sender: fpc-devel-admin at deadlock.et.tudelft.nl
Errors-To: fpc-devel-admin at deadlock.et.tudelft.nl
X-Mailman-Version: 1.1
Precedence: bulk
List-Id: FPC developers' list <fpc-devel.lists.freepascal.org>
X-BeenThere: fpc-devel at lists.freepascal.org
X-Mozilla-Status2: 00000000

Marco van de Voort wrote:
> 
> > Under LINUX, your program must be run as root, or the IOPerm call must
> > be set in order to set appropriate permissions on the port access."
> >
> > I run the program as root. I must use IOPerm of any way?
> 
> Hmm, no, I think that the docs are correct.

Then the previous example would have functional?
If it is not thus, could put an example and include it in the manual. ?


About the error.
I talk about the part that says: "See also ioperm (2)".
Since it does not lead nowhere. Perhaps they wanted to talk about to
"iopl" (~>man iopl).

-- 
 |-----------------------------|
| Luis R. Hilario               |
| http://www.luisdigital.2y.net |
 |-----------------------------|

_______________________________________________
fpc-devel maillist  -  fpc-devel at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

--------------D084DCC5EE31A7101B943858--


_______________________________________________
fpc-devel maillist  -  fpc-devel at lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

--------------87121344032CB362C05E7568--





More information about the fpc-devel mailing list