I've been writing a user space driver for
a proprietary ISA card for linux.I've used ioperm to give me access to the ports
(using inw, outw) and mmap of /dev/mem to give me access to the
memory.
This all works great if my ISA card is present.
But if it
doesn't exist my code seg faults when I try to access the memory or ports which
aren't there.
So my question is... how can I determine if the card exists
or not without my code seg faulting?
Is this possible without writing a
real kernal space driver?
Thanks very much,
-Hugh
(ps: I'm
using g++ on Redhat 8.0)