[fpc-devel]Ports under Linux

Luis R. Hilario luis at luis-digital.8m.com
Mon Feb 5 02:55:49 CET 2001


Marco van de Voort wrote:
> 
> > 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 |
 |-----------------------------|




More information about the fpc-devel mailing list