Subject: wscons ioctl's
To: None <tech-kern@netbsd.org>
From: Julio Merino <juli@merino.net>
List: tech-kern
Date: 02/03/2002 00:04:46
--liOOAslEiF7prFVr
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi all

I need to add two new ioctl's to wsdisplay, to get the mouse working.
I've added the following to wsconsio.h:

/* Character/attributes of a position */
struct wsdisplay_poscontent {
	struct wsdisplay_curpos pos;		/* position */
	u_int16_t character;			/* character */
	u_int16_t attr;				/* attributes */
};
#define WSDISPLAYIO_GETCHAR	_IOWR('W', 84, struct wsdisplay_poscontent)
#define WSDISPLAYIO_PUTCHAR	_IOW('W', 85, struct wsdisplay_poscontent)

I've been looking at wscons sources a bit more, and it seems that
the putchar function is already implemented (not ioctl). So I only need
to program getchar.

The first problem is that I don't know which is the proper place to add
the ioctl entry-point. I've seen two functions mainly:
- wsdisplay_internal_ioctl - This one only works through /dev/ttyE[0-9],
  which is not ok because wsmoused should work on active console, not on
  the console it was run on.
- wsdisplay_cfg_ioctl - It may work, though I don't know how to find the
  active console (through the /dev/ttyEcfg). Also, both functions do not
  seem related to this ioctl routine.

So, which is the logical place to add checking for the new ioctl's?

And second, where does wscons store screen data? in scr_data? And...
how data is stored, linear? Which is the recommended method to get a
character from the data?

Sorry for so much questions...

Thanks a lot!

PS: Why are so few comments in sources?

--=20
Of course it runs NetBSD - http://www.netbsd.org
Julio Merino (Slink) <juli@merino.net>

--liOOAslEiF7prFVr
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

iD8DBQE8XHCOzz00ZOPKycwRAubOAKCWHBd015YcKvYR+ub4zQ3Ud8sJgACff8qj
d8QOwnJWkQD9d0O0oZVBFpc=
=No5Q
-----END PGP SIGNATURE-----

--liOOAslEiF7prFVr--