vcs(4) Device Drivers Manual vcs(4) vcs vcsa - /dev/vcs0 7 0 0644 root:tty. . /dev/vcs[1-63] 7 1 63 0644 root:tty. /dev/vcsa[0-63] unsigned shorts ( ) : lines columns x y. (x = y = 0 ). 512 ioctl(2) VT_GETHIFONTMASK ( 2.6.18) /dev/tty[1-63] unsigned short ioctl(2). ioctl(2) ioctl_console(2) . : for x in 0 1 2 3 4 5 6 7 8; do mknod -m 644 /dev/vcs$x c 7 $x; mknod -m 644 /dev/vcsa$x c 7 $[$x+128]; done chown root:tty /dev/vcs* ioctl(2). /dev/vcs[0-63] /dev/vcsa[0-63] 1.1.92. vt3 vt1 cat /dev/vcs3 >foo fold -w 81 /dev/vcs3 | lpr ( ) setterm -dump 3 -file /proc/self/fd/1 /dev/vcsa0 . : #include #include #include #include #include #include int main(void) { int fd; char *device = "/dev/vcsa2"; char *console = "/dev/tty2"; struct {unsigned char lines, cols, x, y;} scrn; unsigned short s; unsigned short mask; unsigned char attrib; int ch; fd = open(console, O_RDWR); if (fd < 0) { perror(console); exit(EXIT_FAILURE); } if (ioctl(fd, VT_GETHIFONTMASK, &mask) < 0) { perror("VT_GETHIFONTMASK"); exit(EXIT_FAILURE); } (void) close(fd); fd = open(device, O_RDWR); if (fd < 0) { perror(device); exit(EXIT_FAILURE); } (void) read(fd, &scrn, 4); (void) lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), SEEK_SET); (void) read(fd, &s, 2); ch = s & 0xff; if (s & mask) ch |= 0x100; attrib = ((s & ~mask) >> 8); printf("ch=%#03x attrib=%#02x\n", ch, attrib); s ^= 0x1000; (void) lseek(fd, -2, SEEK_CUR); (void) write(fd, &s, 2); exit(EXIT_SUCCESS); } ioctl_console(2) tty(4) ttyS(4) gpm(8) 3 . . : . 6.18 8 2026 vcs(4)