Print this page
12315 errors in section 7i of the manual
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man7i/vt.7i
+++ new/usr/src/man/man7i/vt.7i
1 +.\" Copyright 2020 Peter Tribble.
1 2 .\" Copyright (c) 2017, Joyent, Inc.
2 3 .\" Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
3 4 .\" The contents of this file are subject to the terms of the
4 5 .\" Common Development and Distribution License (the "License").
5 6 .\" You may not use this file except in compliance with the License.
6 7 .\"
7 8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8 9 .\" or http://www.opensolaris.org/os/licensing.
9 10 .\" See the License for the specific language governing permissions
10 11 .\" and limitations under the License.
11 12 .\"
12 13 .\" When distributing Covered Code, include this CDDL HEADER in each
13 14 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 15 .\" If applicable, add the following below this CDDL HEADER, with the
15 16 .\" fields enclosed by brackets "[]" replaced with your own identifying
16 17 .\" information: Portions Copyright [yyyy] [name of copyright owner]
17 -.Dd October 29, 2017
18 +.Dd February 17, 2020
18 19 .Dt VT 7I
19 20 .Os
20 21 .Sh NAME
21 22 .Nm vt
22 -.Nd Solaris virtual console interface
23 +.Nd illumos virtual console interface
23 24 .Sh SYNOPSIS
24 25 .In sys/kd.h
25 26 .In sys/vt.h
26 27 .Sh DESCRIPTION
27 28 The virtual console device driver \(em also known as virtual terminal
28 29 .Pq Sy VT
29 30 \(em is a layer of management functions that provides facilities to
30 31 support and switch between multiple screen faces on a single physical device.
31 32 .Pp
32 33 VT's are accessed in the same way as other devices.
33 34 The
34 35 .Xr open 2
35 36 system
36 37 call is used to open the virtual console and
37 38 .Xr read 2 ,
38 39 .Xr write 2
39 40 and
40 41 .Xr ioctl 2
41 42 are used in the normal way and support the functionality of the
42 43 underlying device.
43 44 In addition, some virtual console-specific ioctls are
44 45 provided and described below.
45 46 .Pp
46 47 The VT provides a link between different screen faces and the device.
47 48 The
48 49 .Sy "active virtual console"
49 50 corresponds to the currently visible screen face.
50 51 Device input is directed to the active console and any device-specific modes
51 52 that change on a per virtual terminal basis are set to the characteristics
52 53 associated with the active console.
53 54 .Pp
54 55 You manage VT's by intercepting keyboard sequences
55 56 .Pq Dq "hot key" .
56 57 To maintain consistency with Xserver, the virtual console device driver
57 58 supports the Ctrl, Alt, F# and arrow keys.
58 59 .Pp
59 60 The sequence
60 61 .Sy "AltL + F#"
61 62 (where AltL represents the left Alt key and F# represents function keys 1
62 63 through 12) is used to select virtual console 1-12.
63 64 The sequence
64 65 .Sy "AltGraph + F#"
65 66 (where AltGraph represents the right Alt key and F# represent function keys 1
66 67 through 12) is for virtual console 13-24.
67 68 .Sy "Alt + F1"
68 69 chooses the system console (also known as virtual console 1).
69 70 The sequence
70 71 .Sy "Alt + \(->"
71 72 (where "\(->" represents the right directional arrow)
72 73 selects the next VT in a circular ring fashion and
73 74 .Sy "Alt + \(<-"
74 75 (where "\(<-" represents the left directional arrow) changes to the previous
75 76 console in a circular fashion.
76 77 The sequence
77 78 .Sy "Alt + \(ua"
78 79 (where "\(ua" represents the up directional arrow) is for the last used console.
79 80 .Pp
80 81 Virtual console switching can be done automatically
81 82 .Pq Dv VT_AUTO
82 83 on receipt of a
83 84 .Dq hot-key
84 85 or by the process owning the VT
85 86 .Pq Dv VT_PROCESS .
86 87 When performed automatically, the process associated with the virtual console is
87 88 unaware of the switch.
88 89 Saving and restoring the device are handled by the
89 90 underlying device driver and the virtual console manager.
90 91 Note that automatic switching is the default mode.
91 92 .Pp
92 93 When a
93 94 .Dq hot-key
94 95 is sent when in process-controlled switch mode, the process
95 96 owning the VT is sent a signal (relsig) it has specified to the virtual console
96 97 manager (see
97 98 .Xr signal 3C )
98 99 requesting the process to release the physical device.
99 100 At this point, the virtual console manager awaits the
100 101 .Dv VT_RELDISP
101 102 ioctl from the process.
102 103 If the process refuses to release the device (meaning
103 104 the switch does not occur), it performs a
104 105 .Dv VT_RELDISP
105 106 ioctl with an argument of 0 (zero).
106 107 If the process desires to release the device, it saves
107 108 the device state (keyboard, display, and I/O registers) and then performs a
108 109 .Dv VT_RELDISP
109 110 with an argument of 1 to complete the switch.
110 111 .Pp
111 112 A ring of VT's can contain intermixed auto mode and process control mode
112 113 consoles.
113 114 When an auto mode process becomes active, the underlying device
114 115 driver and the virtual console manager handle the restoring of the device.
115 116 Process control mode processes are sent a specified signal (acqsig) when they
116 117 become the active console.
117 118 The process then restores the device state
118 119 (keyboard, display, and I/O registers) and performs
119 120 .Dv VT_RELDISP
120 121 ioctl with an argument of
121 122 .Dv VT_ACKACQ
122 123 to complete the switching protocol.
123 124 .Pp
124 125 The modify-operations ioctls
125 126 .Po
126 127 .Dv VT_SETMODE ,
127 128 .Dv VT_RELDISP ,
128 129 .Dv VT_WAITACTIVE ,
129 130 .Dv KDSETMODE
130 131 .Pc
131 132 check if the VT is the controlling tty of
132 133 the calling process.
133 134 If not, the sys_devices privilege is enforced.
134 135 .Dv VT_ACTIVATE
135 136 requires the sys_devices privilege.
136 137 Note that there is no
137 138 controlling tty and privilege check for query/view operations.
138 139 .Sh IOCTLS
139 140 The following ioctls apply to devices that support virtual consoles:
140 141 .Bl -tag -width VT_ENABLED
141 142 .It Dv VT_ENABLED
142 143 Queries to determine if VT functionality is available on the system.
143 144 The argument is a pointer to an integer.
144 145 If VT functionality is available, the
145 146 integer is 1, otherwise it is 0.
146 147 .It Dv VT_OPENQRY
147 148 Finds an available VT.
148 149 The argument is a pointer to an integer.
149 150 The integer is
150 151 filled in with the number of the first available console that no other process
151 152 has open (and hence, is available to be opened).
152 153 If there are no available
153 154 VT's, -1 is filled in.
154 155 .It Dv VT_GETMODE
155 156 Determines the VT's current mode, either
156 157 .Dv VT_AUTO
157 158 or
158 159 .Dv VT_PROCESS .
159 160 The
160 161 argument is the address of the following structure, as defined in
161 162 .In sys/vt.h
162 163 .Bd -literal -offset 2n
163 164 struct vt_mode {
164 165 char mode; /* VT mode */
165 166 char waitv; /* not used */
166 167 short relsig; /* signal to use for release request */
167 168 short acqsig; /* signal to use for display acquired */
168 169 short frsig; /* not used */
169 170 }
170 171
171 172 /* Virtual console Modes */
172 173 #define VT_AUTO 0 /* automatic VT switching */
173 174 #define VT_PROCESS 1 /* process controls switching */
174 175 .Ed
175 176 .Pp
176 177 The structure will be filled in with the current value for each field.
177 178 .It Dv VT_SETMODE
178 179 Sets the VT mode.
179 180 The argument is a pointer to a vt_mode structure as defined above.
180 181 The structure should be filled in with the desired mode.
181 182 If process-control mode is specified, the signals used to communicate with the
182 183 process should be specified.
183 184 If any signals are not specified (value is zero), the signal default is
184 185 .Dv SIGUSR1
185 186 (for relsig and acqsig).
186 187 .It Dv VT_RELDISP
187 188 Tells the VT manager if the process releases (or refuses to release) the
188 189 display.
189 190 An argument of 1 indicates the VT is released.
190 191 An argument of 0 indicates refusal to release.
191 192 The
192 193 .Dv VT_ACKACQ
193 194 argument indicates if acquisition of the VT has been completed.
194 195 .It Dv VT_ACTIVATE
195 196 Makes the VT specified in the argument the active VT (in the same manner as if
196 197 a hotkey initiated the switch).
197 198 If the specified VT is not open or does not exist, the call fails and errno is
198 199 set to
199 200 .Er ENXIO .
200 201 .It Dv VT_WAITACTIVE
201 202 If the specified VT is currently active, this call returns immediately.
202 203 Otherwise, it sleeps until the specified VT becomes active, at which point it
203 204 returns.
204 205 .It Dv VT_GETSTATE
205 206 Obtains the active VT number and a list of open VTs.
206 207 The argument is an address to the following structure:
207 208 .Bd -literal -offset 2n
208 209 struct vt_stat {
209 210 unsigned short v_active, /* number of the active VT */
210 211 v_signal, /* not used */
211 212 /*
212 213 * count of open VTs. For every 1 in this
213 214 * field, there is an open VT
214 215 */
215 216 v_state;
216 217 }
217 218 .Ed
218 219 .Pp
219 220 With
220 221 .Dv VT_GETSTATE ,
221 222 the VT manager first gets the number of the active VT,
222 223 then determines the number of open VTs in the system and sets a 1 for each open
223 224 VT in v_state.
224 225 Next, the VT manager transfers the information in structure
225 226 .Vt vt_stat
226 227 passed by the user process.
227 228 .It Dv KDGETMODE
228 229 Obtains the text/graphics mode associated with the VT.
229 230 .Bd -literal -offset 2n
230 231 #define KD_TEXT 0
231 232 #define KD_GRAPHICS 1
232 233 .Ed
233 234 .It Dv KDSETMODE
234 235 Sets the text/graphics mode to the VT.
235 236 .It Dv KD_TEXT
236 237 indicates that console text is displayed on the screen.
237 238 Normally
238 239 .Dv KD_TEXT
239 240 is combined with
240 241 .Dv VT_AUTO
241 242 mode for text console terminals,
242 243 so that the console text display automatically is saved and restored on the hot
243 244 key screen switches.
244 245 .Pp
245 246 .Dv KD_GRAPHICS
246 247 indicates that the user/application (usually Xserver) has
247 248 direct control of the display for this VT in graphics mode.
248 249 Normally
249 250 .Dv KD_GRAPHICS
250 251 is combined with
251 252 .Dv VT_PROCESS
252 253 mode for this VT indicating
253 254 direct control of the display in graphics mode.
254 255 In this mode, all writes to the
255 256 VT using the write system call are ignored, and you must save and restore the
256 257 display on the hot key screen switches.
257 258 .Pp
258 259 When the mode of the active VT is changed from
259 260 .Dv KD_TEXT
260 261 to
261 262 .Dv KD_GRAPHICS
262 263 or a VT of
263 264 .Dv KD_GRAPHICS
264 265 mode is made active from a
265 266 previous active VT of
266 267 .Dv KD_TEXT
267 268 mode, the virtual console manager initiates a
268 269 .Dv KDSETMODE
269 270 ioctl with
270 271 .Dv KD_GRAPHICS
271 272 as the argument to the underlying console frame buffer device indicating that
272 273 current display is running into graphics mode.
273 274 .Pp
274 275 When the mode of the active VT is changed from
275 276 .Dv KD_GRAPHICS
276 277 to
277 278 .Dv KD_TEXT
278 279 or a VT of
279 280 .Dv KD_TEXT
280 281 mode is actived from a previous active VT of
281 282 .Dv KD_GRAPHICS
282 283 mode, the virtual console manager initiates a
283 284 .Dv KDSETMODE
284 285 ioctl with
285 286 .Dv KD_TEXT
286 287 as the argument to the underlying console frame buffer device indicating that
287 288 current display is running into console text mode.
288 289 .El
289 290 .Sh FILES
290 291 .Bl -tag -width xxxxxxxxx
291 292 .It Pa /dev/vt/#
292 293 VT devices.
293 294 .El
294 295 .Sh SEE ALSO
295 296 .Xr ioctl 2 ,
296 297 .Xr signal 3C ,
297 298 .Xr wscons 7D
298 299 .Sh NOTES
299 300 By default, there are only five virtual console instance login prompts running
↓ open down ↓ |
267 lines elided |
↑ open up ↑ |
300 301 on
301 302 .Pa /dev/vt/#
302 303 (where "#" represents 2 to 6) in addition to the system
303 304 console running on
304 305 .Pa /dev/console .
305 306 Normally Xorg uses the seventh virtual console
306 307 .Pq Pa /dev/vt/7 .
307 308 To switch from consoles to Xserver (which normally
308 309 picks up the first available virtual console), use [ Ctrl + ] Alt + F7 .
309 310 .Bd -literal -offset indent
310 -# svcs | grep login
311 +# svcs | grep login
311 312 online 17:49:11 svc:/system/console-login:default
312 313 online 17:49:11 svc:/system/console-login:vt2
313 314 online 17:49:11 svc:/system/console-login:vt3
314 315 online 17:49:11 svc:/system/console-login:vt4
315 316 online 17:49:11 svc:/system/console-login:vt5
316 317 online 17:49:11 svc:/system/console-login:vt6
317 318 .Ed
318 319 .Pp
319 320 .Sy console-login:default
320 321 is for the system console, others for virtual consoles.
321 322 .Pp
322 -You can modify properties/disable/enable and remove/add virtual consoles using
323 +You can manage virtual consoles using the service management facility,
323 324 .Xr smf 5 :
324 325 .Bd -literal -offset indent
325 326 # svccfg -s console-login add vt8
326 327 # svccfg -s console-login:vt8 setprop \e
327 328 ttymon/device=astring: "/dev/vt/8"
328 329 # svcadm enable console-login:vt8
329 330 .Ed
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX