Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 May 2001 15:18:50 -0700
From:      John Reynolds~ <jreynold@sedona.ch.intel.com>
To:        Nik Clayton <nik@freebsd.org>
Cc:        doc@freebsd.org
Subject:   Re: Automatic text screenshots
Message-ID:  <15106.64714.806080.138718@hip186.ch.intel.com>
In-Reply-To: <20010516103515.A38101@catkin.nothing-going-on.org>
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>

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

--99NbkYPOeL
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit


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

Apparently it has.

As a followup, I've taken Nik's patches and "come closer" but I've been beaten
by time and lack of knowledge here. The attached patches apply "cleanly" to a
4.3-STABLE system but your kernel will not compile:

../../dev/syscons/syscons.c: In function `scioctl':
../../dev/syscons/syscons.c:789: structure has no member named `scr_buf'

this is because struct scr_stat no longer has a member called scr_buf. I did a
little poking around and at version 1.48 of syscons.h, is where scr_buf was no
more. Looks like a lot of stuff got moved into the softc structure. However,
at this point, that's where my knowledge runs out of gas. I don't know how to
modify Nik's code:

        copyout (scp->scr_buf, ptr->buf,
                 ptr->xsize*ptr->ysize * sizeof(u_short));

to point to the right buffer. scp->sc->????. 

The syscons patch applies to /usr/src/sys/dev/syscons, but the other patch no
longer applies to "console.h" but rather /usr/src/sys/sys/consio.h.

Hopefully somebody with more knowledge of syscons than me can take this and run
so that we can put this capability in place like Nik had envisioned.

-Jr


--99NbkYPOeL
Content-Type: text/plain
Content-Disposition: inline;
	filename="syscons.c.patch"
Content-Transfer-Encoding: 7bit

--- syscons.c.orig	Wed May 16 13:52:07 2001
+++ syscons.c	Wed May 16 14:25:03 2001
@@ -774,6 +774,24 @@
 	return EINVAL;
     }
 
+    case CONS_SCRSHOT:		/* get a screen shot */
+    {
+        scrshot_t *ptr = (scrshot_t*)data;
+	s = spltty();
+	if (ISGRAPHSC(scp)) {
+	    splx(s);
+	    return EOPNOTSUPP;
+	}
+	if (scp->xsize != ptr->xsize || scp->ysize != ptr->ysize) {
+	    splx(s);
+	    return EINVAL;
+	}
+	copyout (scp->scr_buf, ptr->buf,
+		 ptr->xsize*ptr->ysize * sizeof(u_short));
+	splx(s);
+	return 0;
+    }
+
     case CONS_GETVERS:  	/* get version number */
 	*(int*)data = 0x200;    /* version 2.0 */
 	return 0;

--99NbkYPOeL
Content-Type: text/plain
Content-Disposition: inline;
	filename="consio.h.patch"
Content-Transfer-Encoding: 7bit

--- consio.h.orig	Wed May 16 14:27:49 2001
+++ consio.h	Wed May 16 14:39:23 2001
@@ -213,6 +213,15 @@
 };
 typedef struct vid_info vid_info_t;
 
+/* holds "raw" color+character info when doing a "screen shot" (scrshot(1) */
+struct scrshot {
+    int                        xsize;
+    int                        ysize;
+    u_short*           buf;
+};
+typedef struct scrshot scrshot_t;
+
+
 #define CONS_GETINFO    _IOWR('c', 73, vid_info_t)
 
 /* get version */
@@ -232,6 +241,9 @@
 
 /* set the frame buffer window origin (equivalent to FBIO_SETWINORG) */
 #define CONS_SETWINORG	_IO('c', 104 /*, u_int */) 
+
+/* needed for scrshot(1) */
+#define CONS_SCRSHOT    _IOWR('c', 105, scrshot_t)
 
 /* use the specified keyboard */
 #define CONS_SETKBD	_IO('c', 110 /*, int */)

--99NbkYPOeL
Content-Type: text/plain; charset=us-ascii
Content-Description: .signature
Content-Transfer-Encoding: 7bit


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| John Reynolds               WCCG, CCE,      (space for rent, cheap!)      |
| Intel Corporation   MS: CH6-210   Phone: 480-554-9092   pgr: 602-868-6512 |
| jreynold@sedona.ch.intel.com  http://www-aec.ch.intel.com/~jreynold/      |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

--99NbkYPOeL--

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?15106.64714.806080.138718>