Skip to contentSkip to conversation

Console text selection bug

DISCUSSION Giuliano Pochini 5 participants 7 messages Mar 3, 2001 – Mar 10, 2001

lore
Share & tools
lore
#0 lore raw

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/

#1 lore raw
Quoted 10 lines

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/

#6 lore raw
In reply to Giuliano Pochini
Quoted 5 lines · Giuliano Pochini

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 ?

Quoted 7 lines

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/

#2 lore raw
In reply to Benjamin Herrenschmidt
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 9 lines

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.

Quoted 8 lines

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/

#3 lore raw
Quoted 16 lines · Timothy A. Seufert
Quoted 15 lines · Benjamin Herrenschmidt
Quoted 9 lines

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.

Quoted 6 lines
Quoted 3 lines

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 [email protected] :-)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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/

#4 lore raw
Quoted 6 lines
Quoted 2 lines

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 [email protected] :-)

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/

#5 lore raw
Quoted 8 lines · Giuliano Pochini
Quoted 5 lines
Quoted 1 line

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 [email protected] :-)

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.

Quoted 1 line

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 -- [email protected]

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/