From owner-freebsd-current@FreeBSD.ORG Tue Aug 19 22:36:45 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 34172A43; Tue, 19 Aug 2014 22:36:45 +0000 (UTC) Received: from mail-qc0-x22e.google.com (mail-qc0-x22e.google.com [IPv6:2607:f8b0:400d:c01::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D5216385E; Tue, 19 Aug 2014 22:36:44 +0000 (UTC) Received: by mail-qc0-f174.google.com with SMTP id l6so6922488qcy.5 for ; Tue, 19 Aug 2014 15:36:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=1BUhFBva5G1qWu3A8/KZt9nZJ0J242+2JmJfC9C7cYA=; b=hUE98b01XDKMvCoDXzr3qT5hVIv33IWIOOLWm2h8UB8tsup5t5EjRIIGMcNf/LZuF7 JU+reCa/LlW4SApWGLXL5Wq5qTg4twiPrDO0rxMq5rtkOOV08lnZ3C35iQiTlYbp1uVN AU4qFtBKmwIWD6rC2xhRIlyYiJhgb+uY3Z6c33VosNHlkIzDvMMoPY6Vu4xSM1J8UMzc 1J8+5NqsmQOcaHE/6y014AAJggHSnQVRr82xFHYlnCt2/4GfLh1LMYJJ1QI21E1zmeLm WmtM559g98iV8fN8IkRsLScXZjBHJSLfgxjtngIVAqZ75eD4C4hoiagJnlB99Kry/cmS X5Qw== MIME-Version: 1.0 X-Received: by 10.229.38.3 with SMTP id z3mr71884366qcd.17.1408487804036; Tue, 19 Aug 2014 15:36:44 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.39.139 with HTTP; Tue, 19 Aug 2014 15:36:43 -0700 (PDT) In-Reply-To: <53F3A82D.4090000@FreeBSD.org> References: <20140812232807.0f3aa02570becec15e056af2@fbsd.es> <20140816011444.301a98d6187aca27e3a2481b@ddteam.net> <53EE9CFF.4080607@freebsd.org> <53F30DF3.1090301@dumbbell.fr> <53F37B2D.3070807@FreeBSD.org> <53F38D8E.8090605@freebsd.org> <53F39F3D.9010104@FreeBSD.org> <53F3A82D.4090000@FreeBSD.org> Date: Tue, 19 Aug 2014 15:36:43 -0700 X-Google-Sender-Auth: eZZpAx8eHQBIQAYzTIUj3xlPnZY Message-ID: Subject: Re: r269471 make unusable VT console From: Adrian Chadd To: =?UTF-8?B?SmVhbi1Tw6liYXN0aWVuIFDDqWRyb24=?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Aug 2014 22:36:45 -0000 Hi, On 19 August 2014 12:40, Jean-S=C3=A9bastien P=C3=A9dron wrote: > On 19.08.2014 21:20, Adrian Chadd wrote: >> Hey, this is cool! >> >> So hm, why are you still doing any reading? Don't you now have all the >> information you need to write out the font and cursor information for >> each given set of 8 pixels? > > I read a lot about VGA in the past days but I'm new to this interface, > so my reasonning may be wrong. Anyway, here it is: > > To write a group of 8 pixels with only 2 colors, I write a byte using > background color in an offscreen memory, read it back to load it in the > latches, put the foreground color in the Set/Reset register, then write > the character/cursor to its final location in video memory. Because the > background color almost never changes, only one read is made the first > time we load the background color, and then only writes. This is fast. > > If the group of 8 pixels uses 3 or more colors, I can't use Write Mode 3 > alone. I see two possibilities: > 1. Set Write Mode 0, then for each plane, compute the byte to write > (1 bit out of 4 of each pixel's color), activate one plane, write > the byte (repeat for each plane), restore Write Mode 3 and the > relevant registers. Yup. That's how I've done it in the past. There's no read required and computing that stuff on modern CPUs is really cheap. -a