Subject: Re: wscons ioctl's
To: Julio Merino <juli@merino.net>
From: Bang Jun-Young <junyoung@mogua.com>
List: tech-kern
Date: 02/06/2002 09:25:12
On Sun, Feb 03, 2002 at 12:04:46AM +0100, Julio Merino wrote:
> 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)
Wouldn't it be too expensive? On 80x25 terminal, you need 2000 ioctl's
to get attributes of all characters. I haven't calculated how many
ioctl's are needed for 128x48 console yet... :-)
How about this one:
struct wsdisplay_screeninfo {
u_int16_t top, bottom, left, right;
u_int16_t *charp; /* size = (bottom - top + 1) *
(right - left + 1) */
u_int16_t *attrp; /* same as above */
}
#define WSDISPLAYIO_GETSCREEN _IOWR('W', 84, struct wsdisplay_screeninfo)
Jun-Young
--
Bang Jun-Young <junyoung@mogua.com>