Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 May 2001 10:50:36 +0100
From:      Nik Clayton <nik@freebsd.org>
To:        John Reynolds~ <jreynold@sedona.ch.intel.com>
Cc:        Nik Clayton <nik@freebsd.org>, doc@freebsd.org
Subject:   Re: Automatic text screenshots
Message-ID:  <20010517105036.A99290@catkin.nothing-going-on.org>
In-Reply-To: <15106.64714.806080.138718@hip186.ch.intel.com>; from jreynold@sedona.ch.intel.com on Wed, May 16, 2001 at 03:18:50PM -0700
References:  <01051513051703.00373@k6-2.weeble.com> <200105151727.f4FHRos64816@bmah-freebsd-0.cisco.com> <01051515135804.00373@k6-2.weeble.com> <20010516103515.A38101@catkin.nothing-going-on.org> <15106.64714.806080.138718@hip186.ch.intel.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--BwCQnh7xodEAoBMC
Content-Type: multipart/mixed; boundary="LQksG6bCIzRHxTLp"
Content-Disposition: inline


--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, May 16, 2001 at 03:18:50PM -0700, John Reynolds~ wrote:
Content-Description: message body text
>=20
> >   1.  Some patches to syscons which add this ioctl -- these patches are
> >       against 2.2.x, but syscons hasn't changed drastically in the past
> >      few years.
>=20
> Apparently it has.
>=20
> As a followup, I've taken Nik's patches and "come closer" but I've been b=
eaten
> by time and lack of knowledge here. The attached patches apply "cleanly" =
to a
> 4.3-STABLE system but your kernel will not compile:
>=20
> ../../dev/syscons/syscons.c: In function `scioctl':
> ../../dev/syscons/syscons.c:789: structure has no member named `scr_buf'
>=20
> this is because struct scr_stat no longer has a member called scr_buf.=20

It's become scp->vtb.vtb_buffer.

The attached patches apply cleanly, and the kernel builds OK, but I was
testing this on a remote machine I can't reboot with a new kernel, so I
haven't verified that the kernel works, or that the ioctl does what it's
supposed to do.

I also changed u_short to u_int16_t to be consistent with the rest of
syscons.

N
--=20
FreeBSD: The Power to Serve             http://www.freebsd.org/
FreeBSD Documentation Project           http://www.freebsd.org/docproj/

          --- 15B8 3FFC DDB4 34B0 AA5F  94B7 93A8 0764 2C37 E375 ---

--LQksG6bCIzRHxTLp
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="syscons2.diff"
Content-Transfer-Encoding: quoted-printable

Index: dev/syscons/syscons.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/dev/syscons/syscons.c,v
retrieving revision 1.357
diff -u -r1.357 syscons.c
--- dev/syscons/syscons.c	2001/05/01 08:12:05	1.357
+++ dev/syscons/syscons.c	2001/05/17 09:42:15
@@ -838,6 +838,24 @@
 	splx(s);
 	return 0;
=20
+    case CONS_SCRSHOT:		/* get a screen shot */
+    {
+	scrshot_t *ptr =3D (scrshot_t*)data;
+	s =3D spltty();
+	if (ISGRAPHSC(scp)) {
+	    splx(s);
+	    return EOPNOTSUPP;
+	}
+	if (scp->xsize !=3D ptr->xsize || scp->ysize !=3D ptr->ysize) {
+	    splx(s);
+	    return EINVAL;
+	}
+	copyout ((void*)scp->vtb.vtb_buffer, ptr->buf,
+		 ptr->xsize * ptr->ysize * sizeof(u_int16_t));
+	splx(s);
+	return 0;
+    }
+
     case VT_SETMODE:    	/* set screen switcher mode */
     {
 	struct vt_mode *mode;
Index: sys/consio.h
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/src/sys/sys/consio.h,v
retrieving revision 1.6
diff -u -r1.6 consio.h
--- sys/consio.h	2000/04/27 13:34:31	1.6
+++ sys/consio.h	2001/05/16 22:54:44
@@ -239,6 +239,16 @@
 /* release the current keyboard */
 #define CONS_RELKBD	_IO('c', 111)
=20
+/* Snapshot the current video buffer */
+#define CONS_SCRSHOT	_IOWR('c', 105, scrshot_t)
+
+struct scrshot {
+	int		xsize;
+	int		ysize;
+	u_int16_t*	buf;
+};
+typedef struct scrshot scrshot_t;
+
 /* get/set the current terminal emulator info. */
 #define TI_NAME_LEN	32
 #define TI_DESC_LEN	64

--LQksG6bCIzRHxTLp--

--BwCQnh7xodEAoBMC
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjsDnuEACgkQk6gHZCw343VkkACdEykLVAucUg0ngEC+CTkLFuFT
2dYAmwW8luHlHyQnFhflvkzogndCgdis
=aBLw
-----END PGP SIGNATURE-----

--BwCQnh7xodEAoBMC--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010517105036.A99290>