how do I use ioctl(,MCAIO,) in ISC2.2

Dave Bullis dbullis at cognos.UUCP
Thu Apr 4 03:42:33 AEST 1991


I am trying to set my Herculus mono-graphics board into graphics mode
with following code.  However the 'ioctl(0,MCAIO,&arg)' call fails
with 'Invalid argument' on the first call to outb().
'ioctl(0,KDDISPTYPE,)' tell me that 0x3bf is a valid port, so what's going on?

(The code is adapted from the GL plot package posted some years ago)


#include <stdio.h>
#include <sys/types.h>
#ifdef ISC
#include <sys/at_ansi.h>
#include <sys/kd.h>
#endif

void outb( port, data )
    int port;
    int data;
{
    struct port_io_arg arg;
    int old_errno;
    arg.args[0].dir = OUT_ON_PORT;
    arg.args[0].port = port;
    arg.args[0].data = data;
    arg.args[1].port = arg.args[2].port = arg.args[3].port = 0;
    if (ioctl( 0, MCAIO, &arg )==-1) {
>>>>	perror("ioctl(,MCAIO, &arg)"); <<<<
	exit(1);
    }
}

setmode(mode)
int             mode;
{
    register int    i;
    struct kd_disparam disparam;

    switch (mode) {
    case 8:
	if(ioctl(0,KDENABIO,0)==-1) {
	    perror("ioctl(0,KDENABIO,0)");
	    exit(1);
	}
	outb(0x3bf, 0x03);			/* "hgc full" */
	for (i = 0; i < 12; i++) {
	    outb(0x3b4, i);
	    outb(0x3b5, gmode[i]);
	}
	outb(0x3b8, 0x0A);			/* enable graphics page 0 */
	break;
    . . .
-- 
Dave Bullis        Cognos, Inc     VOICE: (613) 738-1440 FAX: (613) 738-0002
3755 Riverside Dr. P.O. Box 9707    WORK: uunet!mitel!cunews!cognos!dbullis
Ottawa, Ontario,   CANADA  K1G 3Z4  HOME: dave at sillub.ocunix.on.ca
"I didn't know the terminals were haunted.  The salesman didn't tell us."



More information about the Comp.unix.sysv386 mailing list