From b58137ce9ca6d99e7bb0282f5da4f29aebbfd970 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Wed, 26 Jun 2013 15:59:47 +0200 Subject: [PATCH] parport: ECR = 0x00 --- parport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/parport.c b/parport.c index 7167477..798cf30 100644 --- a/parport.c +++ b/parport.c @@ -8,6 +8,7 @@ #include static const int port=0x37a; +static const int port_ecr=0x37a+0x400; #define LENGTH(x) (sizeof(x)/sizeof(*(x))) @@ -19,10 +20,11 @@ static void cleanup(void) { int main(void) { uint8_t out=0x24; - if (ioperm(port,1,1)!=0) { - fprintf(stderr,"ioperm 0x%x: %m\n",port); + if (iopl(3)!=0) { + fprintf(stderr,"iopl 3: %m\n"); exit(EXIT_FAILURE); } + outb(0x00,port_ecr); // Standard Mode int i=tcgetattr(0,(struct termios *)&tios); assert(i==0); atexit(cleanup); -- 1.8.3.1