[[Linux]] [[Driver]] : Par Port

ToDo Need to lean more on parport handler :

http://lwn.net/Articles/driver-porting/

cat > ./parport.c <<EOF
#include <stdio.h>
#include <unistd.h>
#include <asm/io.h>
#define PORT 0x378
char tmp=0;
int main() {
if ( ioperm( PORT,1,1)) { perror("no perms"); exit(-1); }
outb( tmp, PORT);
return 0;
}

EOF

# EOF for cat
make parport
./parport ; echo $?
## no perms: Operation not permitted
## 255
su --
chmod u+s ./parport
./parport ; echo $?
## 0

MORE

parport.txt · Last modified: 2022/04/16 12:23 (external edit)
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki