OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / LDP_man-pages / release / man4 / vcs.4
1 .\" Copyright (c) 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
2 .\" Sat Feb 18 09:11:07 EST 1995
3 .\"
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
8 .\"
9 .\" The GNU General Public License's references to "object code"
10 .\" and "executables" are to be interpreted as the output of any
11 .\" document formatting or typesetting system, including
12 .\" intermediate and printed output.
13 .\"
14 .\" This manual is distributed in the hope that it will be useful,
15 .\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16 .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 .\" GNU General Public License for more details.
18 .\"
19 .\" You should have received a copy of the GNU General Public
20 .\" License along with this manual; if not, write to the Free
21 .\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
22 .\" USA.
23 .\"
24 .\" Modified, Sun Feb 26 15:08:05 1995, faith@cs.unc.edu
25 .\" 2007-12-17, Samuel Thibault <samuel.thibault@ens-lyon.org>:
26 .\"     document the VT_GETHIFONTMASK ioctl
27 .\" "
28 .\" Japanese Version Copyright (c) 1996,1997,1998 ISHIKAWA Mutsumi
29 .\"         all rights reserved.
30 .\" Translated Tue Feb 6 16:30:31 JST 1997
31 .\"         by ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
32 .\"
33 .\" Japanese Version Last Modified Sun Jan 11 03:55:54 1998
34 .\"     by ISHIKAWA Mutsumi <ishikawa@linux.or.jp>
35 .\" Updated Sat Feb 10 23:17:30 JST 2001
36 .\"     by Yuichi SATO <sato@complex.eng.hokudai.ac.jp>
37 .\" Updated 2008-02-12, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.77
38 .\"
39 .\" WORD:       virtual console         ²¾ÁÛ¥³¥ó¥½¡¼¥ë
40 .\" WORD:       memory                  ¥á¥â¥ê
41 .\" WORD:       permission              ¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó
42 .\" WORD:       prefix                  ¥×¥ì¥Õ¥£¥Ã¥¯¥¹
43 .\" WORD:       screen                  ¥¹¥¯¥ê¡¼¥ó
44 .\" WORD:       cursor                  ¥«¡¼¥½¥ë
45 .\" WORD:       Braille                 ¥Ö¥é¥¤¥æÅÀ»ú
46 .\"
47 .TH VCS 4 2007-12-17 "Linux" "Linux Programmer's Manual"
48 .SH Ì¾Á°
49 vcs, vcsa \- ²¾ÁÛ¥³¥ó¥½¡¼¥ë¥á¥â¥ê (virtual console memory)
50 .SH ÀâÌÀ
51 \fI/dev/vcs0\fP ¤Ï¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼ (major number) 7¡¢¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼
52 (minor number) 0 ¤Î¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹ (character device) ¤Ç¡¢
53 Ä̾¤½¤Î¥â¡¼¥É¤Ï 0644¡¢¥ª¡¼¥Ê¤Ï root.tty ¤Ç¤¢¤ë¡£
54 ¤³¤Î¥Ç¥Ð¥¤¥¹¥Õ¥¡¥¤¥ë (device file) ¤Ï
55 ¸½ºßɽ¼¨¤µ¤ì¤Æ¤¤¤ë²¾ÁÛ¥³¥ó¥½¡¼¥ëüËö¤Î¥á¥â¥ê¤ò»²¾È¤¹¤ë¡£
56 .LP
57 \fB/dev/vcs[1\-63]\fP ¤Ï²¾ÁÛ¥³¥ó¥½¡¼¥ëüËö¤Î¤¿¤á¤Î
58 ¥­¥ã¥é¥¯¥¿¡¼¥Ç¥Ð¥¤¥¹¤Ç¡¢¥á¥¸¥ã¡¼¥Ê¥ó¥Ð¡¼¤¬ 7¡¢¥Þ¥¤¥Ê¡¼¥Ê¥ó¥Ð¡¼¤¬ 1 ¤«¤é 63¡¢
59 Ä̾ï¤Ï¥â¡¼¥É¤¬ 0644¡¢¥ª¡¼¥Ê¡¼¤¬ root.tty ¤Ç¤¢¤ë¡£
60 \fB/dev/vcsa[0\-63]\fP ¤Ï \fB/dev/vcs[1\-63]\fP ¤ÈƱÍͤǤ¢¤ë¤¬¡¢
61 °À­¤ò³ÊǼ¤¹¤ë¤Î¤Ë (¥Û¥¹¥È¥Ð¥¤¥È¥ª¡¼¥À¤Î)
62 .I "unsigned short"
63 ¤ò»ÈÍѤ·¤Æ¤¤¤ëÅÀ¡¢¥¹¥¯¥ê¡¼¥ó¤Î¥µ¥¤¥º¡¦¥«¡¼¥½¥ë¤Î°ÌÃÖ¤òɽ¤¹
64 4 ¥Ð¥¤¥È¤Î¾ðÊó
65 \fIlines\fP, \fIcolumns\fP, \fIx\fP, \fIy\fP
66 (\fIx\fP =\fIy\fP = 0 ¤¬²èÌ̤κ¸¾å) ¤¬ÀèƬ¤Ë¤¢¤ëÅÀ¤¬°Û¤Ê¤ë¡£
67
68 512 Ê¸»ú¤«¤éÀ®¤ë¥Õ¥©¥ó¥È¤ò¥í¡¼¥É¤·¤¿¾ì¹ç¡¢
69 9 ¥Ó¥Ã¥ÈÌܤξðÊó¤Ï \fI/dev/tty[1\-63]\fP ¤ËÂФ·¤Æ
70 .BR ioctl (2)
71 \fBVT_GETHIFONTMASK\fP Áàºî¤ò¹Ô¤¦¤³¤È¤Ç¼èÆÀ¤Ç¤­¤ë
72 (\fBVT_GETHIFONTMASK\fP Áàºî¤Ï¥«¡¼¥Í¥ë 2.6.18 °Ê¹ß¤Î Linux ¤Ç
73 ÍøÍѲÄǽ¤Ç¤¢¤ë)¡£
74 ÃͤÏ
75 .BR ioctl (2)
76 ¤Î 3 ÈÖÌܤΰú¤­¿ô¤¬»Ø¤¹
77 .I "unsigned short"
78 ¤Ë³ÊǼ¤µ¤ì¤ÆÊÖ¤µ¤ì¤ë¡£
79 .PP
80 ¤³¤ì¤é¤Î¥Ç¥Ð¥¤¥¹¤Ï
81 .BR console (4)
82 ¤Î screendump
83 .BR ioctl (2)
84 ¤òÂåÂؤȤʤ롣
85 ½¾¤Ã¤Æ¡¢¥·¥¹¥Æ¥à´ÉÍý¼Ô¤Ï¥Õ¥¡¥¤¥ë¥·¥¹¥Æ¥à¥Ñ¡¼¥ß¥Ã¥·¥ç¥ó
86 (filesystem permission) ¤ò»È¤Ã¤Æ¥¢¥¯¥»¥¹¤ò¥³¥ó¥È¥í¡¼¥ë¤Ç¤­¤ë¡£
87 .PP
88 ºÇ½é¤Î 8 ¤Ä¤Î²¾ÁÛüËö¤Î¤¿¤á¤Î¥Ç¥Ð¥¤¥¹¤Ï¡¢¼¡¤Î¤è¤¦¤Ë¤·¤Æºî¤ë»ö¤¬¤Ç¤­¤ë:
89
90 .nf
91     for x in 0 1 2 3 4 5 6 7 8; do
92         mknod \-m 644 /dev/vcs$x c 7 $x;
93         mknod \-m 644 /dev/vcsa$x c 7 $[$x+128];
94     done
95     chown root:tty /dev/vcs*
96 .fi
97
98 .BR ioctl (2)
99 ¤Ë¤è¤ëÍ×µá¤Ï¥µ¥Ý¡¼¥È¤µ¤ì¤Ê¤¤¡£
100 .SH ¥Õ¥¡¥¤¥ë
101 /dev/vcs[0\-63]
102 .br
103 /dev/vcsa[0\-63]
104 .\" .SH Ãø¼Ô
105 .\" Andries Brouwer <aeb@cwi.nl>
106 .SH ¥Ð¡¼¥¸¥ç¥ó
107 Linux ¥«¡¼¥Í¥ë¥Ð¡¼¥¸¥ç¥ó 1.1.92 ¤ÇƳÆþ¤µ¤ì¤¿¡£
108 .SH Îã
109 vt3 ¤Î¥¹¥¯¥ê¡¼¥ó¥À¥ó¥×¤ò¼Â¹Ô¤¹¤ë¤Ë¤Ï¡¢Ã¼Ëö¤ò vt1 ¤ËÀÚÂؤ¨¤Æ
110 \fIcat /dev/vcs3 >foo\fP ¤È¥¿¥¤¥×¤¹¤ì¤Ð¤è¤¤¡£
111 µ¤¤òÉÕ¤±¤ÆÍߤ·¤¤¤Î¤Ï¡¢¤³¤Î½ÐÎϤϲþ¹Ôʸ»ú (newline character) ¤ò
112 ´Þ¤ó¤Ç¤¤¤Ê¤¤¤È¤¤¤¦»ö¤Ç¤¢¤ë¡£
113 ½¾¤Ã¤Æ¡¢\fIfold \-w 81 /dev/vcs3 | lpr\fP ¤ä
114 (¤¾¤Ã¤È¤¹¤ë¤¬) \fIsetterm \-dump 3 \-file /proc/self/fd/1\fP ¤Î¤è¤¦¤Ê
115 ²¿¤é¤«¤Î½èÍý¤¬É¬Íפˤʤ뤫¤â¤·¤ì¤Ê¤¤¡£
116 .LP
117 \fI/dev/vcsa0\fP ¥Ç¥Ð¥¤¥¹¤ò»È¤¦¤³¤È¤Ç¡¢
118 ¥Ö¥é¥¤¥æÅÀ»ú¤ò¥µ¥Ý¡¼¥È¤¹¤ë¤³¤È¤¬¤Ç¤­¤ë¡£
119
120 °Ê²¼¤Î¥×¥í¥°¥é¥à¤ÏÆó¤ÄÌܤβ¾ÁÛ¥³¥ó¥½¡¼¥ë¤Î¥«¡¼¥½¥ë°ÌÃ֤Υ¹¥¯¥ê¡¼¥ó°À­¤Èʸ»ú
121 ¤òɽ¼¨¤·¤¿¸å¡¢¥«¡¼¥½¥ë°ÌÃÖ¤ÎÇØ·Ê¿§¤òÊѹ¹¤¹¤ë :
122
123 .nf
124 #include <unistd.h>
125 #include <stdlib.h>
126 #include <stdio.h>
127 #include <fcntl.h>
128 #include <sys/ioctl.h>
129 #include <linux/vt.h>
130
131 int
132 main(void)
133 {
134     int fd;
135     char *device = "/dev/vcsa2";
136     char *console = "/dev/tty2";
137     struct {unsigned char lines, cols, x, y;} scrn;
138     unsigned short s;
139     unsigned short mask;
140     unsigned char ch, attrib;
141
142     fd = open(console, O_RDWR);
143     if (fd < 0) {
144         perror(console);
145         exit(EXIT_FAILURE);
146     }
147     if (ioctl(fd, VT_GETHIFONTMASK, &mask) < 0) {
148         perror("VT_GETHIFONTMASK");
149         exit(EXIT_FAILURE);
150     }
151     (void) close(fd);
152     fd = open(device, O_RDWR);
153     if (fd < 0) {
154         perror(device);
155         exit(EXIT_FAILURE);
156     }
157     (void) read(fd, &scrn, 4);
158     (void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0);
159     (void) read(fd, &s, 2);
160     ch = s & 0xff;
161     if (attrib & mask)
162         ch |= 0x100;
163     attrib = ((s & ~mask) >> 8);
164     printf("ch=\(aq%c\(aq attrib=0x%02x\\n", ch, attrib);
165     attrib ^= 0x10;
166     (void) lseek(fd, \-1, 1);
167     (void) write(fd, &attrib, 1);
168     exit(EXIT_SUCCESS);
169 }
170 .fi
171 .SH ´ØÏ¢¹àÌÜ
172 .BR console (4),
173 .BR tty (4),
174 .BR ttyS (4),
175 .BR gpm (8)