I don't get any output on pin 2. What's the problem?
#include <stdio.h>
#include <unistd.h>
#include <sys/io.h>
#include <stdlib.h>
#include <iostream>
#define BASEPORT 0x378
using namespace std;
int main()
{
if (ioperm(BASEPORT, 3, 1))
{
perror("ioperm");
cout << "Error!" << endl;
exit(1);
}
cout << "Light off\n";
outb(0, BASEPORT);
sleep(2);
cout << "Light on\n";
outb(1, BASEPORT);
sleep(2);
if (ioperm(BASEPORT, 3, 0))
{
perror("ioperm");
cout << "Error" << endl;
exit(1);
}
exit(0);
}