Console text selection bug

7 messages, 5 authors, 2001-03-10 · open the first message on its own page

Console text selection bug

From: Giuliano Pochini <hidden>
Date: 2001-03-03 17:09:11

When I select text in console it's scrambled. I looked at the
aty128 sources, but I didn't find anything about it. Where is
the code that manages selection/cut/paste ?

The selected text is scrambled in this way: every char has
the bits 1,2,3 swapped with bits 5,6,7 respectively (bits
numbered left to right). I don't know what can cause this
strange behaviour... I thought the console screen was a
simple array of char/colour pairs.

[b/w G3, r128, all kernels]

Bye.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: Console text selection bug

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2001-03-05 21:35:53

When I select text in console it's scrambled. I looked at the
aty128 sources, but I didn't find anything about it. Where is
the code that manages selection/cut/paste ?

The selected text is scrambled in this way: every char has
the bits 1,2,3 swapped with bits 5,6,7 respectively (bits
numbered left to right). I don't know what can cause this
strange behaviour... I thought the console screen was a
simple array of char/colour pairs.
It's an endian bug in fbcon when accessing the text/attribute buffer.

I think someone posted a fix for it, You may have more luck asking on
the fbdev mailing list to the fbdev maintainers what's up.

I think it's related to fbcon_invert_region() not using the access
macros and directly tapping the buffer, causing attributes & text
to be messed up.

Ben.

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: Console text selection bug

From: Timothy A. Seufert <hidden>
Date: 2001-03-06 06:18:42

At 10:35 PM +0100 3/5/01, Benjamin Herrenschmidt wrote:
quoted
When I select text in console it's scrambled. I looked at the
aty128 sources, but I didn't find anything about it. Where is
the code that manages selection/cut/paste ?

The selected text is scrambled in this way: every char has
the bits 1,2,3 swapped with bits 5,6,7 respectively (bits
numbered left to right). I don't know what can cause this
strange behaviour... I thought the console screen was a
simple array of char/colour pairs.
It's an endian bug in fbcon when accessing the text/attribute buffer.

I think someone posted a fix for it, You may have more luck asking on
the fbdev mailing list to the fbdev maintainers what's up.

I think it's related to fbcon_invert_region() not using the access
macros and directly tapping the buffer, causing attributes & text
to be messed up.
I saw this problem in 2.4.x until I turned off the config option for
VGA consoles.  Then it went away.

   Tim Seufert

** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: Console text selection bug

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2001-03-06 06:52:22

On Mon, 5 Mar 2001, Timothy A. Seufert wrote:
At 10:35 PM +0100 3/5/01, Benjamin Herrenschmidt wrote:
quoted
quoted
When I select text in console it's scrambled. I looked at the
aty128 sources, but I didn't find anything about it. Where is
the code that manages selection/cut/paste ?

The selected text is scrambled in this way: every char has
the bits 1,2,3 swapped with bits 5,6,7 respectively (bits
numbered left to right). I don't know what can cause this
strange behaviour... I thought the console screen was a
simple array of char/colour pairs.
It's an endian bug in fbcon when accessing the text/attribute buffer.

I think someone posted a fix for it, You may have more luck asking on
the fbdev mailing list to the fbdev maintainers what's up.

I think it's related to fbcon_invert_region() not using the access
macros and directly tapping the buffer, causing attributes & text
to be messed up.
I saw this problem in 2.4.x until I turned off the config option for
VGA consoles.  Then it went away.
Nevertheless, it's a bug. Can someone please change fbcon_invert_region() to
use scr_{read,write}w() to access the shadow screen buffer and see whether it
works? Patches are accepted at linux-fbdev-devel@lists.sourceforge.net :-)

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: Console text selection bug

From: Giuliano Pochini <hidden>
Date: 2001-03-07 20:29:17

quoted
It's an endian bug in fbcon when accessing the text/attribute buffer.
Nevertheless, it's a bug. Can someone please change fbcon_invert_region() to
use scr_{read,write}w() to access the shadow screen buffer and see whether it
works? Patches are accepted at linux-fbdev-devel@lists.sourceforge.net :-)
Yes, it's an endianess bug.  scr_{read,write}w() are defined as normal
assignments in vt_buffer.h, so I wonder where is the bug. Is the shadow buffer
supposed to be native endian ?


Bye.


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: Console text selection bug

From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: 2001-03-10 08:18:51

On Wed, 7 Mar 2001, Giuliano Pochini wrote:
quoted
quoted
It's an endian bug in fbcon when accessing the text/attribute buffer.
quoted
Nevertheless, it's a bug. Can someone please change fbcon_invert_region() to
use scr_{read,write}w() to access the shadow screen buffer and see whether it
works? Patches are accepted at linux-fbdev-devel@lists.sourceforge.net :-)
Yes, it's an endianess bug.  scr_{read,write}w() are defined as normal
assignments in vt_buffer.h, so I wonder where is the bug. Is the shadow buffer
No, their definition in vt_buffer.h depends on VT_BUF_HAVE_RW. If that is
defined in <asm/vga.h>, vga.h must provide its own definitions.
supposed to be native endian ?
It doesn't really matter, since all accesses must be done using
scr_{read,write}w() anyway. For performance reasons we chose native endianness.
Except when VGA (CONFIG_VGA_CONSOLE || CONFIG_MDA_CONSOLE) is defined, since on
VGA/MDA the shadow buffer _is_ the screen image and must be little endian.

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

Re: Console text selection bug

From: Hollis R Blanchard <hidden>
Date: 2001-03-05 23:48:29

On Sat, 3 Mar 2001, Giuliano Pochini wrote:
When I select text in console it's scrambled. I looked at the
aty128 sources, but I didn't find anything about it. Where is
the code that manages selection/cut/paste ?

The selected text is scrambled in this way: every char has
the bits 1,2,3 swapped with bits 5,6,7 respectively (bits
numbered left to right). I don't know what can cause this
strange behaviour... I thought the console screen was a
simple array of char/colour pairs.

[b/w G3, r128, all kernels]
I don't see this (B&W G3, 2.2.19pre14). I understand this is only a problem if
you enable VGA console (which I don't have enabled).

-Hollis


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help