⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 console.4

📁 操作系统设计与实现源码
💻 4
字号:
.TH CONSOLE 4.SH NAMEconsole, keyboard, log \- system console.SH DESCRIPTIONThe TTY device driver manages two devices related to the main userinterface, the system screen and the keyboard.  These two together arenamed "the Console"..SS "The Screen"The screen of a PC can be managed by a Monochrome Display Adapter, aHercules card, a Color Graphics Adapter, an Enhanced Graphics Adapter,or a Video Graphics Array.  To the console driver these devices areseen as a block of video memory into which characters can be written tobe displayed, an I/O register that sets the video memory origin to thecharacter that is to be displayed on the top-left position of thescreen, and an I/O register that sets the position of the hardwarecursor.  Each character within video memory is a two-byte word.  The lowbyte is the character code, and the high byte is the "attribute byte",a set of bits that controls the way the character is displayed,character and background colours for a colour card, orintensity/underline/reverse video for monochrome..PPThese are the characteristics of the adapters in text mode:.PP.RS.nf.ta +15n +15nAdapter	Usable memory	Mono/Colour.ta +1n +15n +15n	MDA	4K	M	Hercules	4K	M	CGA	16K	C	EGA	32K	M or C	VGA	32K	M or C.fi.RE.PPMDA and Hercules are the same to the console driver, because the graphicsmode of the Hercules is of no use to Minix.  EGA and VGA are also mostlyseen as the same in text mode.  An EGA adapter is either a monochrome or acolour device depending on the screen attached to it.  A VGA adapter can runin either monochrome or colour (grayscale) mode depending on how the BootMonitor has initialized it..PPThe driver uses the video origin to avoid copying the screen contents whenscrolling up or down.  Instead, the origin is simply moved one line.  This isnamed "hardware scrolling", as opposed to copying memory: "softwarescrolling"..PP.\" .ig \" VC - keep around for if virtual consoles become standard.The video origin is also used to implement several virtual consoles insidethe video memory of the adapter.  Each virtual console gets a segment ofvideo memory.  The driver chooses which console to display by moving thevideo origin.  Note that an MDA or Hercules adapter can only support oneconsole.  CGA can support up to four 80x25 consoles, and EGA and VGA canhave eight.  It is best to configure one less console to leave some videomemory free so that hardware scrolling has some space to work in..PP.\" ..Character codes are used as indices into a display font that is stored in theadapter.  The default font is the IBM character set, which is an ASCIIcharacter set in the low 128 codes, and a number of mathematical, greek,silly graphics, and accented characters in the upper 128 codes.  This fontis fixed in the MDA, Hercules and CGA adapters, but can be replaced by auser selected font for the EGA and VGA adapters..PPA number of control characters and escape sequences are implemented by thedriver.  The result is upward compatible with the ANSI standard terminal.The.BR termcap (5)type is.BR minix .Normal characters written to the console are displayed at the cursorposition and the cursor is advanced one column to the right.  If an entireline is filled then the cursor wraps to the first column of the next linewhen the next character must be displayed.  The screen is scrolled up ifneeded to start a new line.  Some characters have special effects when sentto the console.  Some even have arguments in the form of comma separateddecimal numbers.  These numbers default to the lowest possible value whenomitted.  The top-left character is at position (1, 1).  The followingcontrol characters and escape sequences are implemented by the console:.PP.ta +10n +20nSequence	Name	Function.in +31n.ti -30n^@	Null	Ignored (padding character).ti -30n^G	Bell	Produce a short tone from the speaker.ti -30n^H	Backspace	Move the cursor back one column, wrapping from theleft edge up one line to the right edge.ti -30n^I	Horizontal Tab	Move to the next tab stop, with each tab stop atcolumns 1, 9, 25, etc.  Wrap to the next line if necessary..ti -30n^J	Line Feed	Move one line down, scrolling the screen up ifnecessary.ti -30n^K	Vertical Tab	Same as LF.ti -30n^L	Form Feed	Same as LF.ti -30n^M	Carriage Return	Move to column 1.ti -30n^[	Escape	Start of an escape sequence.ti -30n^[M	Reverse Index	Move one line up, scrolling the screen down ifnecessary.ti -30n^[[\fIn\fPA	Cursor Up	Move the cursor up \fIn\fP lines.ti -30n^[[\fIn\fPB	Cursor Down	Move the cursor down \fIn\fP lines.ti -30n^[[\fIn\fPC	Cursor Forward	Move the cursor right \fIn\fP columns.ti -30n^[[\fIn\fPD	Cursor Backward	Move the cursor left \fIn\fP columns.ti -30n^[[\fIm\fP;\fIn\fPH	Cursor Position	Move the cursor to line \fIm\fP,column \fIn\fP.ti -30n^[[\fIs\fPJ	Erase in Display	Clear characters as follows:.br\fIs\fP = 0: From cursor to end of screen.br\fIs\fP = 1: From start of screen to cursor.br\fIs\fP = 2: Entire screen.ti -30n^[[\fIs\fPK	Erase in Line	Clear characters as follows:.br\fIs\fP = 0: From cursor to end of line.br\fIs\fP = 1: From start of line to cursor.br\fIs\fP = 2: Entire line.ti -30n^[[\fIn\fPL	Insert Lines	Insert \fIn\fP blank lines.ti -30n^[[\fIn\fPM	Delete Lines	Delete \fIn\fP lines.ti -30n^[[\fIn\fP@	Insert Characters	Insert \fIn\fP blank characters.ti -30n^[[\fIn\fPP	Delete Characters	Delete \fIn\fP characters.ti -30n^[[\fIn\fPm	Character Attribute	Set character attribute as follows:.br\fIn\fP = 0: Normal (default) attribute.br\fIn\fP = 1: Bold (mono) / Yellow (colour).br\fIn\fP = 4: Underline (M) / Light green (C).br\fIn\fP = 5: Blinking (M) / Magenta (C).br\fIn\fP = 7: Reverse Video.br\fIn\fP = 30: Black foreground colour.br\fIn\fP = 31: Red.br\fIn\fP = 32: Green.br\fIn\fP = 33: Orange.br\fIn\fP = 34: Blue.br\fIn\fP = 35: Magenta.br\fIn\fP = 36: Light blue.br\fIn\fP = 37: White.br\fIn\fP = 40 \- 47: Same for background colour.in -31n.PPThe console device implements the following ioctl to copy a font intofont memory on EGA and VGA adapters:.PP.RS.BI "ioctl(" fd ", TIOCSFON, u8_t " font "[256][32]);".RE.PPFont memory consists of 256 character definitions of 32 lines per characterand 8 pixels per line.  The first line is the topmost line of the character.The leftmost pixel is lit if the most significant bit of a line is set, etc.The 80x25 video mode used by Minix has an 8x16 character cell, which meansthat only the first 16 lines of a character are displayed..SS "The Keyboard"The keyboard produces key codes for each key that is pressed.  These keysare transformed into character codes or sequences according to the currentkeyboard translation table.  The format of this table is described in.BR keymap (5).The character codes can be read from the console device unless they map tospecial hotkeys.  The hotkeys are as follows:.PP.ta +17nName	Key	Function.in +18n.ti -17nCTRL\-ALT\-DEL	Send an abort signal to process 1 (init).  Init thenhalts the system.ti -17nCTRL\-ALT\-KP-.	Likewise for keypad period.ti -17nF1	Process table dump.ti -17nF2	Show memory map.ti -17nF3	Toggle software/hardware scrolling.ti -17nF5	Show network statistics.ti -17nCTRL\-F7	Send a quit signal to all processes connected to the console.ti -17nCTRL\-F8	Send an interrupt signal.ti -17nCTRL\-F9	Send a kill signal.  If CTRL\-F8 or CTRL\-F7 don't get 'em,then this surely will.  These keys are for disaster recovery.  You wouldnormally use DEL and CTRL\-\e to send interrupt and quit signals..\" .ig VC.ti -17nALT\-F1	Select virtual console 0 (/dev/console).ti -17nALT\-F2	Select virtual console 1 (/dev/ttyc1).ti -17nALT\-F(\fIn\fP+1)	Select virtual console \fIn\fP(/dev/ttyc\fIn\fP).ti -17nALT\-Left	Select previous virtual console.ti -17nALT\-Right	Select next virtual console.\" ...in -18n.PP.\"XXXThe keyboard map is set with the.B KIOCSMAPioctl whose precise details are currently hidden in the.B loadkeysutility..SS "Log device"The.B logdevice can be used by processes to print debug messages onto the console.The console is a terminal type device, so it is taken from processes when asession leader exits.  This does not happen with the log device..SH "SEE ALSO".BR tty (4),.BR loadkeys (1),.BR keymap (5),.BR boot (8)..SH NOTESOutput processing turns Line Feeds into CR LF sequences.  Don't let thissurprise you.  Either turn off output processing or use one of the synonymsfor LF..SH AUTHORKees J. Bot (kjb@cs.vu.nl).\" minor editing of man page by asw 07.08.96

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -