[comp.unix.i386] ATI VGA Wonder

tony@oha.UUCP (Tony Olekshy) (12/29/89)

In message <1989Dec25.164606.1072@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM (Karl Denninger) writes:
>
> NO!  The ATI bus mouse is not recognized here by either SCO or ISC's unix,
> although it does work fine under MSDOS.  Neither ISC or SCO will support
> that configuration, and ATI doesn't know why it doesn't work (nor do SCO or
> ISC).  It may be 90% Microsoft bus mouse compatible, but it's not 100%.

Hmm, works here w/AMI 386 @ 25 + Xenix 2.3.1, most of the time.
Is the net's experience is that it never works, or is intermittent?

--
Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).

scottw@ico.isc.com (Scott Wiesner) (12/30/89)

> In message <1989Dec25.164606.1072@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM (Karl Denninger) writes:
>>
>> NO!  The ATI bus mouse is not recognized here by either SCO or ISC's unix,
>> although it does work fine under MSDOS.  Neither ISC or SCO will support
>> that configuration, and ATI doesn't know why it doesn't work (nor do SCO or
>> ISC).  It may be 90% Microsoft bus mouse compatible, but it's not 100%.

Worked fine on my machine when I tested it!  The one I got from them was
actually a logitec bus mouse.  

Scott Wiesner
Interactive Systems
X Development Group

karl@ddsw1.MCS.COM (Karl Denninger) (12/30/89)

In article <397@oha.UUCP> tony@oha.UUCP writes:
>In message <1989Dec25.164606.1072@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM (Karl Denninger) writes:
>>
>> NO!  The ATI bus mouse is not recognized here by either SCO or ISC's unix,
>> although it does work fine under MSDOS.  Neither ISC or SCO will support
>> that configuration, and ATI doesn't know why it doesn't work (nor do SCO or
>> ISC).  It may be 90% Microsoft bus mouse compatible, but it's not 100%.
>
>Hmm, works here w/AMI 386 @ 25 + Xenix 2.3.1, most of the time.
>Is the net's experience is that it never works, or is intermittent?

We're talking about Unix here....

Xenix may well work, but we haven't tried that.  I need it to work with Unix
(for "X" windows, among other things).

--
Karl Denninger (karl@ddsw1.MCS.COM, <well-connected>!ddsw1!karl)
Public Access Data Line: [+1 708 566-8911], Voice: [+1 708 566-8910]
Macro Computer Solutions, Inc.		"Quality Solutions at a Fair Price"

tron1@tronsbox.UUCP (HIM) (12/30/89)

>>> NO!  The ATI bus mouse is not recognized here by either SCO or ISC's unix,
>>> although it does work fine under MSDOS.  Neither ISC or SCO will support
>>> that configuration, and ATI doesn't know why it doesn't work (nor do SCO or

Just bite the bullet and get the Logiteck 3 button BUS mouse. It's pertty
inexpensive, FULLY supported , and has good ergonomics.

****************************************************************************
"Perfume and leather baby , you and me together baby,
  what good is living in paradise, if you don't let yourself once or twice."
 -Tiffany  
 
 Kenneth J. Jamieson ---- THE BOSS at Xanadu Enterprises Inc.
      UUCP: tron1@tronsbox.UUCP  BEST PATH ---> uunet!tronsbox!tron1 
      Sysop, Romantic Encounters BBS - (201)759-8450 / (201)759-8568 
****************************************************************************

ke4zv@kd4nc.UUCP (Gary Coffman) (01/02/90)

In article <1989Dec29.213443.8335@ddsw1.MCS.COM> karl@mcs.MCS.COM (Karl Denninger) writes:
>In article <397@oha.UUCP> tony@oha.UUCP writes:
>>In message <1989Dec25.164606.1072@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM (Karl Denninger) writes:
>>>
>>> NO!  The ATI bus mouse is not recognized here by either SCO or ISC's unix,
>>> although it does work fine under MSDOS.  Neither ISC or SCO will support
>>> that configuration, and ATI doesn't know why it doesn't work (nor do SCO or
>>> ISC).  It may be 90% Microsoft bus mouse compatible, but it's not 100%.
>>
>>Hmm, works here w/AMI 386 @ 25 + Xenix 2.3.1, most of the time.
>>Is the net's experience is that it never works, or is intermittent?
>
>We're talking about Unix here....

The problem with the ATI bus mouse is that it is not a Microsoft INPort Bus
Mouse. ISC's driver does a signature check to make sure it is talking to an
honest to GOD INPort chip. This fails of course with the ATI bus mouse. It
took me two weeks of digging to find this nasty. Another problem with the 
ATI Video Wonder and a Micronics 20Mhz cacheing motherboard is that neither
a warm boot nor a hardware reset will work. You get a machine that won't
reboot. The ONLY way to reboot this combination is the big red switch. I
never did solve this one. Thankfully, GOD stepped in at this point and
rebooted my system with a few mega-amps of lightning and my insurance company
bought me some nice new 33Mhz hardware.-)-)

Gary Coffman

larry@nstar.UUCP (Larry Snyder) (01/02/90)

> The problem with the ATI bus mouse is that it is not a Microsoft INPort Bus
> Mouse. ISC's driver does a signature check to make sure it is talking to an
> honest to GOD INPort chip. This fails of course with the ATI bus mouse. It

I hope that there is *some* way to use the ATI mouse under X 11.3 (1.0)
with 386/ix 2.02.

-- 
          Larry Snyder, Northern Star Communications, Notre Dame, IN USA 
                uucp: larry@nstar -or- ...!iuvax!ndmath!nstar!larry
      "NO! QNX is non-standard, not compatible, and is no more Unix than DOS!"

tony@oha.UUCP (Tony Olekshy) (01/02/90)

In message <1989Dec29.213443.8335@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM
(Karl Denninger) writes:
=
= In article <397@oha.UUCP> tony@oha.UUCP writes:
= >
= >Hmm, works here w/AMI 386 @ 25 + Xenix 2.3.1, most of the time.
= >Is the net's experience is that it never works, or is intermittent?
= 
= We're talking about Unix here....
= 
= Xenix may well work, but we haven't tried that.  I need it to work with Unix
= (for "X" windows, among other things).

Well, since my article 397, we have also gotten the ATI Bus Mouse to work
with SCO Unix 3.2 (usemouse) as well.  Don't know about X yet, but will keep
you posted as we continue to experiment.

--
Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).

karl@ddsw1.MCS.COM (Karl Denninger) (01/02/90)

In article <3325@kd4nc.UUCP> ke4zv@kd4nc.UUCP (Gary Coffman) writes:

>The problem with the ATI bus mouse is that it is not a Microsoft INPort Bus
>Mouse. ISC's driver does a signature check to make sure it is talking to an
>honest to GOD INPort chip. This fails of course with the ATI bus mouse. It
>took me two weeks of digging to find this nasty. 

Does anyone have a patch to disable that signature check?  It would be nice
to have!

--
Karl Denninger (karl@ddsw1.MCS.COM, <well-connected>!ddsw1!karl)
Public Access Data Line: [+1 708 566-8911], Voice: [+1 708 566-8910]
Macro Computer Solutions, Inc.		"Quality Solutions at a Fair Price"

karl@ddsw1.MCS.COM (Karl Denninger) (01/02/90)

In article <399@oha.UUCP> tony@oha.UUCP writes:
>In message <1989Dec29.213443.8335@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM
>(Karl Denninger) writes:
>=
>= In article <397@oha.UUCP> tony@oha.UUCP writes:
>= >
>= >Hmm, works here w/AMI 386 @ 25 + Xenix 2.3.1, most of the time.
>= >Is the net's experience is that it never works, or is intermittent?
>= 
>= We're talking about Unix here....
>= 
>= Xenix may well work, but we haven't tried that.  I need it to work with Unix
>= (for "X" windows, among other things).
>
>Well, since my article 397, we have also gotten the ATI Bus Mouse to work
>with SCO Unix 3.2 (usemouse) as well.  Don't know about X yet, but will keep
>you posted as we continue to experiment.

What did you have to do to make it work?  We haven't gotten that lucky yet!
(SCO Unix 3.2 hasn't worked with the ATI Bus mouse for us!)

--
Karl Denninger (karl@ddsw1.MCS.COM, <well-connected>!ddsw1!karl)
Public Access Data Line: [+1 708 566-8911], Voice: [+1 708 566-8910]
Macro Computer Solutions, Inc.		"Quality Solutions at a Fair Price"

larry@nstar.UUCP (Larry Snyder) (01/03/90)

> = Xenix may well work, but we haven't tried that.  I need it to work with Unix
> = (for "X" windows, among other things).
> 
> Well, since my article 397, we have also gotten the ATI Bus Mouse to work
> with SCO Unix 3.2 (usemouse) as well.  Don't know about X yet, but will keep
> you posted as we continue to experiment

Likewise I will keep everyone up to date with my efforts of getting
the ATI mouse working with 386/ix X 1.00.
-- 
          Larry Snyder, Northern Star Communications, Notre Dame, IN USA 
                uucp: larry@nstar -or- ...!iuvax!ndmath!nstar!larry
      "NO! QNX is non-standard, not compatible, and is no more Unix than DOS!"

news@brian386.uucp (News Administrator) (01/04/90)

karl@ddsw1.MCS.COM (Karl Denninger) writes:

>In article <3325@kd4nc.UUCP> ke4zv@kd4nc.UUCP (Gary Coffman) writes:

>>The problem with the ATI bus mouse is that it is not a Microsoft INPort Bus
>>Mouse. ISC's driver does a signature check to make sure it is talking to an
>>honest to GOD INPort chip. This fails of course with the ATI bus mouse. It
>>took me two weeks of digging to find this nasty. 

>Does anyone have a patch to disable that signature check?  It would be nice
>to have!

Ok, I am suprised noone has done this previously.  I have the source to
a logitech bus mouse which was originally posted by John Plocher, which
I am now going to repost and waste the worlds band width.  May GOD and
everyone forgive me.

PS> If you get it working, I would appreciate the fix, I don't even have
	time to look at the code this month.

--8<--8<--8<--8<--8<--8<--8<--8< cut here >8-->8-->8-->8-->8-->8-->8-->8--
:
#!/bin/sh
#    This is a shell archive created by yasa (1.74jmp).
#    Run the following text with /bin/sh to extract.
#
#    Archive: /usr/src2/public/drivers/mouse/ms.driver        
#
#    This archive is a complete distribution by itself.
#
#    Packed under unix by plocher@lessa (John Plocher)
#    Date: Tue Jun  6 23:30:38 1989
#
#    This archive will not overwrite existing files
#    inless invoked with the -c flag: sh SHARNAME -c
#
PATH=/bin:/usr/bin ; export PATH

YASASTART=`pwd`

echo x - mouse.c
if [ -f mouse.c -a "${1}" != "-c" ] ;then
    echo "shar: will not overwrite 'mouse.c'"
else
    sed "s/^X//" << \!End-Of-mouse.c! > mouse.c
X/*
X * Simple mouse driver for the Logitech Bus Mouse
X * Mouse deltas and button state is accessed through an ioctl()
X *
X *	Written By
X *	John Plocher
X *	Jas Cluff
X *	Ken Chapin
X *
X *	This code is released into the Public Domain
X */
X
X/*
X**	Compile with    cc -Ml -c mouse.c	V/286  (V/AT)
X**			cc     -c mouse.c	V/386  (3.0 or 3.2)
X**
X**	Install in the kernel configuration directories
X**	generate a kernel & reboot off of it
X**	run the tst program to test out behavior
X*/
X
X#include	"sys/param.h"
X#include	"sys/types.h"
X#include	"sys/dir.h"
X#include	"sys/signal.h"
X#include	"sys/user.h"
X#include	"sys/errno.h"
X#include	"mouse.h"
X
X#ifdef DEBUG
X#  define Dprintf(string)	printf(string)
X#else
X#  define Dprintf(string)
X#endif
X
Xmsinit()
X{
X	/*	Is mouse there?		*/
X
X/* Test hardware registers to see if installed       TODO */
X
X	/*	Initailize registers	*/
X	outb(CONTROL, MOUSEDEFAULT);
X	outb(PORTC, PORTC_DISABLE_INTERRUPTS);
X
X	/*      Say hello world         */
X#ifdef USE_INTS
X	printf("ms 1.01 %x-%x %x Ints are used\n",
X#else
X	printf("ms 1.01 %x-%x %x No ints for now\n",
X#endif
X			PORTA, CONTROL, inb(SIGNATURE_PORT));
X}
X
Xmsstart()
X{
X	Dprintf("MSSTART\n");
X}
X
Xmsopen()
X{
X	Dprintf("MSOPEN\n");
X	/*	Enable interrupts	*/
X#ifdef USE_INTS
X	outb(PORTC, PORTC_ENABLE_INTERRUPTS);
X#endif
X}
X
Xmsclose()
X{
X	/*	Disable interrupts	*/
X	Dprintf("MSCLOSE\n");
X	outb(PORTC, PORTC_DISABLE_INTERRUPTS);
X}
X
Xmsread()
X{
X/* NOP - do nothing but disable interrupt generator on bus mouse board */
X	Dprintf("MSREAD\n");
X	outb(PORTC, PORTC_DISABLE_INTERRUPTS);
X}
X
Xmswrite()
X{
X/* NOP - do nothing but disable interrupt generator on bus mouse board */
X	Dprintf("MSWRITE\n");
X	outb(PORTC, PORTC_DISABLE_INTERRUPTS);
X}
X
Xmsioctl(dev, cmd, arg)
Xint dev, cmd, *arg;
X{
X	/*	Get mouse values for user	*/
X
X	/*
X	** The Bus Mouse board keeps a running delta between reads
X	** so all we do here is send it back to the user when she wants it
X	*/
X
X	register struct mousedat md;
X	register unsigned int i;
X
X	switch(cmd) {
X	case MIOGETDATA:outb(PORTC, READ_X_LOW);
X			md.deltax = inb(PORTA) & 0xf;
X			outb(PORTC, READ_X_HIGH);
X			md.deltax |= (inb(PORTA) & 0xf) << 4;
X
X			outb(PORTC, READ_Y_LOW );
X			md.deltay = inb(PORTA) & 0xf;
X			outb(PORTC, READ_Y_HIGH);
X			i = inb(PORTA);
X			outb(PORTC, PORTC_DISABLE_INTERRUPTS);
X			md.deltay |= (i & 0xf) << 4;
X			md.buttons = i >> 5;
X
X			if (copyout(&md, arg, sizeof md))
X				u.u_error = EFAULT;
X			break;
X
X	default:	u.u_error = EFAULT;
X			break;
X	}
X}
X
Xmsintr()
X{
X
X/*
X** Not Used - might be used to keep a running delta and send a signal to
X** the controlling tty if a button was pressed ....
X*/
X	/*	Respond to squeak	*/
X	Dprintf("M");
X}
X
!End-Of-mouse.c!
if [ "`wc -c mouse.c`" != "   2632 mouse.c" ]
then
echo '   mouse.c may be bad'
fi
fi
echo x - mouse.h
if [ -f mouse.h -a "${1}" != "-c" ] ;then
    echo "shar: will not overwrite 'mouse.h'"
else
    sed "s/^X//" << \!End-Of-mouse.h! > mouse.h
X/*	mouse.h:	header file for Logitech Bus Mouse driver	*/
X
X#ifndef MOUSE_H
X#define MOUSE_H
X
X/* #define USE_INTS	/* Should the driver use interrupts? */
X
X#define	PORTA	0x23c		/*	1100		*/
X#define	SIGNATURE_PORT	0x23d	/*	1101		*/
X#define	PORTC	0x23e		/*	1110		*/
X#define	CONTROL	0x23f		/*	1111		*/
X
X#define	SETMODE		0x80	/*	1xxx xxxx	*/
X	/* Group A */
X#define M_AMODE0	0x00	/*	x00x xxxx	*/
X#define M_AMODE1	0x20	/*	x01x xxxx	*/
X#define M_AMODE2	0x40	/*	x10x xxxx	*/
X#define M_AIN		0x10	/*	xxx1 xxxx	*/
X#define M_AOUT		0x00	/*	xxx0 xxxx	*/
X#define M_CUIN		0x08	/*	xxxx 1xxx	*/
X#define M_CUOUT		0x00	/*	xxxx 0xxx	*/
X	/* Group B */
X#define M_BMODE0	0x00	/*	xxxx x0xx	*/
X#define M_BMODE1	0x04	/*	xxxx x1xx	*/
X#define M_BIN		0x02	/*	xxxx xx1x	*/
X#define M_BOUT		0x00	/*	xxxx xx0x	*/
X#define M_CLIN		0x01	/*	xxxx xxx1	*/
X#define M_CLOUT		0x00	/*	xxxx xxx0	*/
X
X#define MOUSEDEFAULT	(SETMODE|M_AMODE0|M_AIN)	/* 1001 0000 */
X
X#define	READ_X_LOW	0x80	/*	1000 0000	*/
X#define	READ_X_HIGH	0xa0	/*	1010 0000	*/
X#define	READ_Y_LOW	0xc0	/*	1100 0000	*/
X#define	READ_Y_HIGH	0xe0	/*	1110 0000	*/
X
X#define	PORTC_ENABLE_INTERRUPTS		0x80	/*	1000 0000	*/
X#define	PORTC_DISABLE_INTERRUPTS	0x10	/*	0000 0000	*/
X
Xstruct	mousedat { 
X	unsigned char buttons; 
X	char deltax,deltay;
X};
X
X/* IOCTLS */
X#define	MIOGETDATA	(('M'<<8) | 0x01)	/* get mouse data */
X
X#endif
X
!End-Of-mouse.h!
if [ "`wc -c mouse.h`" != "   1334 mouse.h" ]
then
echo '   mouse.h may be bad'
fi
fi
echo x - tst.c
if [ -f tst.c -a "${1}" != "-c" ] ;then
    echo "shar: will not overwrite 'tst.c'"
else
    sed "s/^X//" << \!End-Of-tst.c! > tst.c
X
X/*
X**	Test program for Mouse Driver
X*/
X
X/* #define USE_GFX /* Microport 2.4 (286) or 3.0e (386) graphics interface */
X
X#include <sys/io_op.h>
X#include <sys/types.h>
X#ifdef USE_GFX
X#include <gfx.h>
X#endif
X#include "mouse.h"
X
Xint     mousefd;
X
X#ifdef USE_GFX
XGfx_Bitmap bm;
X#endif
X
Xmain()
X{
X	register struct mousedat	new,old;
X	register int xpos, ypos;
X
X	old.deltax = old.deltay = old.buttons = 1;
X
X	if ((mousefd = open("/dev/mouse")) == -1) {
X		perror("open of mouse device");
X		exit(1);
X	}
X
X#ifdef USE_GFX
X	if (!(bm = gfx_open())) {
X		perror("open of gfx");
X		exit(1);
X	}
X	gfx_mode(bm, GRAPHIC);
X	gfx_clear(bm, BLACK);
X	ega_flush();
X#else
X#endif
X
X	xpos = ypos = 1;
X	while (old.buttons != 7) {	/* press all 3 buttons to quit */
X		readmouse(&new);
X		if (memcmp(&old, &new, sizeof(struct mousedat))) {	
X#ifdef USE_GFX
X            gfx_rect(bm,xpos-1, ypos-1,xpos+1, ypos+1,7+old.buttons,GFX_XOR);
X			xpos += new.deltax; ypos += new.deltay;
X            gfx_rect(bm,xpos-1, ypos-1,xpos+1, ypos+1,7+new.buttons,GFX_XOR);
X			ega_flush();
X			memcpy(&old, &new, sizeof(struct mousedat));
X#else
X			xpos += new.deltax; ypos += new.deltay;
X		        printf("X=%03d Y=%03d  Buttons=%c%c%c\n", xpos, ypos,
X				   new.buttons & 1 ? '*' : ' ',
X				      new.buttons & 2 ? '*' : ' ',
X				         new.buttons & 4 ? '*' : ' ' );
X#endif
X		}
X	}
X#ifdef USE_GFX
X	gfx_dot(bm,xpos, ypos, BLACK, GFX_SRC);
X	ega_flush();
X	gfx_mode(bm, ALPHA);
X#else
X#endif
X}
X
Xreadmouse( md )
Xregister struct mousedat *md;
X{
X	if ((ioctl(mousefd, MIOGETDATA, md)) == -1) {
X		perror("IOCTL failed on /dev/mouse");
X		exit(2);
X	}
X}
X
!End-Of-tst.c!
if [ "`wc -c tst.c`" != "   1584 tst.c" ]
then
echo '   tst.c may be bad'
fi
fi

-- 
Wm. Brian McCane                    | Life is full of doors that won't open
                                    | when you knock, equally spaced amid
Disclaimer: I don't think they even | those that open when you don't want
            admit I work here.      | them to. - Roger Zelazny "Blood of Amber"

tony@oha.UUCP (Tony Olekshy) (01/06/90)

In <1990Jan2.152037.3553@ddsw1.MCS.COM>, karl@ddsw1.MCS.COM (Karl Denninger)
writes:
>
> In article <399@oha.UUCP> tony@oha.UUCP writes:
> >
> > Well, since my article 397, we have also gotten the ATI Bus Mouse to work
> > with SCO Unix 3.2 (usemouse) as well.  Don't know about X yet, but will
> > keep you posted as we continue to experiment.
> 
> What did you have to do to make it work?  We haven't gotten that lucky yet!
> (SCO Unix 3.2 hasn't worked with the ATI Bus mouse for us!)

The following is from my associate, Jim Hoover:

    How to make an ATI VGA bus mouse work with SCO Unix System V 3.2

1.  Make sure that your mouse is configured properly.  That is, enabled,
    using the primary port (23C) and IRQ5.  The vga board comes shipped with
    the mouse disabled so you have to boot to DOS and use the VSETUP.COM 
    program supplied by ATI to set the EEPROM configuration registers on the
    card.

    Options for configuration are: disabled, use primary port 23C, use
    secondary port 238; and use IRQ 2, 3, 4, or 5.

2.  mkdev mouse, relink and reboot

3.  When you boot the system you shoud get a hwconfig line something like

    name=mouse base=0x23C offset=0x2 vec=05 dma=- type=busmouse

I don't know how the driver works but it does appear to sense the presence of
the mouse because when I setup the mouse to use the secondary port the mouse 
initiation line at boot vanished.


    These next instructions apply to getting usemouse to run

1.  Make sure that the appropriate entries are setup in /usr/lib/event/ttys
    to enable using the mouse on that tty.  A typical entry looks like
	tty01 msbusmouse

2.  Make sure that the permissions on the pty's (/dev/ptyp* /dev/ttyp* )
    used by usemouse are correct.  They should be 
	rw-rw-rw- bin bin
    Symptoms of incorrect permissions will be a message like
	can't open slave(errno 13)
    Or the fact that you can run usemouse as root but not as anyone else.

3.  If you use mscreen, there will likely be a problem caused by having
    a getty attached to the pty that usemouse grabs.  This will be pretty
    obvious as starting usemouse will cause a login prompt to appear!  My
    feeling is that mscreen should be attaching the getty to the pty, instead
    of having an /etc/inittab entry for getty permanently running on the pty.

    These next instructions apply to getting the mouse to run under VP/ix

1.  Beats me how to do it.  I made the mistake of trying to install the
    DOS driver from ATI and the resulting confusion required me to boot VP/ix
    off a floppy, fix the CONFIG.SYS file, and then power off the machine
    before the vga card and mouse stuff would work again (I am not sure if the 
    power off was essential but it didn't hurt).

Prof. Jim Hoover                   | Office +1 403 492 5401 or 5290
Dept. of Computing Science         | FAX    +1 403 492 1071
University of Alberta              | hoover@cs.ualberta.ca
Edmonton, Alberta, Canada T6G 2H1  | 

--
Yours, etc., Tony Olekshy (...!alberta!oha!tony or tony@oha.UUCP).