Path: utzoo!utgpu!cunews!cognos!dbullis From: dbullis@cognos.UUCP (Dave Bullis) Newsgroups: comp.unix.sysv386 Subject: how do I use ioctl(,MCAIO,) in ISC2.2 Message-ID: <9492@cognos.UUCP> Date: 3 Apr 91 17:42:33 GMT Reply-To: dbullis@cognos.UUCP (Dave Bullis) Organization: Cognos Inc., Ottawa, Canada Lines: 57 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 #include #ifdef ISC #include #include #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@sillub.ocunix.on.ca "I didn't know the terminals were haunted. The salesman didn't tell us."