A few things caught my eye: + if (iopl(3)) { printf("You need to be root.\n"); exit(1); }
Just use perror. This is going to be confusing if there is an error and you're running as root :-)
There are a few cases where there are pci cleanups and frees and such and then an immediate exit. I applaud the sentiment but, really, you're just as safe exiting without the cleanup. Just a thought ...
thanks, this is neat stuff.
ron