Subject: Re: serial mouse emulation for macs w/o adb...
To: M.R. Zucca <mrz5149@cs.rit.edu>
From: Bill Studenmund <wrstuden@loki.stanford.edu>
List: port-mac68k
Date: 05/22/1996 23:24:24
> >be happy to help them. One of the changes in going to the new serial
> >drivers is support for "child" drivers on a SCC chip driver. Right
> >now, we only have a tty child, but the sun3 port also has a keyboard
> >and a mouse driver.
>
> From experience, the Sun keyboard and mouse ports are well known. They're
> serial ports like any other but they happen to be labeled keyboard and mouse :)
True, but they interact with the upper layers of the kernel differently.
At least in NetBSD/sun3 & sparc, they attach differently (they aren't
tty's). I've not paid much attention to the specifics, but getting
mouse functions separated from kbd and from tty functions was the
motivation for Gordon Ross's work on the M.I. zs driver (of which we
are now using a form).
> > The advantage is that the code is much cleaner.
> >No if (this port == mouse port) stuff. The disadvantage is that the
> >connection of the mouse has to be done in the kernel config.
>
> Smarter still would be to pass in the tty of the mouse from the booter.
Hmm. This could be done, but it'd be a bit difficult. The thing with
these kbds or mice is that they aren't "ttys" to the system. Though
something in config like
zsc0 at obio?
zsaenb0 at nubus? (getting at your next request)
zsms* at zsc? channel ?
zstty* at zsc? channel ?
Where zsms is the mouse driver, and zstty is the standard tty.
The zsms probe routine would need to look at booter variables
and just not attach unless the booter told it to. Note: this
specific model's off as the zstty numbers are dynamic; adding
or removing the mouse changes serial port tty #'s.
> It's important not to hard code this kind of thing to only tty00 and tty01
> since one of the things on my "crazy wish list of functionality to add"(TM) is
> support for my Applied Engineering 4 port serial board. :)
Does it have z8530's on it? Zilog makes them, as does AMD. Other good
candidates are the 85230 ESCC. Note: they'd have to be directly
connected to the bus, no intermediate CPU. If so, you could
write code to handle probing, a slightly-different attach routine, and
a few different routines, and be set. Presto, zsaenb controller (zs Applied
Engineering NuBus). Basically you'd need to replace a few of the
routines in zs.c. Everything else should be set. Hopefully they did
things like Apple did.
If too many things are different, these drivers would need to be a different
character device type. You could still name them tty02, tty03, etc,
but they couldn't use the current drivers.
Oh, Sunny, you suggested looking @ Linux sources? We could just look
at the NetBSD isa drivers (/sys/dev/isa). They support Logitec
mice, Microsoft mice, and ps/2 mice.
Take care,
Bill