Subject: X11 on the hp300
To: None <port-hp300@sun-lamp.cs.berkeley.edu>
From: David Carrel <carrel@cisco.com>
List: port-hp300
Date: 04/08/1994 11:51:48
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"

I've been playing around with porting X11R5 to NetBSD since this weekend.
I have drawing working fine, but I still don't have input working.  Here's
what I have found:

The X code calls select() with the read descriptor mask including the
correct fd's for the hil devices corresponding to the keyboard and the
mouse.  However the mask never comes back with those fd's set.

So I wrote a quick and dirty program to test the hil devices.  (included
below)  This program opens the device /dev/hil1 and sets it to use the HPUX
read interface.  It then tries to do a read but the read blocks forever.
Now, somethings are working correctly on the hil devices.  I can use ioctls
to see what type of device it is (hilinfo.c), and when I use my hilread.c
program from a telnet session, I do indeed cause the normal keyboard action
on the console to stop.  But I get no data!

I'm going to start looking through the kernel sources now, but if someone
more familiar with the soures recognizes something here, please let me
know.  I am running a kernel made on 25 Feb '94, but I didn't make it so I
don't know much about it.  Maybe Herb can clue me in to what rev kernel
this is?

Thanks

Dave


------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"

#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <sys/ioctl.h>
#include <hpdev/hilioctl.h>

main()
{
  int fd, i;
  char buf[BUFSIZ];
  size_t length;

  if((fd = open("/dev/hil1", O_RDONLY)) == -1) {
    perror("open()");
    exit(-1);
  }

  if(ioctl(fd, HILIOCHPUX, 0) == -1) {
    perror("ioctl()");
    exit(-1);
  }

  if(read(fd, &buf[0], 1) == -1) {
    perror("read(first byte)");
    exit(-1);
  }
  length = (size_t)buf[0];

  printf("Packet is %d bytes long.\n", length);

  if(read(fd, &buf[0], length) == -1) {
    perror("read(packet)");
    exit(-1);
  }

  printf("Packet timestamp is %d, poll_record_header is %d.\n",
	 *((int *)&buf[0]), (int)buf[4]);

  printf("Packet Data is:");
  for(i = 5; i < length - 5; i++) {
    printf(" %d", (int)buf[i]);
  }
  printf("\n");

  exit(0);
}

------- =_aaaaaaaaaa0--

------------------------------------------------------------------------------