VCS

Section: Linux Programmer's Manual (4)
Updated: February 19, 1995
Index
Return to Main Contents
 

À̸§

vcs, vcsa - °¡»ó ÄÜ¼Ö ¸Þ¸ð¸®  

¼³¸í

/dev/vcs0 ´Â ¹®ÀÚ ÀåÄ¡·Î¼­, ¸ÞÀÌÀú ³Ñ¹ö 7°ú ¸¶ÀÌ³Ê ³Ñ¹ö 0À» Áö´Ï°í, º¸Åë ¸ðµå 0664¿Í root.tty¸¦ ¼ÒÀ¯ÀÚ·Î Áö´Ñ´Ù. ÀÌ´Â ¶ÇÇÑ °¡»ó ÄÜ¼Ö Å͹̳ο¡ ÇöÀç º¸ÀÌ´Â ¸Þ¸ð¸®¸¦ ÂüÁ¶ÇÑ´Ù.

/dev/vcs[1-63] ´Â °¡»ó ÄÜ¼Ö Å͹̳ÎÀ» À§ÇÑ ¹®ÀÚ µð¹ÙÀ̽º·Î¼­, ¸ÞÀÌÀú ³Ñ¹ö 7, ¸¶ÀÌ³Ê ³Ñ¹ö¸¦ 1¿¡¼­ 63±îÁö °®°í, º¸Åë ¸ðµå 0664¿Í root.tty¸¦ ¼ÒÀ¯ÀÚ·Î Áö´Ñ´Ù. /dev/vcsa[0-63]´Â µ¿ÀÏÇÏÁö¸¸, È­¸éÀÇ ³ÐÀÌ¿Í ¸¶¿ì½º Ä¿¼­ÀÇ À§Ä¡¸¦ ÁÖ´Â 4¹ÙÀÌÆ®°¡ Á¢µÎ¾î·Î¸¦ Áö´Ï´Â ¼Ó¼ºµéÀ» Æ÷ÇÔÇÑ´Ù. (lines, columns, x, y) (x = y = 0 È­¸éÀÇ ¿ÞÂÊ »óÀ§)

À̵éÀº console(4)ÀÇ ½ºÅ©¸° ´ýÇÁ ioctls¸¦ ´ëü½ÃÅ°¹Ç·Î, ½Ã½ºÅÛ °ü¸®ÀÚ´Â ÆÄÀÏ ½Ã½ºÅÛ ±ÇÇѵéÀ» ÀÌ¿ëÇÏ¿© ¾×¼¼½º¸¦ Á¦¾îÇÒ ¼ö ÀÖ´Ù.

ù¹ø° ¿©´ü°³ÀÇ °¡»ó Äֵܼ鿡 ´ëÇØ ÀÌ ÀåÄ¡µéÀº ¾Æ·¡ÀÇ ³»¿ë¿¡ ÀÇÇØ ¸¸µé¾îÁú ¼ö ÀÖ´Ù.

        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() ¿äûµéµµ Áö¿øµÇÁö ¾Ê´Â´Ù.  

¿¹Á¦

¿©·¯ºÐÀº vt3¿¡¼­ cat /dev/vcs3 >fooÀ» ÀÔ·ÂÇÏ°í, vt1À¸·Î ÀüȯÇÔÀ¸·Î¼­ ½ºÅ©¸°´ýÇÁ¸¦ ÇÒ ¼ö ÀÖ´Ù. ±× Ãâ·ÂÀº »õ·Î¿î ÇàÀÇ ¹®ÀÚµéÀ» Æ÷ÇÔÇÏÁö ¾Ê´Â´Ù¶ó´Â °ÍÀ» Âü°íÇÏÇÏ. µû¶ó¼­
 fold -w 81 /dev/vcs3 | lpr ¶Ç´Â (horrors) setterm -dump 3 -file /proc/self/fd/1¿Í °°Àº ÀϺΠÇÁ·Î¼¼½º°¡ ´õ ÇÊ¿äÇÒ ¼öµµ ÀÖ´Ù. ÀÌ ÇÁ·Î±×·¥Àº µÎ¹ø° °¡»ó ÄܼÖÀÇ ¸¶¿ì½º Ä¿¼­ ¾Æ·¡ÀÇ ¹®ÀÚ ¹× È­¸é ¼Ó¼ºµéÀ» º¸¿©ÁÖ°í, ¹è°æ»öÀ» º¯°æ½ÃŲ´Ù.
        #include <unistd.h>
        #include <stdio.h>
        #include <fcntl.h>

        void main()
        {       int fd;
                struct {char lines, cols, x, y;} scrn;
                char ch, attrib;

                fd = open("/dev/vcsa2", O_RDWR);
                (void)read(fd, &scrn, 4);
                (void)lseek(fd, 4 + 2*(scrn.y*scrn.cols + scrn.x), 0);
                (void)read(fd, &ch, 1);
                (void)read(fd, &attrib, 1);
                printf("ch='%c' attrib=0x%02x\n", ch, attrib);
                attrib ^= 0x10;
                (void)lseek(fd, -1, 1);
                (void)write(fd, &attrib, 1);
        }
 

ÆÄÀÏ

/dev/vcs[0-63]
/dev/vcsa[0-63]  

ÀúÀÚ

Andries Brouwer <aeb@cwi.nl>  

¿ª»ç

Introduced with version 1.1.92 of the Linux kernel.  

°ü·Ã Ç׸ñ

console(4), tty(4), ttys(4), selection(1)


 

Index

À̸§
¼³¸í
¿¹Á¦
ÆÄÀÏ
ÀúÀÚ
¿ª»ç
°ü·Ã Ç׸ñ

This document was created by man2html, using the manual pages.
Time: 08:07:01 GMT, March 25, 2004