[fpc-pascal] x86.pp and oldlinux.pp

Jeff Wormsley daworm10 at comcast.net
Tue Nov 3 14:24:40 CET 2009

Holger Bruns wrote:
> Under the bottom line, the result is just the same. You need to become 
> a superuser on a linux system, if you want to compile source code for 
> accessing ports directly, regardless of the compiler or any other tool.
All modern OS's have this restriction.  Even on Windows, after ME (NT, 
XP and beyond) you cannot directly access ports anymore, like in the 
good old days with TP (and even those programs won't run on modern 
Windows machines).  To do so under Linux, you need to write a device 
driver that then exposes an interface to the userland application.  This 
is usually done in C.  There are several books available about writing 
device drivers under Linux.  If your device is simple, like a UART, you 
can probably easily adapt one of the examples to your use.  However, it 
sounds like your device is already supported (as /dev/ttyS2), so you 
shouldn't need to do this, unless you are doing non-standard things with 
the UART (maybe using the control signals for I/O that needs more 
precise timing than you can get through the ioctl mechanism, or 
something similar).  Yes, it is much harder than in the old days of DOS 
or Win98, but it is the proper way to do things.


I haven't smoked for 3 years, 2 months and 2 weeks, saving $5,284.87 and 
not smoking 35,232.49 cigarettes.

More information about the fpc-pascal mailing list