Subject: Re: Mouse console support
To: None <tech-kern@netbsd.org>
From: Julio Merino <juli@merino.net>
List: tech-kern
Date: 02/01/2002 21:59:40
--45Z9DzgjV8m4Oswq
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Fri, Feb 01, 2002 at 07:30:40PM +0100, Lennart Augustsson wrote:
> I feel that the general archtecture of the OpenBSD mouse stuff is
> questionable. They have decided to have both userland and
> kernel stuff. Fair enough, but once you have a userland daemon
> I would expect that you put as much there as possible. I got the
> impression that the OpenBSD code had too much in the kernel (like
> code to decide about what you are selecting).
> Furthermore, it seems that this addition requires some addition to
> every machine dependent wscons driver. This is really a bad design.
> Maybe wscons is designed that way, if it is, it should be changed
> so that things like wsmoused can be added without MD code.
I've been thinking about this too. I guess that wscons holds a buffer
for each virtual terminal, with its "screen contents". getchar() can
read from this buffer directly, instead of reading video buffer.
This is more arch independant, and I guess this is the way to go, if
you have no objections.
Thanks!
>=20
> Maybe I'll have a look at the ws code some day, and give some more
> constructive critisism.
>=20
> -- Lennart
>=20
>=20
> Bang Jun-Young wrote:
>=20
> > On Wed, Jan 30, 2002 at 07:58:37PM +0100, Julio Merino wrote:
> > > Should I send it to the list for code veritication, or only to a
> > > commiter?
> >
> > I had a look at the OpenBSD code before, and I came to the
> > following conclusion: It shouldn't be committed as it is. Other
> > than the problem I said in the previous mail, there are too many
> > places in which variables of uppercase names are used in
> > assignment statements:
> >
> > CPY_START =3D row * N_COLS;
> > CPY_END =3D CPY_START + (N_COLS - 1);
> > ...
> > MOUSE_FLAGS |=3D MOUSE_VISIBLE;
> >
> > When I first saw the code, I felt like I was looking at 70's BASIC
> > source. IMHO, in the tradition of C only constants or variables of
> > which values are not modified should be written in uppercases (note
> > I'm not saying macro functions). They are defined in wsmoused.h as
> > follows:
> >
> > #define CPY_START (sc->sc_focus->cpy_start)
> > #define MOUSE_FLAGS (sc->sc_focus->mouse_flags)
> >
> > It would be good if those names were converted to lowercase ones and
> > prefixed with wsm_ or something like that.
> >
> > Also, it should be cleanly separated from the rest of sources so
> > that it is possible to compile optionally, i.e. options WSCONS_WSMOUSED
> > in the kernel config file, if considering there are quite a number
> > of people who issue objection to any new features that might make their
> > kernels bigger, even if it's relatively small and quite useful (most of
> > them are *real* i386 users, I guess).
> >
> > Jun-Young
> >
> > --
> > Bang Jun-Young <junyoung@mogua.com>
--=20
Of course it runs NetBSD - http://www.netbsd.org
Julio Merino (Slink) <juli@merino.net>
--45Z9DzgjV8m4Oswq
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (NetBSD)
Comment: For info see http://www.gnupg.org
iD8DBQE8WwG8zz00ZOPKycwRAkS+AJ4jjCspFUdJal8SfF2rIjYN7SdivwCdGh0F
FmXh9Bs/W05bre2KgtXoMRg=
=Zx8T
-----END PGP SIGNATURE-----
--45Z9DzgjV8m4Oswq--