/* * A program to set the bits on parallel port * * Copyright (C) 2006, Daniel Rozsnyo * * * Written for controlling the fans: * * bit: weight: function: * 0 1 0 = 7V, 1 = 12V * 1 2 front top fan * 2 4 front bottom fan * 3 8 cpu fan * 4 16 rear fan */ #include #define _XOPEN_SOURCE 500 #include #include #include #define LPT_PORT_ADDR 0x0378 int main( int argc, char* argv[] ) { int data; ioperm( LPT_PORT_ADDR, 1, 255 ); sscanf( argv[1], "%d", &data ); outb( data, LPT_PORT_ADDR ); return 0; }