From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6I7-0000Bx-U9 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:00:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bK6I4-00084K-N4 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:00:11 -0400 Received: from mail-qk0-x242.google.com ([2607:f8b0:400d:c09::242]:34904) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bK6I4-000845-J8 for qemu-devel@nongnu.org; Mon, 04 Jul 2016 12:00:08 -0400 Received: by mail-qk0-x242.google.com with SMTP id t2so10227261qkh.2 for ; Mon, 04 Jul 2016 09:00:08 -0700 (PDT) Date: Mon, 4 Jul 2016 12:00:06 -0400 From: Kevin O'Connor Message-ID: <20160704160006.GA4549@morn.lan> References: <1467370471-20554-1-git-send-email-kraxel@redhat.com> <1467370471-20554-2-git-send-email-kraxel@redhat.com> <20160701154732.GA11200@morn.lan> <1467620195.15123.133.camel@redhat.com> <7c1baeab-b8b0-93d1-a9a2-054dfd92ece0@redhat.com> <1467636384.15123.177.camel@redhat.com> <20160704152648.GA2039@morn.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160704152648.GA2039@morn.lan> Subject: Re: [Qemu-devel] [RFC PATCH 1/2] serial console, output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: Paolo Bonzini , seabios@seabios.org, qemu-devel@nongnu.org On Mon, Jul 04, 2016 at 11:26:48AM -0400, Kevin O'Connor wrote: > At one point I looked through the sgabios code and was able to > understand how it did caching. I'll take another look and see if I > can describe it. So, if I read the sgabios code correctly, it allocates a buffer of: struct { u8 x, y; char c; } logbuf[256]; int logbuf_offset; Every character sent on the serial port is appended to "logbuf" in order, wrapping if necessary: logbuf[logbuf_offset++ % 256] = x, y, c. On a read, it scans backwards from logbuf_offset to find the last update to that cell. Interestingly, it doesn't store the attribute with the character - it's int1008 handler just returns the last attribute used anywhere on the screen. The code is only used if it is the sole vga code (as opposed to being used in addition to an existing vgabios). Does anyone know where one can find the original svn commit history for sgabios? Seems the original google code repo is no longer present. -Kevin