CONSOLE.4
上传用户:jnzhq888
上传日期:2007-01-18
资源大小:51694k
文件大小:8k
源码类别:

操作系统开发

开发平台:

WINDOWS

  1. .TH CONSOLE 4
  2. .SH NAME
  3. console, keyboard, log - system console
  4. .SH DESCRIPTION
  5. The TTY device driver manages two devices related to the main user
  6. interface, the system screen and the keyboard.  These two together are
  7. named "the Console".
  8. .SS "The Screen"
  9. The screen of a PC can be managed by a Monochrome Display Adapter, a
  10. Hercules card, a Color Graphics Adapter, an Enhanced Graphics Adapter,
  11. or a Video Graphics Array.  To the console driver these devices are
  12. seen as a block of video memory into which characters can be written to
  13. be displayed, an I/O register that sets the video memory origin to the
  14. character that is to be displayed on the top-left position of the
  15. screen, and an I/O register that sets the position of the hardware
  16. cursor.  Each character within video memory is a two-byte word.  The low
  17. byte is the character code, and the high byte is the "attribute byte",
  18. a set of bits that controls the way the character is displayed,
  19. character and background colours for a colour card, or
  20. intensity/underline/reverse video for monochrome.
  21. .PP
  22. These are the characteristics of the adapters in text mode:
  23. .PP
  24. .RS
  25. .nf
  26. .ta +15n +15n
  27. Adapter Usable memory Mono/Colour
  28. .ta +1n +15n +15n
  29. MDA 4K M
  30. Hercules 4K M
  31. CGA 16K C
  32. EGA 32K M or C
  33. VGA 32K M or C
  34. .fi
  35. .RE
  36. .PP
  37. MDA and Hercules are the same to the console driver, because the graphics
  38. mode of the Hercules is of no use to Minix.  EGA and VGA are also mostly
  39. seen as the same in text mode.  An EGA adapter is either a monochrome or a
  40. colour device depending on the screen attached to it.  A VGA adapter can run
  41. in either monochrome or colour (grayscale) mode depending on how the Boot
  42. Monitor has initialized it.
  43. .PP
  44. The driver uses the video origin to avoid copying the screen contents when
  45. scrolling up or down.  Instead, the origin is simply moved one line.  This is
  46. named "hardware scrolling", as opposed to copying memory: "software
  47. scrolling".
  48. .PP
  49. ." .ig " VC - keep around for if virtual consoles become standard.
  50. The video origin is also used to implement several virtual consoles inside
  51. the video memory of the adapter.  Each virtual console gets a segment of
  52. video memory.  The driver chooses which console to display by moving the
  53. video origin.  Note that an MDA or Hercules adapter can only support one
  54. console.  CGA can support up to four 80x25 consoles, and EGA and VGA can
  55. have eight.  It is best to configure one less console to leave some video
  56. memory free so that hardware scrolling has some space to work in.
  57. .PP
  58. ." ..
  59. Character codes are used as indices into a display font that is stored in the
  60. adapter.  The default font is the IBM character set, which is an ASCII
  61. character set in the low 128 codes, and a number of mathematical, greek,
  62. silly graphics, and accented characters in the upper 128 codes.  This font
  63. is fixed in the MDA, Hercules and CGA adapters, but can be replaced by a
  64. user selected font for the EGA and VGA adapters.
  65. .PP
  66. A number of control characters and escape sequences are implemented by the
  67. driver.  The result is upward compatible with the ANSI standard terminal.
  68. The
  69. .BR termcap (5)
  70. type is
  71. .BR minix .
  72. Normal characters written to the console are displayed at the cursor
  73. position and the cursor is advanced one column to the right.  If an entire
  74. line is filled then the cursor wraps to the first column of the next line
  75. when the next character must be displayed.  The screen is scrolled up if
  76. needed to start a new line.  Some characters have special effects when sent
  77. to the console.  Some even have arguments in the form of comma separated
  78. decimal numbers.  These numbers default to the lowest possible value when
  79. omitted.  The top-left character is at position (1, 1).  The following
  80. control characters and escape sequences are implemented by the console:
  81. .PP
  82. .ta +10n +20n
  83. Sequence Name Function
  84. .in +31n
  85. .ti -30n
  86. ^@ Null Ignored (padding character)
  87. .ti -30n
  88. ^G Bell Produce a short tone from the speaker
  89. .ti -30n
  90. ^H Backspace Move the cursor back one column, wrapping from the
  91. left edge up one line to the right edge
  92. .ti -30n
  93. ^I Horizontal Tab Move to the next tab stop, with each tab stop at
  94. columns 1, 9, 25, etc.  Wrap to the next line if necessary.
  95. .ti -30n
  96. ^J Line Feed Move one line down, scrolling the screen up if
  97. necessary
  98. .ti -30n
  99. ^K Vertical Tab Same as LF
  100. .ti -30n
  101. ^L Form Feed Same as LF
  102. .ti -30n
  103. ^M Carriage Return Move to column 1
  104. .ti -30n
  105. ^[ Escape Start of an escape sequence
  106. .ti -30n
  107. ^[M Reverse Index Move one line up, scrolling the screen down if
  108. necessary
  109. .ti -30n
  110. ^[[fInfPA Cursor Up Move the cursor up fInfP lines
  111. .ti -30n
  112. ^[[fInfPB Cursor Down Move the cursor down fInfP lines
  113. .ti -30n
  114. ^[[fInfPC Cursor Forward Move the cursor right fInfP columns
  115. .ti -30n
  116. ^[[fInfPD Cursor Backward Move the cursor left fInfP columns
  117. .ti -30n
  118. ^[[fImfP;fInfPH Cursor Position Move the cursor to line fImfP,
  119. column fInfP
  120. .ti -30n
  121. ^[[fIsfPJ Erase in Display Clear characters as follows:
  122. .br
  123. fIsfP = 0: From cursor to end of screen
  124. .br
  125. fIsfP = 1: From start of screen to cursor
  126. .br
  127. fIsfP = 2: Entire screen
  128. .ti -30n
  129. ^[[fIsfPK Erase in Line Clear characters as follows:
  130. .br
  131. fIsfP = 0: From cursor to end of line
  132. .br
  133. fIsfP = 1: From start of line to cursor
  134. .br
  135. fIsfP = 2: Entire line
  136. .ti -30n
  137. ^[[fInfPL Insert Lines Insert fInfP blank lines
  138. .ti -30n
  139. ^[[fInfPM Delete Lines Delete fInfP lines
  140. .ti -30n
  141. ^[[fInfP@ Insert Characters Insert fInfP blank characters
  142. .ti -30n
  143. ^[[fInfPP Delete Characters Delete fInfP characters
  144. .ti -30n
  145. ^[[fInfPm Character Attribute Set character attribute as follows:
  146. .br
  147. fInfP = 0: Normal (default) attribute
  148. .br
  149. fInfP = 1: Bold (mono) / Yellow (colour)
  150. .br
  151. fInfP = 4: Underline (M) / Light green (C)
  152. .br
  153. fInfP = 5: Blinking (M) / Magenta (C)
  154. .br
  155. fInfP = 7: Reverse Video
  156. .br
  157. fInfP = 30: Black foreground colour
  158. .br
  159. fInfP = 31: Red
  160. .br
  161. fInfP = 32: Green
  162. .br
  163. fInfP = 33: Orange
  164. .br
  165. fInfP = 34: Blue
  166. .br
  167. fInfP = 35: Magenta
  168. .br
  169. fInfP = 36: Light blue
  170. .br
  171. fInfP = 37: White
  172. .br
  173. fInfP = 40 - 47: Same for background colour
  174. .in -31n
  175. .PP
  176. The console device implements the following ioctl to copy a font into
  177. font memory on EGA and VGA adapters:
  178. .PP
  179. .RS
  180. .BI "ioctl(" fd ", TIOCSFON, u8_t " font "[256][32]);"
  181. .RE
  182. .PP
  183. Font memory consists of 256 character definitions of 32 lines per character
  184. and 8 pixels per line.  The first line is the topmost line of the character.
  185. The leftmost pixel is lit if the most significant bit of a line is set, etc.
  186. The 80x25 video mode used by Minix has an 8x16 character cell, which means
  187. that only the first 16 lines of a character are displayed.
  188. .SS "The Keyboard"
  189. The keyboard produces key codes for each key that is pressed.  These keys
  190. are transformed into character codes or sequences according to the current
  191. keyboard translation table.  The format of this table is described in
  192. .BR keymap (5).
  193. The character codes can be read from the console device unless they map to
  194. special hotkeys.  The hotkeys are as follows:
  195. .PP
  196. .ta +17n
  197. Name Key Function
  198. .in +18n
  199. .ti -17n
  200. CTRL-ALT-DEL Send an abort signal to process 1 (init).  Init then
  201. halts the system
  202. .ti -17n
  203. CTRL-ALT-KP-. Likewise for keypad period
  204. .ti -17n
  205. F1 Process table dump
  206. .ti -17n
  207. F2 Show memory map
  208. .ti -17n
  209. F3 Toggle software/hardware scrolling
  210. .ti -17n
  211. F5 Show network statistics
  212. .ti -17n
  213. CTRL-F7 Send a quit signal to all processes connected to the console
  214. .ti -17n
  215. CTRL-F8 Send an interrupt signal
  216. .ti -17n
  217. CTRL-F9 Send a kill signal.  If CTRL-F8 or CTRL-F7 don't get 'em,
  218. then this surely will.  These keys are for disaster recovery.  You would
  219. normally use DEL and CTRL-e to send interrupt and quit signals.
  220. ." .ig VC
  221. .ti -17n
  222. ALT-F1 Select virtual console 0 (/dev/console)
  223. .ti -17n
  224. ALT-F2 Select virtual console 1 (/dev/ttyc1)
  225. .ti -17n
  226. ALT-F(fInfP+1) Select virtual console fInfP
  227. (/dev/ttycfInfP)
  228. .ti -17n
  229. ALT-Left Select previous virtual console
  230. .ti -17n
  231. ALT-Right Select next virtual console
  232. ." ..
  233. .in -18n
  234. .PP
  235. ."XXX
  236. The keyboard map is set with the
  237. .B KIOCSMAP
  238. ioctl whose precise details are currently hidden in the
  239. .B loadkeys
  240. utility.
  241. .SS "Log device"
  242. The
  243. .B log
  244. device can be used by processes to print debug messages onto the console.
  245. The console is a terminal type device, so it is taken from processes when a
  246. session leader exits.  This does not happen with the log device.
  247. .SH "SEE ALSO"
  248. .BR tty (4),
  249. .BR loadkeys (1),
  250. .BR keymap (5),
  251. .BR boot (8).
  252. .SH NOTES
  253. Output processing turns Line Feeds into CR LF sequences.  Don't let this
  254. surprise you.  Either turn off output processing or use one of the synonyms
  255. for LF.
  256. .SH AUTHOR
  257. Kees J. Bot (kjb@cs.vu.nl)
  258. ." minor editing of man page by asw 07.08.96