Here are the latest versions of my soft scrolling patch for the kernel
lines 5.10.xx and 5.14.xx. They fix bugs where a PC would crash if it
was initialised with a 25x80 console and later changed to a full
resolution frame buffer screen. It also now works (so I am told) for
kernels initialised with parameters like vga=791.
8
Many thanks for this.
I can confirm that it patches, compiles and works on 6.1 :)
Here is the latest version of my soft scrolling patch for the gentoo
kernel version 5.15.80. It will surely work on any reasonably recent
kernel version, and also on future versions. The new version doesn't
add any new functionality, it just patches the kernel giving rise to
fewer messages from the patch utility.
On Monday, 12 December 2022 18:23:28 GMT Alan Mackenzie wrote:
Here is the latest version of my soft scrolling patch for the gentoo
kernel version 5.15.80. It will surely work on any reasonably recent kernel version, and also on future versions. The new version doesn't
add any new functionality, it just patches the kernel giving rise to
fewer messages from the patch utility.
You've done it again! What a fine effort. It's saved me much wailing and gnashing of teeth.
Is there any chance of enabling gpm to work with it? That would save
yet more generations of tooth enamel. :)
Seriously, though, it's just wonderful as it is, and we all owe you a debt.
--
Regards,
Peter.
On Tue, Dec 13, 2022 at 03:44:49 +0000, Peter Humphrey wrote:
On Monday, 12 December 2022 18:23:28 GMT Alan Mackenzie wrote:
Here is the latest version of my soft scrolling patch for the gentoo kernel version 5.15.80. It will surely work on any reasonably recent kernel version, and also on future versions. The new version doesn't
add any new functionality, it just patches the kernel giving rise to fewer messages from the patch utility.
You've done it again! What a fine effort. It's saved me much wailing and gnashing of teeth.
Thanks for that!
Is there any chance of enabling gpm to work with it? That would save
yet more generations of tooth enamel. :)
Yes, that's been annoying me for some time, too - when the screen is scrolled, and one tries to mark a portion of text with GPM, it gets the
text that was on the screen before the scroll, and corrupts the display
of the text.
I had a look at it last night, and the problem is that the kernel
doesn't currently store the 32-bit unicode characters which have been scrolled off the screen - just the 8-bit character glyph codes together
with the 8-bit colour information. So it would triple the amount of information stored for each character position. That surely shouldn't
be a problem on today's machines, though - even with FRAMEBUFFER_CONSOLE_SOFT_SCROLLBACK_SIZE set to 512 kB, that would only
be 1.5 MB per console.
So yes, this should be doable. It's definitely more than a day's work, almost certainly less than a month's. I'll see what I can manage.
Seriously, though, it's just wonderful as it is, and we all owe you a
debt.
Thanks again!
--
Regards,
Peter.
Morning Alan,
On Thursday, 29 December 2022 19:50:18 GMT Alan Mackenzie wrote:
I've got a first version of a patch which attempts to handle GPM in conjunction with scrolling. It's imperfect - for example, I can't get it to select anything the first 66 lines of the console's displayed boot-up messages. Nevertheless it may be useful.
Please let me know of any problems you encounter with this new facility,
so that I can try to fix them. Thanks!
Bad news, I'm afraid. After following your instructions carefully, the
new kernel hangs early in the boot process. The first time I tried it
it seemed to be just as the first HID message had been displayed; the
second time I didn't see that (could be my eyes).
I've attached a photo of the console.
--
Regards,
Peter.
What I'm thinking here is that you might be installing a font which is
bigger than the 8x16 standard that you appear to be booting with. To
check this, would you please do:
# file /lib/rc/console/font
, which should return a message like:
/lib/rc/console/font: Linux/i386 PC Screen Font v1 data, 256 characters, Unicode directory, 8x16
What is the size of this font, here (where it says 8x16 for my font)?
The reason I ask is, I've got a horrible suspicion that one of the C functions which copies screen data when the screen size is changed can
only copy to a same sized or (possibly) _bigger_ screen (i.e. with a
smaller font). If this is indeed the case, it might explain why you're seeing a hang, here.
Hello Alan,
On Saturday, 31 December 2022 14:08:43 GMT you wrote:
What I'm thinking here is that you might be installing a font which is bigger than the 8x16 standard that you appear to be booting with. To
check this, would you please do:
# file /lib/rc/console/font
, which should return a message like:
/lib/rc/console/font: Linux/i386 PC Screen Font v1 data, 256 characters,
Unicode directory, 8x16
What is the size of this font, here (where it says 8x16 for my font)?
The reason I ask is, I've got a horrible suspicion that one of the C functions which copies screen data when the screen size is changed can
only copy to a same sized or (possibly) _bigger_ screen (i.e. with a smaller font). If this is indeed the case, it might explain why you're seeing a hang, here.
I think you've put your finger on it:
$ file /lib/rc/console/font
/lib/rc/console/font: Linux/i386 PC Screen Font v2 data, 256 characters, Unicode directory, 22x11
I use consolefont="ter-122n" from the terminus-font package. It's a long time since I was able to read a high-resolution screen in its native resolution.
Is there some way I can get the UEFI BIOS to boot with that font, or a larger one? Or perhaps let the system boot without setting a font and then changing it later?
Neither of those looks easy to do. I'd better have a good root through the BIOS options to start with.
--
Regards,
Peter.
Hello again, Peter.
On Sat, Dec 31, 2022 at 15:47:01 +0000, Peter Humphrey wrote:
Hello Alan,
On Saturday, 31 December 2022 14:08:43 GMT you wrote:
What I'm thinking here is that you might be installing a font which is bigger than the 8x16 standard that you appear to be booting with. To check this, would you please do:
# file /lib/rc/console/font
, which should return a message like:
characters,/lib/rc/console/font: Linux/i386 PC Screen Font v1 data, 256
Unicode directory, 8x16
What is the size of this font, here (where it says 8x16 for my font)?
The reason I ask is, I've got a horrible suspicion that one of the C functions which copies screen data when the screen size is changed can only copy to a same sized or (possibly) _bigger_ screen (i.e. with a smaller font). If this is indeed the case, it might explain why you're seeing a hang, here.
I think you've put your finger on it:
$ file /lib/rc/console/font
/lib/rc/console/font: Linux/i386 PC Screen Font v2 data, 256 characters, Unicode directory, 22x11
I use consolefont="ter-122n" from the terminus-font package. It's a longtime
since I was able to read a high-resolution screen in its nativeresolution.
Is there some way I can get the UEFI BIOS to boot with that font, or alarger
one? Or perhaps let the system boot without setting a font and thenchanging
it later?
Probably, but it would be better if I just fixed the bug(s) in my changes
to
the kernel. Changing font size is something one should be able to do.
Neither of those looks easy to do. I'd better have a good root throughthe
BIOS options to start with.
A happy new year to you (and everybody else here), and give me somewhere between a few hours and a few days, and this bug should get fixed.
Again, thanks for such effective testing!
--
Regards,
Peter.
--
Alan Mackenzie (Nuremberg, Germany).
$ file /lib/rc/console/font
/lib/rc/console/font: Linux/i386 PC Screen Font v2 data, 256 characters, Unicode directory, 22x11
That's a nice font. I could get used to it if I wasn't so attached toI use consolefont="ter-122n" from the terminus-font package. It's a long time since I was able to read a high-resolution screen in its native resolution.
the 8x16 font.
8
The included patch is still imperfect. When booting in 11x22, it doesn't handle the early boot messages at all well. Also, I'm a little confused
by what a low-level scroll function is meant to do - sometimes, scrolling happens when you type a CR, and want a line on the screen to be space
filled. Other times, you type <shift><PgUp> and don't want any space
filling to happen. So I'm not convinced that scrolling, invoked by, say,
an editor program, will work correctly.
On Sat, Dec 31, 2022 at 15:47:01 +0000, Peter Humphrey wrote:
Hello Alan,
On Saturday, 31 December 2022 14:08:43 GMT you wrote:
I think you've put your finger on it:
$ file /lib/rc/console/font
/lib/rc/console/font: Linux/i386 PC Screen Font v2 data, 256 characters, Unicode directory, 22x11
I use consolefont="ter-122n" from the terminus-font package. It's a long time
since I was able to read a high-resolution screen in its native resolution.
Is there some way I can get the UEFI BIOS to boot with that font, or a larger
one? Or perhaps let the system boot without setting a font and then changing
it later?
Probably, but it would be better if I just fixed the bug(s) in my changes to the kernel. Changing font size is something one should be able to do.
Neither of those looks easy to do. I'd better have a good root through the BIOS options to start with.
A happy new year to you (and everybody else here), and give me somewhere between a few hours and a few days, and this bug should get fixed.
Again, thanks for such effective testing!
To use it, please apply the supplied patch ON TOP OF the patch I
posted here on 12th December. Proceed as documented in that post,
up until configuring the kernel - in Device drivers/Graphic
support/Console display driver support, there's an extra item
"Enable a working GPM for scrolled back scrollback buffer in System
RAM" which should be enabled by default. Check this is set up
properly. Then build and install the kernel. Then reboot into it
and try it out.
--
Regards,
Peter.
On Sat, Dec 31, 2022 at 16:13:23 +0000, Alan Mackenzie wrote:
On Sat, Dec 31, 2022 at 15:47:01 +0000, Peter Humphrey wrote:
Hello Alan,
On Saturday, 31 December 2022 14:08:43 GMT you wrote:
[ .... ]
I think you've put your finger on it:
$ file /lib/rc/console/font
/lib/rc/console/font: Linux/i386 PC Screen Font v2 data, 256 characters, Unicode directory, 22x11
I use consolefont="ter-122n" from the terminus-font package. It's a long time
since I was able to read a high-resolution screen in its native resolution.
That's a nice font. I could get used to it if I wasn't so attached to
the 8x16 font.
The included patch is still imperfect. When booting in 11x22, it doesn't handle the early boot messages at all well. Also, I'm a little confused
by what a low-level scroll function is meant to do - sometimes, scrolling happens when you type a CR, and want a line on the screen to be space
filled. Other times, you type <shift><PgUp> and don't want any space
filling to happen. So I'm not convinced that scrolling, invoked by, say,
an editor program, will work correctly.
To use it, please apply the supplied patch ON TOP OF the patch I
posted here on 12th December. Proceed as documented in that post,
up until configuring the kernel - in Device drivers/Graphic
support/Console display driver support, there's an extra item
"Enable a working GPM for scrolled back scrollback buffer in System
RAM" which should be enabled by default. Check this is set up
properly. Then build and install the kernel. Then reboot into it
and try it out.
--
Regards,
Peter.
8
Again, on any problems please let me know and I'll try to fix them. As
ever, there are no guarantees, etc., etc., etc. My only promise is that there's no malicious code in the patch.
On Thursday, 26 January 2023 20:28:36 GMT Alan Mackenzie wrote:
8
Again, on any problems please let me know and I'll try to fix them. As ever, there are no guarantees, etc., etc., etc. My only promise is that there's no malicious code in the patch.
Good news! Well, partly... :)
I applied the new patch to 5.15.88 and it seems fine. I'll have to test it in use and let you know.
Patching 6.1.8 failed, though, whereas the previous 5.15.80-scroll. 20221212.diff succeeded:
# patch -p1 < /usr/local/src/5.15.80-GPM.20230126.diff
patching file drivers/tty/vt/vt.c
Hunk #37 succeeded at 4748 (offset -1 lines).
Hunk #38 succeeded at 5049 (offset -1 lines).
Hunk #39 FAILED at 5353.
1 out of 39 hunks FAILED -- saving rejects to file drivers/tty/vt/vt.c.rej patching file drivers/video/console/Kconfig
Hunk #1 succeeded at 99 (offset 1 line).
patching file drivers/video/fbdev/core/fbcon.c
Hunk #1 succeeded at 3171 (offset 19 lines).
patching file include/linux/console_struct.h
Hunk #2 FAILED at 170.
1 out of 2 hunks FAILED -- saving rejects to file include/linux/ console_struct.h.rej
patching file include/linux/vt_kern.h
Hunk #1 succeeded at 114 (offset -1 lines).
I've attached the reject files.
--
Regards,
Peter.
--- drivers/tty/vt/vt.c
+++ drivers/tty/vt/vt.c
@@ -5353,10 +5965,19 @@ EXPORT_SYMBOL_GPL(screen_glyph);
u32 screen_glyph_unicode(const struct vc_data *vc, int n)
{
- struct uni_screen *uniscr = get_vc_uniscr(vc);
+ int y = n / vc->vc_cols, x = n % vc->vc_cols;
+ uint32_t *ln = vc->vc_uniscr_curr + y * vc->vc_cols;
- if (uniscr)
- return uniscr->lines[n / vc->vc_cols][n % vc->vc_cols];
+ if (vc->vc_uniscr_curr) {
+ if (ln >= vc_uniscr_buf_end(vc))
+ ln -= vc->vc_uniscr_char_size;
+#ifdef CONFIG_FRAMEBUFFER_CONSOLE_SOFT_SCROLLBACK_GPM
+ ln -= vc->vc_softback_lines * vc->vc_cols;
+ if (ln < vc->vc_uniscr_buf)
+ ln += vc->vc_uniscr_char_size;
+#endif
+ return ln[x];
+ }
return inverse_translate(vc, screen_glyph(vc, n * 2), 1);
}
EXPORT_SYMBOL_GPL(screen_glyph_unicode);
--- include/linux/console_struct.h
+++ include/linux/console_struct.h
@@ -170,7 +181,11 @@ struct vc_data {
struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
struct uni_pagedir *vc_uni_pagedir;
struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
- struct uni_screen *vc_uni_screen; /* unicode screen content */ +#ifdef CONFIG_FRAMEBUFFER_CONSOLE_SOFT_SCROLLBACK_GPM
+ uint32_t *vc_uniscr_buf; /* Address of unicode screen content */
+ unsigned int vc_uniscr_char_size; /* Size of *vc-uniscr_buf in 32-bit chars */
+ uint32_t *vc_uniscr_curr; /* Pos of first char of (unscrolled) screen */
+#endif
/* additional information is in vt_kern.h */
};
On Fri, Jan 27, 2023 at 12:24:41 +0000, Peter Humphrey wrote:
8
I've attached the reject files.
Thanks for these! It looks like it'll probably be straightforward to
amend the patch for 6.1.8. Are you currently running 6.1.8 as your main kernel?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 78:34:52 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,332,979 |
Posted today: | 1 |