Exemplo n.º 1
0
char *InitSys()
{
    int i;

    PortsFound = 0;
    for( i = 0; i < NUM_ELTS( PortTest ); ++i ) {
        if (!AccessPorts(PortTest[i], PortTest[i])) {
            printf("Failed to get I/O permissions. This program must run as root!\n");
            exit(-1);
            }
        if( CheckForPort( i, 0x55 ) && CheckForPort( i, 0xaa ) ) {
            PortAddress[ PortsFound++ ] = PortTest[ i ];
        }
        FreePorts(PortTest[i], PortTest[i]);
    }
    return( NULL );
}
Exemplo n.º 2
0
char *InitSys()
{
    SEL         global;
    SEL         local;
    int         i;

    DosGetInfoSeg( &global, &local );
    GInfoSeg = MK_FP( global, 0 );

    PortsFound = 0;
    for( i = 0; i < NUM_ELTS( PortTest ); ++i ) {
        AccessPorts( PortTest[i], PortTest[i] );
        if( CheckForPort( i, 0x55 ) && CheckForPort( i, 0xaa ) ) {
            PortAddress[ PortsFound++ ] = PortTest[ i ];
        }
        FreePorts( PortTest[i], PortTest[i] );
    }
    return( 0 );
}