From owner-freebsd-doc Wed May 16 15:18:59 2001 Delivered-To: freebsd-doc@freebsd.org Received: from clio.sc.intel.com (scfdns01.sc.intel.com [143.183.152.25]) by hub.freebsd.org (Postfix) with ESMTP id 10D8A37B423; Wed, 16 May 2001 15:18:54 -0700 (PDT) (envelope-from jreynold@sedona.ch.intel.com) Received: from sedona.intel.com (sedona.ch.intel.com [143.182.218.21]) by clio.sc.intel.com (8.9.1a+p1/8.9.1/d: relay.m4,v 1.38 2001/05/09 12:49:45 root Exp $) with ESMTP id WAA03280; Wed, 16 May 2001 22:18:53 GMT Received: from hip186.ch.intel.com (hip186.ch.intel.com [143.182.225.68]) by sedona.intel.com (8.9.1a/8.9.1/d: sendmail.cf,v 1.14 2001/01/02 18:39:59 steved Exp $) with ESMTP id PAA18707; Wed, 16 May 2001 15:18:51 -0700 (MST) X-Envelope-From: jreynold@sedona.ch.intel.com Received: (from jreynold@localhost) by hip186.ch.intel.com (8.9.1a/8.9.1/d: client.m4,v 1.3 1998/09/29 16:36:11 sedayao Exp sedayao $) id SAA08318; Wed, 16 May 2001 18:18:51 -0400 (EDT) X-Authentication-Warning: hip186.ch.intel.com: jreynold set sender to jreynold@sedona.ch.intel.com using -f From: John Reynolds~ MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="99NbkYPOeL" Content-Transfer-Encoding: 7bit Message-ID: <15106.64714.806080.138718@hip186.ch.intel.com> Date: Wed, 16 May 2001 15:18:50 -0700 To: Nik Clayton Cc: doc@freebsd.org Subject: Re: Automatic text screenshots 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> X-Mailer: VM 6.92 under Emacs 20.7.2 Sender: owner-freebsd-doc@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org --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