Howto write on parallel port
Alexios Chouchoulas
alexios at vennea.demon.co.uk
Thu Mar 27 03:15:24 EET 1997
On Tue, 25 Mar 1997, Compulink Gateway of Florina wrote:
> 8a h8ela an 3erei kaneis na mou pei pws mporw mesa apo
> kapoio programma grameno se C na grapsei dedomena
> kateu8eian sthn parallhlh porta (LPT1 h LPT2).
> Dokimazw me thn outp kai thn outportb alla den yparxoun
> se kamia library sto linux.
Pragmati. Skepsou to logo: an kathe programma sto user (i.e. non-kernel)
space mporouse na grapsei kata boulhsh sta x86 I/O ports, (a) den tha eixame
Unix alla DOS [= portability mhden], (b) tha ginotan ena mpougio kathws
kammia dekaria diaforetika programmata tha prospathousan na milhsoun sto
idio kommati tou hardware. :-)
Etsi loipon o kernel sou zhtaei na tou peis to port theleis kai aftos ta
kanonizei me to hardware (aftos einai kai o skopos yparkshs tou kernel --
sou krybei to hardware).
Sto /usr/include/linux/ioport.h (xm, isws tha eprepe na pw oti milwa gia
2.0.xx kernels) tha breis ta prototypes twn functions pou xreiazesai gia na
desmefseis enan arithmo apo I/O ports. Afto prepei na ginei *PRIN* ta
xrhsimopoihseis, alliws logika tha exeis problhma. Prin bgeis apo to
programma sou, ws deigma evgeneias, prospathise na apeleftherwseis o,ti
exeis zhthsei. Kalou kakou.
Afou o kernel sou apanthsei katafatika (= sou epitrepei na xrhsimopoihseis
ta ports), kai MONO tote, mporeis na kaneis kati san to ekshs:
#include <asm/io.h>
char a=inb(0x378);
outb(a,0x378);
Yparxoun epishs macros gia na xeirizesai words (inw, outw) kai longs (inl,
outl). Des to sxetiko header file gia leptomereies.
Alexios Chouchoulas '88 ,88' ,88' alexios at vennea.demon.co.uk
The Unpronouncable One ,o88oooo88ooooo88oo, axc at dcs.ed.ac.uk
==================================================================
For help on using this list (linux-greek-users), send a message to
"majordomo at argeas.argos.hol.gr" with one line of text: "help".
For any problem send e-mail to owner-linux-greek-users
==================================================================
More information about the Linux-greek-users
mailing list