Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2001-02

[Fwd: [Fwd: Ports under Linux]]

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luis R. Hilario

Linux unit:
"Description: IOperm sets permissions on Num ports starting with port From to Value."
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: 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 ( [130.161.36.93]) by freeservers.com (8.9.3/8.7.1) with ESMTP id WAA32178 for ; Mon, 5 Feb 2001 22:00:40 -0700 Received: from deadlock.et.tudelft.nl ( [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 ; 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: Date: Tue, 06 Feb 2001 00:43:27 -0300 From: "Luis R. Hilario" 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 Subject: [Fwd: [fpc-devel]Ports under Linux] Content-Type: multipart/mixed; boundary="------------D084DCC5EE31A7101B943858" Reply-To: Sender: Errors-To: X-Mailman-Version: 1.1 Precedence: bulk List-Id: FPC developers' list <fpc-devel.lists.freepascal.org> X-BeenThere: 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: 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 ( [130.161.36.93]) by freeservers.com (8.9.3/8.7.1) with ESMTP id VAA22722 for ; Mon, 5 Feb 2001 21:05:24 -0700 Received: from deadlock.et.tudelft.nl ( [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 ; 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: Date: Mon, 05 Feb 2001 23:04:41 -0300 From: "Luis R. Hilario" 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: Subject: Re: [fpc-devel]Ports under Linux References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Reply-To: Sender: Errors-To: X-Mailman-Version: 1.1 Precedence: bulk List-Id: FPC developers' list <fpc-devel.lists.freepascal.org> X-BeenThere: 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 | |-----------------------------|

Reply by email