[comp.sys.hp] WMLOCATOR problem

rodean@hpfcdc.HP.COM (Bruce Rodean) (01/18/89)

wargo@odin.ucsd.edu (Dave Wargo) writes:
> I am in the process of setting up a HP9000/300 series machine.
> Most things seem to work OK however when I try to run wmstart
> I get the error message "cannot open WMLOCATOR".
> My question is simple. What the heck do I do now?

The device file /dev/locator as a default was linked to /dev/hil2 in
early revisions of HP-UX.  At some point there was a change made to a
customize script that would scan through the HIL devices looking for a
two-button mouse and link that to /dev/locator.  My guess is that you
don't have the mouse as the second device on your HIL loop.  The
following program might be helpful to change /dev/locator to the correct
HIL device.

Bruce Rodean
rodean%hpfcrn@hplabs.HP.COM

===========================cut here=============================
#include <sys/hilioctl.h>
#include <fcntl.h>

main()
{
	int f;
	int i;
	char id[16];
	static char hil_file[] = "/dev/hil?";
	int status;
	int found = 0;

	for(i=1;i<8;i++) {

		hil_file[8] = '0' + i;

		f = open(hil_file, O_RDONLY);

		if(f < 0) continue;

		status = ioctl(f, HILID, id);
		if(status) continue;

		close(f);

		if(id[0] == 0x68) {
			found = 1;
			break;
		}
	}

	if(!found) {
		printf("I can't find a mouse.\n");
		exit(1);
	}

	unlink("/dev/locator");

	status = link(hil_file, "/dev/locator");

	if(status) {
		printf("I found a mouse, but I couldn't link /dev/locator to it.\n");
		exit(2);
	}
}

gt@hpfcmr.HP.COM (George Tatge) (01/19/89)

>I am in the process of setting up a HP9000/300 series machine.
>
>Most things seem to work OK however when I try to run wmstart
>I get the error message "cannot open WMLOCATOR".
>
>Now in /dev there is a device called locator and if I edit the wmstart
>script and comment out the call for locator a window and cursor will
>appear.  I can move the cursor with control keys but not the mouse (i
>assume that locator is for the mouse).
>
>My question is simple. What the heck do I do now?
>
Check the address on /dev/locator.  It probably looks something like
0x000020.  It's the second least significan digit ("2" here) that
describes where in the HIL loop the mouse is. If it is a "2" it is
assumed that there is a keyboard and then a mouse.  If you have something
else (eg. a knob box) in the loop before the mouse, you need a different
address on /dev/locator.  Note: somethings (eg. a 9 knob box use
more than one address).  


>Ice Cream, it isn't just for breakfast anymore.
>----------

g (somethings are good for you, somethings are good) t

rocky@hpfcmr.HP.COM (Rocky Craig) (01/19/89)

George is correct but obtuse (I can say that because he's a friend of mine :-).

Windows/9000 expects a locator device, such as an HP-HIL mouse, to be 
specified by the device file /dev/locator (by default).  This device file 
needs to be a character device file with the HP-HIL major number (24); 
the minor number refers to the "address" of the device.

HP-HIL (HP Human Interface Link) is a proprietary interface which allows up
to seven devices to be connected.  At boot time each connected device is
automatically given an address from 1 to 7.  The device closest to the SPU
is address one.  Passive devices (such as the 46081A Extender) do not consume
an address.  Some devices consume more than one (the knob box takes three).

A standard HP-UX installation will provide device files for all possible
HIL devices (/dev/hil1 through /dev/hil7).  The recommended way
to get a correct device file for /dev/locator is to link the appropriate
hil[1234567] device file to /dev/locator.  For example, if you have
a security module (HP46084A), a keyboard, and then the mouse,

# ln /dev/hil3 /dev/locator		(as superuser)

You could also set $WMLOCATOR to point to the correct device file.

Rocky Craig
Hewlett-Packard Product Support

gates@hpfcdc.HP.COM (Bill Gates) (01/20/89)

Rocky is correct but ugly (I can say that because I don't sit near him :-)

Rocky says:

>The device closest to the SPU is address one.

Oh, I see!  If I want a particular device to be device 1, I just move it so
that it's the closest one to the SPU!  Wow!  :-)  :-)

The HP-HIL device connected directly to the SPU is address one.  The device
connected to device 1 is at address 2, and so on.

Bill