Initial import from FreeBSD RELENG_4:
[dragonfly.git] / usr.sbin / pcvt / Misc / Doc / NotesAndHints
1 Random Notes and Hints                Last Edit-Date: [Sun Apr  2 18:28:09 1995]
2 --------------------------------------------------------------------------------
3
4
5 First of all, please read the file BugList in this directory !
6
7
8 Can't get pcvt working on a ThinkPad
9 ===============================================================================
10
11 Anyway, back to the keyboard.  The problem is that by default the
12 ThinkPad uses PS/2 scan code mode.
13
14 You can fix this by using an option and building a kernel, as shown
15 below.
16
17 ] Just for the record, in case someone else is asking for this: Al's
18 ] confirmation that pcvt w/ PCVT_SCANSET=2 works for the ThinkPad:
19
20 ] As Al Elia wrote:
21 ] | Date: Mon, 28 Nov 1994 18:24:42 GMT
22 ] | From: Al Elia <aelia%aelia.student.harvard.edu@sax.sax.de>
23 ] | Message-Id: <199411281824.SAA01554@aelia.student.harvard.edu>
24 ] | To: joerg_wunsch@bonnie.tcd-dresden.de
25 ] | Subject: Re: Anyone got FreeBSD 1.1.5.1 running on a ThinkPad?
26 ] | 
27 ] | PCVT_SCANSET=2 worked...I had put in PCVT_SCAN_SET=2 (Doh!)
28 ] | 
29 ] | --Al Elia
30 ] | <aelia@aelia.student.harvard,edu>
31
32                          (Terry Lambert quoting Joerg Wunsch quoting Al Elia)
33
34
35 If one of the "lock" keys is pressed, LEDs do not get updated, keyboard hangs
36 ===============================================================================
37
38 This entry used to be a long time in the BugList file, and i could never
39 reproduce the problem. Today i got an explanation in german from someone
40 owning such a keyboard, i'll try to translate:
41
42 "This are old keyboards manufactured (~1985/1986) which manage their LED
43  setting only internally.
44  It is not possible to set the LEDs from the (main-) processor, if you
45  try, the keyboard processor hangs and the PC has to be reset by switching
46  power on and off, hard- and/or softreset does not work in this case.
47  Workaround: recompile pcvt with the LED update removed"
48
49 In other words, define PCVT_NO_LED_UPDATE if you have such a beast!
50
51
52 Cursor not visible anymore in 40 and 50 lines mode
53 ===============================================================================
54
55 You have programmed an underline cursor in i.e. 28 line mode by doing
56 "cursor -s 10 -e 12". Then you switch to 40 line mode using "scon -s 40".
57 At this point the cursor is no longer visible because the 40 line font
58 is only 10 pixels high and the cursor size is programmed with a value
59 expressing its size from the top down and NOT from the bottom up!
60 If anyone has a good idea how to solve this problem, please tell me!
61 The only solution i see so far is having some sort of "generic" cursor
62 sizes/descriptions (i.e. underline, rectangle, block) which are
63 recalculated in case of a switch to another line size.
64
65
66 386BSD port
67 ===============================================================================
68
69 I don't have access to a 386BSD 0.1 machine anymore so the 386BSD pcvt is
70 considered unsupported and will disappear in the future.
71
72 386BSD support was dropped with release 3.20.
73
74
75 Keyboard hangs after first update of keyboard LED's
76 ===============================================================================
77
78 Define PCVT_NO_LED_UPDATE and recompile pcvt. (Or, get yourself a better
79 keyboard. Some keyboards just don't work the documented way, this fact is
80 "normally" masked by the manufacturers BIOS but unhides when one accesses
81 the hardware directly.)
82
83
84 Garbled screen when running vi
85 ===============================================================================
86
87 When the terminal speed in the tty structure is set to low speeds (i.e. 1200
88 Baud), pcvt shows a strange behaviour in some environments due to the changed
89 screen update sequences from vi.
90
91 Please check your shell startup files, /etc/ttys and /etc/gettytab and change
92 the baudrate (i.e. by using stty(1)) to a higher value, i.e. 19200 Baud.
93
94 Since i'm not a vi specialist, i never managed to find out wheter to blame
95 vi or pcvt.
96
97
98 Stty influences on the driver
99 ===============================================================================
100
101 There used to be an entry in the BugList:
102
103         (printf with 9 x tab) printf "\n\t\t\t\t\t\t\t\t\tGotcha" works ok,
104         while one tab more: printf "\n\t\t\t\t\t\t\t\t\t\tGotcha" doesn't
105         work (it doesn't print Gotcha at column 80, but at column 131).
106
107 This was solved some time ago:
108
109         On another note: if I use stty xtabs, the 'printf "\t\t\t\t\t\t\t" 
110         bug goes away. With stty xtabs the tab handling is done in the kernel.
111
112 (See also below: "Vttest shows strange results")
113
114
115 After running some graphics application, the cursor is stuck on the
116 bottom line, though everything else appears well
117 ===============================================================================
118
119 Though this might initially appear to be a driver problem, it's rather
120 an application program's bogosity. The cursor update is done asynchron-
121 ously (to gain output speed), but this cursor update is inhibited while
122 an application has put a virtual terminal into ``graphics mode'' (i.e.,
123 the application program tells the driver that it's now responsible for
124 anything and all on this vty). This is notably the case while X11 is
125 running.
126
127 If the application fails to properly shut down itself, the terminal
128 might be left in an undefined state. The driver stand no chance there,
129 even if it could detect this bad status, since it doesn't know enough
130 about each piece of hardware to deal with. One possibility is that
131 the X server has been shot up and didn't get it to do its cleanups.
132 Another case (which i've often noticed on my slow notebook) is, killing
133 the Xserver is too slow for the (unfortunately hard-coded) 10-second
134 timeout from xinit, so it's being aborted ridiculously. (``X server
135 slow to shut down, sending KILL signal.'') This way, the state of
136 damage might range from ``almost okay, but cursor is stuck'' up to
137 a totally unusable machine (moon bitmap from xphoon still displayed,
138 no keyboard responses, only network is working and can be used to
139 shut down cleanly).
140 If the state of damage is only minimal, you might try to run the pure
141 X server on that vty again, and exit it with Ctrl-Alt-BkSpc. This might
142 be a workaround.
143
144
145 Vttest shows strange results
146 ===============================================================================
147
148 Verify your stty "oxtabs" settings, it has to be "oxtabs", NOT "-oxtabs".
149 Get yourself an original DEC terminal to verify vttest's output, i have
150 until now not seen any (!) VTxxx clone, which does it right !!!
151
152
153 VT220-like Keyboard Layout
154 ===============================================================================
155
156 I have to say, i don't use it and i don't like it, so it's mostly unsupported
157 and untested. Patches welcome!
158
159
160 132-column mode
161 ===============================================================================
162
163 There are known difficulties running pcvt in 132 column mode in conjunction
164 with X. Switching to 132 column mode does not only depend on a given chipset,
165 but on the board/manufacturers method of clock generation also. Even if your
166 chipset is detected, there may be still a problem with your board and it's
167 method of generating clocks. You may run in severe difficulties if your
168 board has a programmable clock generator and you run X and you switch from
169 132 col mode into X and back.
170
171 I have currently no idea how to solve this, other than having a similar
172 scheme as XFree86 applied to pcvt: Letting the user probe his board by using 
173 SuperProbe and recompiling pcvt according to the result.
174
175 I stumbled a bit deeper into this with my ELSA Winner 1000, which is equipped
176 with a ICD2061 clock synthesizer chip. For 132 column mode to work properly,
177 clock generator 2 must deliver 40 MHz to the S3 VGA chip, but this value has
178 to be programmed or initialized. If this VGA board has ever been switched
179 into 132 colums, i.e. in my case from a DOS program, it will continue to do
180 so until X runs or the machine is power cycled. If that occurs, the clock
181 generator 2 does contain nothing or garbage (in case of power cycling) or it
182 does contain the value for the current resolution in X in case of having been
183 in the X Server screen recently.
184
185 The X Server reprograms the clock generator each time the server is entered,
186 so the only thing to do is to reprogram the clock generator too when pcvt is
187 entered. Until now i found no way of identifying the clock oscillator chip
188 used, so an automatic clock switching seems to be a problem.
189
190
191 NetBSD 0.9 and Xfree86 2.0
192 ===============================================================================
193
194 To get the X server up and running on 0.9, you have to compile pcvt with
195 PCVT_USL_VT_COMPAT disabled, otherwise X (and SuperProbe) will hang the
196 video driver (not the whole machine !). This bug is reproducible but not
197 found yet ...
198 This does not apply to NetBSD-current, 386BSD and FreeBSD.
199
200
201 X server ioctl compatibility:
202 ===============================================================================
203
204 The compatibility X-Mode ioctl commands CONSOLE_X_MODE_ON and
205 CONSOLE_X_MODE_OFF should not be used intermixed with the USL VT style
206 commands on another virtual terminal. NB, that this situation could happen
207 if you run an XFree86 2.0 server on one virtual terminal and attempt to
208 run SuperProbe version 1.0 (as delivered with the XFree86 2.0 release)
209 on another vty. SuperProbe is still using the old commands in order to
210 gain IO privileges.
211 Since the old commands cannot care for things like terminal switching,
212 serious corruption could result from this, which need not to be detected
213 immediately (i.e., apparently SuperProbe ran well). Known problems are
214 font corruptions after the X server has been shut down later, or palette
215 flickers in 1-second intervals due to an erroneously re-enabled screen
216 saver.
217
218 Once that SuperProbe has been fixed in its release to use the USL VT style
219 commands, any support for the old CONSOLE_X_MODE_XXX commands will be
220 eliminated.
221
222 (Recent comment: SuperProbe 1.3 has been fixed. It will be delivered with
223 XFree86 2.1.)
224
225
226 How to set the foreground intensity to high on VGA mono screens:
227 ===============================================================================
228
229 try to issue the command: "scon -p8,60,60,60", EXPERIMENT !!!
230
231
232 How to change the color palette on VGA cards:
233 ===============================================================================
234         
235 try out the following commands:
236
237         /usr/local/bin/scon -d/dev/ttyv0 -pblack:0,0,0 -pblue:20,20,40
238         /usr/local/bin/scon -d/dev/ttyv0 -pbrown:55,55,15 -plightgray:0,42,0
239         /usr/local/bin/scon -d/dev/ttyv1 -pblack:42,42,42 -pblue:60,60,60
240         /usr/local/bin/scon -d/dev/ttyv1 -pbrown:60,60,30 -plightgray:30,10,0
241         /usr/local/bin/scon -d/dev/ttyv2 -pblack:42,42,42 -pblue:63,63,63
242         /usr/local/bin/scon -d/dev/ttyv2 -pbrown:60,60,20 -plightgray:0,22,0
243         /usr/local/bin/scon -d/dev/ttyv3 -pblack:38,38,38 -pblue:63,63,63
244         /usr/local/bin/scon -d/dev/ttyv3 -pbrown:60,40,0 -plightgray:0,0,20
245
246         ("scon -p default" resets the colors ...)
247
248
249 I have the screensaver compiled in, but can't see any effect
250 ===============================================================================
251
252 Don't forget to turn it on with the scon utility. E.g.,
253
254         scon -t 120
255
256 sets the timeout to 2 minutes.
257
258
259 Your Notebook uses the NumLock state to switch half of the keyboard into a
260 numeric keypad
261 ===============================================================================
262
263 Sigh, each time you leave "vi", your NumLock LED is on again and you
264 get a "6" instead of "o"? Try
265
266         options  "PCVT_INHIBIT_NUMLOCK"
267
268 this prevents applications from turning NumLock on/off (except the
269 Xserver - but you want this).
270
271
272 Your notebook significantly loses contrast when using pcvt
273 ===============================================================================
274
275 Pcvt turns off the "high intensity" attribute bit internally (to enable
276 the use of a 512-characters charset). Some notebooks hard-code the out-
277 put intensity versus the character attribute though (i know it for a
278 Cirrus Logic CL-GD610/620 chipset).
279
280 As a quick & dirty workaround, you can reverse what pcvt did to the
281 Attribute Controller. Do not hack pcvt_sup.c, instead patch your
282 VGA registers during rc.local with the help of the vgaio utility:
283
284     echo "ar12=0f" | vgaio > /dev/null
285
286 For the CL-GD610/620, i'm remapping some attribute registers and
287 get a simple gray scale emulation with this (i.e., i DO NOT use
288 the hack above):
289
290    eagle_id=`echo 'cr1f?' | vgaio | cut -dx -f2`
291    echo "sr 6 = $eagle_id" | vgaio > /dev/null  # enable extended regs
292    echo "sr d5 = 40" | vgaio       > /dev/null  # not inverse, enable
293                                                 # color emulation
294    echo "ar0=0;ar1=9;ar2=12;ar3=1b;ar4=24;ar5=2d;ar6=36;ar7=3f"|vgaio>/dev/null
295    echo "ar8=0;ar9=9;ara=12;arb=1b;arc=24;ard=2d;are=36;arf=3f"|vgaio>/dev/null
296
297 NOTE THAT THIS IS ONLY FROM EXPERIMENTS! There's no warranty that something
298 like this wouldn't damage your screen/VGA!
299
300 (If you have chipset documentation, you're lucky...)
301
302
303 How to set the "LINES"-Environment variable for sh/csh:
304 ===============================================================================
305
306 (Note: this is mostly obsoleted now since the driver properly generates
307 SIGWINCH'es to notify applications about a changed screen size.)
308
309      first for the csh:
310
311         alias linesw scon -s \!^ \; setenv LINES \!^
312
313      now for the bash/ash/sh/bash users:
314
315         linesw()
316         {
317                 scon -s $1
318                 LINES=$1; export LINES
319         }
320
321 /* EOF */