Skip to contentSkip to conversation

2.5.69 - no setfont and loadkeys on tty > 1

BUG Damian Kołkowski 4 participants 11 messages May 9, 2003 – May 15, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I'am wondering why setfont and loadkeys in setting only on first tty. It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

Take care.

P.S. Do I need to attaah the config file?

Signature · 1 line
# Damian *dEiMoS* Kołkowski # http://deimos.one.pl/ #
#1 lore raw

Hi!

Quoted 4 lines

I'am wondering why setfont and loadkeys in setting only on first tty. It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

FYI, its same as vesafb here.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#2 lore raw
Quoted 10 lines

Hi!

Quoted 4 lines

I'am wondering why setfont and loadkeys in setting only on first tty. It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

FYI, its same as vesafb here.
Pavel

Try this patch. If it works I will pass it on to linus. thank you.

# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
# ChangeSet 1.1077 -> 1.1078
# drivers/char/vt_ioctl.c 1.22 -> 1.23
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 03/05/12 [email protected] 1.1078
# [CONSOLE] This patch fixes the problem of not being able to set the fonts on VCs other than the first one. This also was the bug that was casuing dual head (vga and mda) to lock up. # --------------------------------------------
#

drivers/char/vt_ioctl.c +6 -6
diff -Nru a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
@@ -869,13 +869,13 @@
 		if (clin > 32)
 			return -EINVAL;
 		    
-		if (vlin)
-			vc->vc_scan_lines = vlin;
-		if (clin)
-			vc->vc_font.height = clin;
-	
-		for (i = 0; i < MAX_NR_CONSOLES; i++)
+		for (i = 0; i < MAX_NR_CONSOLES; i++) {
+			if (vlin)
+				vc_cons[i].d->vc_scan_lines = vlin;
+			if (clin)
+				vc_cons[i].d->vc_font.height = clin;
 			vc_resize(i, cc, ll);
+		}
   		return 0;
 	}
 
#3 lore raw
Quoted 1 line · James Simmons

Try this patch. If it works I will pass it on to linus. thank you.

It dose't work for me on 2.5.69-bk8.

Signature · 1 line
# Damian *dEiMoS* Kołkowski # http://deimos.one.pl/ #
#4 lore raw
In reply to James Simmons

Hi!

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I'am wondering why setfont and loadkeys in setting only on first tty. It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

FYI, its same as vesafb here.

Try this patch. If it works I will pass it on to linus. thank you.

Does not work. Setfont still only changes tty it is run on.

There are more problems. Emacs changes cursor to "more visible" one, this somehow leaks between ttys.

Last but not least: Try this on your tty:

echo -e "\33[10;5000]\33[11;50]\33[?18;0;136c\33[?102m"

It is supposed to start "softcursor". Unfortunately, with 2.5.68+ softcursor is not cleared properly. Try typing foo^H^H^H in bash :-(. [Or try most /some/file].

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#5 lore raw
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 5 lines

I'am wondering why setfont and loadkeys in setting only on first tty. It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

FYI, its same as vesafb here.

Try this patch. If it works I will pass it on to linus. thank you.

Does not work. Setfont still only changes tty it is run on.

This is because I nuked a few global variables. Video_font_height and video_scan_line where global variables. When you changed fonts it affected every terminal. Now you might think this is correct behavior but what about systems with more than one graphics card. Say for example vgacon and fbcon. Now for vgacon you can't change the width of your fonts but for fbcon you can. So changing this global variable caused havoc for the VGA text mode display.

Quoted 2 lines

There are more problems. Emacs changes cursor to "more visible" one, this somehow leaks between ttys.

Hm. I can't seem to reproduce this problem.

Quoted 7 lines

Last but not least: Try this on your tty:

echo -e "\33[10;5000]\33[11;50]\33[?18;0;136c\33[?102m"

It is supposed to start "softcursor". Unfortunately, with 2.5.68+ softcursor is not cleared properly. Try typing foo^H^H^H in bash :-(. [Or try most /some/file].

I see. Only moving the cursor to the left cause this problem. Moving right is okay. Also hitting enter shows this problem. This is strange. It appears the flashing is the issue. I will see if a hardware cursor also has this same issue. Thanks for pointing it out. Softcursor has another problem I also discover also so I can include it in my next set of fixes.

P.S
KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)

#6 lore raw

Hi!

Quoted 11 lines
Quoted 10 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

I'am wondering why setfont and loadkeys in setting only on first tty. It works (setting font map on all six tty) in 2.{2,4}.x.

I'am using _radeonfb_ with rv250if, could it be the reason?

FYI, its same as vesafb here.

Try this patch. If it works I will pass it on to linus. thank you.

Does not work. Setfont still only changes tty it is run on.

Quoted 7 lines

This is because I nuked a few global variables. Video_font_height and video_scan_line where global variables. When you changed fonts it affected every terminal. Now you might think this is correct behavior but what about systems with more than one graphics card. Say for example vgacon and fbcon. Now for vgacon you can't change the width of your fonts but for fbcon you can. So changing this global variable caused havoc for the VGA text mode display.

Well, it would be nice to set the default for newly created consoles.

Perhaps you need to make old ioctls 2.4.X compatible and introduce new ioctl that sets only "this" console?

Quoted 4 lines
Quoted 2 lines

There are more problems. Emacs changes cursor to "more visible" one, this somehow leaks between ttys.

Hm. I can't seem to reproduce this problem.

Do this:

pavel@amd:~$ echo -e '\e[?8c'

Notice cursor changes to block. Switch to another console. Oops, block cursor, too.

Quoted 10 lines
Quoted 7 lines

Last but not least: Try this on your tty:

echo -e "\33[10;5000]\33[11;50]\33[?18;0;136c\33[?102m"

It is supposed to start "softcursor". Unfortunately, with 2.5.68+ softcursor is not cleared properly. Try typing foo^H^H^H in bash :-(. [Or try most /some/file].

I see. Only moving the cursor to the left cause this problem. Moving right is okay. Also hitting enter shows this problem. This is strange. It

Its not. Its software generated cursor, and it is only drawn, not properly hidden. Thats why it behaves like that.

Quoted 2 lines

appears the flashing is the issue. I will see if a hardware cursor also has

Don't let flashing confuse you. Set it to the red block and you'll see problem better.

Quoted 1 line

KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)

What is that? I can not see it in 2.5.X.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#7 lore raw
Quoted 5 lines

Well, it would be nice to set the default font for newly created fonts

Perhaps you need to make old ioctls 2.4.X compatible and introduce new ioctl that sets only "this" console?

PIO_FONTRESET ioctl which is old and the flag KD_FONT_OP_SET_DEFAULT. I have to look at the setfont code to see if it sets this flag. I bet it doesn't. I don't see a flag to tell setfont to use this font as the default font for all terminals :-( The good news is you can tell which tty to change the fonts on (-c /dev/ttyX). So setfont has the idea of setting a single tty but due to a bug in the console layer it set all terminals. I guess we need to update setfont for setting all terminals.

Quoted 6 lines

Do this:

pavel@amd:~$ echo -e '\e[?8c'

Notice cursor changes to block. Switch to another console. Oops, block cursor, too.

Ug!!!! I have cursor_shape in struct display for this reason. Will have to trace to find the problem.

Quoted 2 lines
Quoted 2 lines

appears the flashing is the issue. I will see if a hardware cursor also has

Your right. I realize my logic error. I was literally thinking too black
and white. In the case of a cursor that is a white thin line at the bottom and a grey background. That is whole cursor image!! The mask should be the font image to be drawn.
You can think of it as the cursor being a big grey cookie with white
frosting decoration on the bottom. Then I come with my font shape cookie cutter and cut it out.

Quoted 3 lines
Quoted 1 line

KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)

What is that? I can not see it in 2.5.X.

Line 420 in vt_ioctl.c.

#8 lore raw

Hi!

Quoted 10 lines
Quoted 2 lines
Quoted 2 lines

appears the flashing is the issue. I will see if a hardware cursor also has

Your right. I realize my logic error. I was literally thinking too black
and white. In the case of a cursor that is a white thin line at the bottom and a grey background. That is whole cursor image!! The mask should be the font image to be drawn.
You can think of it as the cursor being a big grey cookie with white
frosting decoration on the bottom. Then I come with my font shape cookie cutter and cut it out.

I'm not sure I follow you.

What I do in that echo is set softcursor. It was software cursor even on plain vga. Boot into 2.4 to see how it should look like. It works even in vga text modes. It is different from softcursor later introduced by fbcon. Documentation/VGA-softcursor.txt describes it.

Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#9 lore raw
In reply to James Simmons

Hi!

Quoted 4 lines
Quoted 2 lines

There are more problems. Emacs changes cursor to "more visible" one, this somehow leaks between ttys.

Hm. I can't seem to reproduce this problem.

Also play a bit with gpm's selection. Sometimes cursor gets corrupted. Like its no longer underline or block, it is something strange.
Pavel

Signature · 2 lines
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]
#10 lore raw
In reply to James Simmons
Quoted 2 lines · James Simmons

P.S
KDGKBDTYPE. (Wow, I can't believe we still have this. It should die)

It is rather useless for determining keyboard proterties, yes. On the other hand, quite a few utilities use it in code like

static int

is_a_console(int fd) {
    char arg;

    arg = 0;
    return (ioctl(fd, KDGKBTYPE, &arg) == 0
            && ((arg == KB_101) || (arg == KB_84)));
}

Andries