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