public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] Console scrollback
Date: Fri, 2 Apr 2021 18:30:00 +0000	[thread overview]
Message-ID: <YGdiqHoM+SPijiAb@ACM> (raw)
In-Reply-To: <YAiLjZKM9eGrZjY2@ACM>

Hello, Gentoo.

On Wed, Jan 20, 2021 at 19:59:09 +0000, Alan Mackenzie wrote:

[Context: Scrolling on the Linux text console using the keys
<shift><PgUp> and <shift><PgDn> has been removed from the kernel.  This
is not a Good Thing.]

> What I have in mind now is writing a Linux driver, a small piece of code
> which would piggy-back on the existing virtual terminal drivers, and
> simply pass everything through to and from the main driver, filtering out
> things relevant to scrolling, and processing these in my new driver.
> I've spent the last few evenings reading up on drivers, and reading the
> relevant source code from 4.19.97.  I can understand the kernel
> maintainers not being enthusiastic about the existing code.  But that
> dates from, I believe, the 1990s, when RAM was measured in megabytes, and
> processor speeds in megahertz.  Optimisation for speed and store usage
> just isn't important any more.

I finally got around to looking into this seriously in the last couple
of weeks.  The above plan turned out not to be the right thing.

I've now cobbled together a working console scroll on Linux
5.4.80-gentoo-r1.  In the end, I reused much of the old machinery which
was still present in 4.19.97.  Once I've tidied it up, I hope that the
resulting patch file will apply cleanly also to later versions than
5.4.80-r1.

As a matter of interest, the kernel code for the console is not the
easiest in the world to deal with, having too many abstractions and too
few comments.  ;-(

I've enhanced the mechanism so that each tty has its own scrollback
buffer, rather than one buffer being shared between all tty's.  The
default size of these buffers is now 128kB, but can be set in make
menuconfig.  I'm intending to make sharing a buffer between all tty's be
an option, but haven't implemented that yet.

The code, as yet, is a bit scruffy (in fact, very scruffy), and I have
several technical problems:

(i) The scrolling doesn't work on /dev/tty1 aka the console.
(ii) When, e.g., /dev/tty6 has been scrolled upwards a bit, and then
  <Alt><F2> pressed to go to /dev/tty2, on returning to /dev/tty6, the
  scrolling has been cancelled and the cursor is no longer visible.
  However, the scrollback buffer is still present.

I think I'm fairly likely to be able to solve (ii).  However, (i), the
problem with /dev/tty1, has me baffled.  I don't know where to start
looking for the problem.  If anybody with some kernel knowledge could
make any suggestions, I'd be very grateful.

-- 
Alan Mackenzie (Nuremberg, Germany).


  parent reply	other threads:[~2021-04-02 18:30 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 10:30 [gentoo-user] Console scrollback Peter Humphrey
2021-01-13 10:38 ` Michael
2021-01-13 10:55   ` Peter Humphrey
2021-01-13 11:21     ` Andreas Fink
2021-01-13 11:46       ` Peter Humphrey
2021-01-13 18:14 ` Alan Mackenzie
2021-01-13 18:44   ` Neil Bothwick
2021-01-14 16:00     ` Alan Mackenzie
2021-01-13 19:14   ` Peter Humphrey
2021-01-13 19:32   ` Grant Taylor
2021-01-13 21:56     ` Alan Mackenzie
2021-01-13 22:14       ` Grant Taylor
2021-01-14 16:39         ` karl
2021-01-13 22:15       ` [gentoo-user] " Grant Edwards
2021-01-13 23:01         ` Neil Bothwick
2021-01-13 23:06           ` Grant Edwards
2021-01-14  0:00             ` Grant Taylor
2021-01-14  1:25               ` Grant Edwards
2021-01-14 17:10                 ` Grant Taylor
2021-01-14  0:12             ` Neil Bothwick
2021-01-14 16:06         ` Alan Mackenzie
2021-01-16 12:01           ` Alan Mackenzie
2021-01-17  5:17             ` [gentoo-user] " Thomas Mueller
     [not found]             ` <20210117051748.E3239E0869@pigeon.gentoo.org>
2021-01-17  9:16               ` Philip Webb
     [not found]             ` <20210117051748.B8178E0863@pigeon.gentoo.org>
2021-01-19 17:09               ` Laurence Perkins
2021-01-20 19:59                 ` Alan Mackenzie
2021-01-21  9:32                   ` Wols Lists
2021-01-21  8:58                     ` Jorge Almeida
2021-01-21 12:40                       ` Remco Rijnders
2021-01-21 13:00                         ` Jorge Almeida
2021-01-25 12:42                     ` Alan Mackenzie
2021-04-02 18:30                   ` Alan Mackenzie [this message]
2021-04-02 19:32                     ` karl
2021-04-02 20:49                       ` Alan Mackenzie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YGdiqHoM+SPijiAb@ACM \
    --to=acm@muc.de \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox