Sign in Join

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

Mailing lists / fpc-devel / 2001-02

Ports under Linux

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Luis R. Hilario

Hello!,

I have tried to use the parallel port under Linux and I cannot. It always leaves with the error: 216 "General Protection fault". I use the unit "Ports".

In order to use the parallel port under Windows assembler is due to use. In the end one ends up creating the unit "Ports" under Windows. There is another form? (WINAPI???)

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

Reply by email

Marco van de Voort
to Luis R. Hilario
Show quoted text 7 lines
I have tried to use the parallel port under Linux and I cannot. It always leaves with the error: 216 "General Protection fault". I use the unit "Ports". In order to use the parallel port under Windows assembler is due to use. In the end one ends up creating the unit "Ports" under Windows. There is another form? (WINAPI???)

(From memory:)

Under Linux and FreeBSD you usually have to be root to access ports AND ask permission with ioperm. See units manual, linux unit, function ioperm and maybe also the inport<x> and outport<x> functions there.

Reply by email

Luis R. Hilario
to Marco van de Voort
Marco van de Voort wrote 15 lines
> I have tried to use the parallel port under Linux and I cannot. > It always leaves with the error: 216 "General Protection fault". > I use the unit "Ports". > > In order to use the parallel port under Windows assembler is due to use. > In the end one ends up creating the unit "Ports" under Windows. There is > another form? (WINAPI???) (From memory:) Under Linux and FreeBSD you usually have to be root to access ports AND ask permission with ioperm. See units manual, linux unit, function ioperm and maybe also the inport<x> and outport<x> functions there.

"16. The PORTS unit
16.1 Introduction...................

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?

Program of example:
Uses ports;
begin
  Writeln(Port[$378]);
end.

On the other hand, in the documentation it says:
"11.3.68 IOperm ................

See also ioperm (2)" <-- It is an error?

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

Reply by email

Marco van de Voort
to Luis R. Hilario
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.

Marco van de Voort ( or )

Reply by email

Luis R. Hilario
to Marco van de Voort: Hmm, no, I think that the docs are correct. Marco van de Voort ( or )
Marco van de Voort wrote 7 lines
> 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

Luis R. Hilario
to Alejandro Nestor Vargas: I don't know about unit ports, but I done this successfully by writing and reading…
Alejandro Nestor Vargas wrote 9 lines
> I have tried to use the parallel port under Linux and I cannot. > It always leaves with the error: 216 "General Protection fault". > I use the unit "Ports". I don't know about unit ports, but I done this successfully by writing and reading directly to /dev/port device. You must write here the address and then read or write data.

Gracias!

Ya sé como usar la unidad ports.

Aquí hablan sobre el tema:
http://www.linuxdoc.org/HOWTO/mini/IO-Port-Programming-2.html

Dicen que la otra forma es más rápida, pero las dos tienen sus ventajas y desventajas.

Imagino que hablas español. Verdad?

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

Reply by email