亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? console.c

?? Minix3.11的源碼。[MINIX 3是一個為高可靠性應用而設計的自由且簡潔的類UNIX系統。]
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* Code and data for the IBM console driver. * * The 6845 video controller used by the IBM PC shares its video memory with * the CPU somewhere in the 0xB0000 memory bank.  To the 6845 this memory * consists of 16-bit words.  Each word has a character code in the low byte * and a so-called attribute byte in the high byte.  The CPU directly modifies * video memory to display characters, and sets two registers on the 6845 that * specify the video origin and the cursor position.  The video origin is the * place in video memory where the first character (upper left corner) can * be found.  Moving the origin is a fast way to scroll the screen.  Some * video adapters wrap around the top of video memory, so the origin can * move without bounds.  For other adapters screen memory must sometimes be * moved to reset the origin.  All computations on video memory use character * (word) addresses for simplicity and assume there is no wrapping.  The * assembly support functions translate the word addresses to byte addresses * and the scrolling function worries about wrapping. */#include "../drivers.h"#include <termios.h>#include <minix/callnr.h>#include <minix/com.h>#include "tty.h"#include "../../kernel/const.h"#include "../../kernel/config.h"#include "../../kernel/type.h"/* Definitions used by the console driver. */#define MONO_BASE    0xB0000L	/* base of mono video memory */#define COLOR_BASE   0xB8000L	/* base of color video memory */#define MONO_SIZE     0x1000	/* 4K mono video memory */#define COLOR_SIZE    0x4000	/* 16K color video memory */#define EGA_SIZE      0x8000	/* EGA & VGA have at least 32K */#define BLANK_COLOR   0x0700	/* determines cursor color on blank screen */#define SCROLL_UP          0	/* scroll forward */#define SCROLL_DOWN        1	/* scroll backward */#define BLANK_MEM ((u16_t *) 0)	/* tells mem_vid_copy() to blank the screen */#define CONS_RAM_WORDS    80	/* video ram buffer size */#define MAX_ESC_PARMS      4	/* number of escape sequence params allowed *//* Constants relating to the controller chips. */#define M_6845         0x3B4	/* port for 6845 mono */#define C_6845         0x3D4	/* port for 6845 color */#define INDEX              0	/* 6845's index register */#define DATA               1	/* 6845's data register */#define STATUS             6	/* 6845's status register */#define VID_ORG           12	/* 6845's origin register */#define CURSOR            14	/* 6845's cursor register *//* Beeper. */#define BEEP_FREQ     0x0533	/* value to put into timer to set beep freq */#define B_TIME		   3	/* length of CTRL-G beep is ticks *//* definitions used for font management */#define GA_SEQUENCER_INDEX	0x3C4#define GA_SEQUENCER_DATA	0x3C5#define GA_GRAPHICS_INDEX	0x3CE#define GA_GRAPHICS_DATA	0x3CF#define GA_VIDEO_ADDRESS	0xA0000L#define GA_FONT_SIZE		8192/* Global variables used by the console driver and assembly support. */PUBLIC int vid_index;		/* index of video segment in remote mem map */PUBLIC u16_t vid_seg;PUBLIC vir_bytes vid_off;	/* video ram is found at vid_seg:vid_off */PUBLIC unsigned vid_size;	/* 0x2000 for color or 0x0800 for mono */PUBLIC unsigned vid_mask;	/* 0x1FFF for color or 0x07FF for mono */PUBLIC unsigned blank_color = BLANK_COLOR; /* display code for blank *//* Private variables used by the console driver. */PRIVATE int vid_port;		/* I/O port for accessing 6845 */PRIVATE int wrap;		/* hardware can wrap? */PRIVATE int softscroll;		/* 1 = software scrolling, 0 = hardware */PRIVATE int beeping;		/* speaker is beeping? */PRIVATE unsigned font_lines;	/* font lines per character */PRIVATE unsigned scr_width;	/* # characters on a line */PRIVATE unsigned scr_lines;	/* # lines on the screen */PRIVATE unsigned scr_size;	/* # characters on the screen *//* Per console data. */typedef struct console {  tty_t *c_tty;			/* associated TTY struct */  int c_column;			/* current column number (0-origin) */  int c_row;			/* current row (0 at top of screen) */  int c_rwords;			/* number of WORDS (not bytes) in outqueue */  unsigned c_start;		/* start of video memory of this console */  unsigned c_limit;		/* limit of this console's video memory */  unsigned c_org;		/* location in RAM where 6845 base points */  unsigned c_cur;		/* current position of cursor in video RAM */  unsigned c_attr;		/* character attribute */  unsigned c_blank;		/* blank attribute */  char c_reverse;		/* reverse video */  char c_esc_state;		/* 0=normal, 1=ESC, 2=ESC[ */  char c_esc_intro;		/* Distinguishing character following ESC */  int *c_esc_parmp;		/* pointer to current escape parameter */  int c_esc_parmv[MAX_ESC_PARMS];	/* list of escape parameters */  u16_t c_ramqueue[CONS_RAM_WORDS];	/* buffer for video RAM */} console_t;PRIVATE int nr_cons= 1;		/* actual number of consoles */PRIVATE console_t cons_table[NR_CONS];PRIVATE console_t *curcons;	/* currently visible *//* Color if using a color controller. */#define color	(vid_port == C_6845)/* Map from ANSI colors to the attributes used by the PC */PRIVATE int ansi_colors[8] = {0, 4, 2, 6, 1, 5, 3, 7};/* Structure used for font management */struct sequence {	unsigned short index;	unsigned char port;	unsigned char value;};FORWARD _PROTOTYPE( int cons_write, (struct tty *tp, int try)		);FORWARD _PROTOTYPE( void cons_echo, (tty_t *tp, int c)			);FORWARD _PROTOTYPE( void out_char, (console_t *cons, int c)		);FORWARD _PROTOTYPE( void cons_putk, (int c)				);FORWARD _PROTOTYPE( void beep, (void)					);FORWARD _PROTOTYPE( void do_escape, (console_t *cons, int c)		);FORWARD _PROTOTYPE( void flush, (console_t *cons)			);FORWARD _PROTOTYPE( void parse_escape, (console_t *cons, int c)		);FORWARD _PROTOTYPE( void scroll_screen, (console_t *cons, int dir)	);FORWARD _PROTOTYPE( void set_6845, (int reg, unsigned val)		);FORWARD _PROTOTYPE( void get_6845, (int reg, unsigned *val)		);FORWARD _PROTOTYPE( void stop_beep, (timer_t *tmrp)			);FORWARD _PROTOTYPE( void cons_org0, (void)				);FORWARD _PROTOTYPE( int ga_program, (struct sequence *seq)		);FORWARD _PROTOTYPE( int cons_ioctl, (tty_t *tp, int)			);/*===========================================================================* *				cons_write				     * *===========================================================================*/PRIVATE int cons_write(tp, try)register struct tty *tp;	/* tells which terminal is to be used */int try;{/* Copy as much data as possible to the output queue, then start I/O.  On * memory-mapped terminals, such as the IBM console, the I/O will also be * finished, and the counts updated.  Keep repeating until all I/O done. */  int count;  int result;  register char *tbuf;  char buf[64];  console_t *cons = tp->tty_priv;  if (try) return 1;	/* we can always write to console */  /* Check quickly for nothing to do, so this can be called often without   * unmodular tests elsewhere.   */  if ((count = tp->tty_outleft) == 0 || tp->tty_inhibited) return;  /* Copy the user bytes to buf[] for decent addressing. Loop over the   * copies, since the user buffer may be much larger than buf[].   */  do {	if (count > sizeof(buf)) count = sizeof(buf);	if ((result = sys_vircopy(tp->tty_outproc, D, tp->tty_out_vir, 			SELF, D, (vir_bytes) buf, (vir_bytes) count)) != OK)		break;	tbuf = buf;	/* Update terminal data structure. */	tp->tty_out_vir += count;	tp->tty_outcum += count;	tp->tty_outleft -= count;	/* Output each byte of the copy to the screen.  Avoid calling	 * out_char() for the "easy" characters, put them into the buffer	 * directly.	 */	do {		if ((unsigned) *tbuf < ' ' || cons->c_esc_state > 0			|| cons->c_column >= scr_width			|| cons->c_rwords >= buflen(cons->c_ramqueue))		{			out_char(cons, *tbuf++);		} else {			cons->c_ramqueue[cons->c_rwords++] =					cons->c_attr | (*tbuf++ & BYTE);			cons->c_column++;		}	} while (--count != 0);  } while ((count = tp->tty_outleft) != 0 && !tp->tty_inhibited);  flush(cons);			/* transfer anything buffered to the screen */  /* Reply to the writer if all output is finished or if an error occured. */  if (tp->tty_outleft == 0 || result != OK) {	/* REVIVE is not possible. I/O on memory mapped consoles finishes. */	tty_reply(tp->tty_outrepcode, tp->tty_outcaller, tp->tty_outproc,							tp->tty_outcum);	tp->tty_outcum = 0;  }}/*===========================================================================* *				cons_echo				     * *===========================================================================*/PRIVATE void cons_echo(tp, c)register tty_t *tp;		/* pointer to tty struct */int c;				/* character to be echoed */{/* Echo keyboard input (print & flush). */  console_t *cons = tp->tty_priv;  out_char(cons, c);  flush(cons);}/*===========================================================================* *				out_char				     * *===========================================================================*/PRIVATE void out_char(cons, c)register console_t *cons;	/* pointer to console struct */int c;				/* character to be output */{/* Output a character on the console.  Check for escape sequences first. */  if (cons->c_esc_state > 0) {	parse_escape(cons, c);	return;  }  switch(c) {	case 000:		/* null is typically used for padding */		return;		/* better not do anything */	case 007:		/* ring the bell */		flush(cons);	/* print any chars queued for output */		beep();		return;	case '\b':		/* backspace */		if (--cons->c_column < 0) {			if (--cons->c_row >= 0) cons->c_column += scr_width;		}		flush(cons);		return;	case '\n':		/* line feed */		if ((cons->c_tty->tty_termios.c_oflag & (OPOST|ONLCR))						== (OPOST|ONLCR)) {			cons->c_column = 0;		}		/*FALL THROUGH*/	case 013:		/* CTRL-K */	case 014:		/* CTRL-L */		if (cons->c_row == scr_lines-1) {			scroll_screen(cons, SCROLL_UP);		} else {			cons->c_row++;		}		flush(cons);		return;	case '\r':		/* carriage return */		cons->c_column = 0;		flush(cons);		return;	case '\t':		/* tab */		cons->c_column = (cons->c_column + TAB_SIZE) & ~TAB_MASK;		if (cons->c_column > scr_width) {			cons->c_column -= scr_width;			if (cons->c_row == scr_lines-1) {				scroll_screen(cons, SCROLL_UP);			} else {				cons->c_row++;			}		}		flush(cons);		return;	case 033:		/* ESC - start of an escape sequence */		flush(cons);	/* print any chars queued for output */		cons->c_esc_state = 1;	/* mark ESC as seen */		return;	default:		/* printable chars are stored in ramqueue */		if (cons->c_column >= scr_width) {			if (!LINEWRAP) return;			if (cons->c_row == scr_lines-1) {				scroll_screen(cons, SCROLL_UP);			} else {				cons->c_row++;			}			cons->c_column = 0;			flush(cons);		}		if (cons->c_rwords == buflen(cons->c_ramqueue)) flush(cons);		cons->c_ramqueue[cons->c_rwords++] = cons->c_attr | (c & BYTE);		cons->c_column++;			/* next column */		return;  }}/*===========================================================================* *				scroll_screen				     * *===========================================================================*/PRIVATE void scroll_screen(cons, dir)register console_t *cons;	/* pointer to console struct */int dir;			/* SCROLL_UP or SCROLL_DOWN */{  unsigned new_line, new_org, chars;  flush(cons);  chars = scr_size - scr_width;		/* one screen minus one line */  /* Scrolling the screen is a real nuisance due to the various incompatible   * video cards.  This driver supports software scrolling (Hercules?),   * hardware scrolling (mono and CGA cards) and hardware scrolling without   * wrapping (EGA cards).  In the latter case we must make sure that   *		c_start <= c_org && c_org + scr_size <= c_limit   * holds, because EGA doesn't wrap around the end of video memory.   */  if (dir == SCROLL_UP) {	/* Scroll one line up in 3 ways: soft, avoid wrap, use origin. */	if (softscroll) {		vid_vid_copy(cons->c_start + scr_width, cons->c_start, chars);	} else	if (!wrap && cons->c_org + scr_size + scr_width >= cons->c_limit) {		vid_vid_copy(cons->c_org + scr_width, cons->c_start, chars);		cons->c_org = cons->c_start;	} else {		cons->c_org = (cons->c_org + scr_width) & vid_mask;	}	new_line = (cons->c_org + chars) & vid_mask;  } else {	/* Scroll one line down in 3 ways: soft, avoid wrap, use origin. */	if (softscroll) {		vid_vid_copy(cons->c_start, cons->c_start + scr_width, chars);	} else	if (!wrap && cons->c_org < cons->c_start + scr_width) {		new_org = cons->c_limit - scr_size;		vid_vid_copy(cons->c_org, new_org + scr_width, chars);		cons->c_org = new_org;	} else {		cons->c_org = (cons->c_org - scr_width) & vid_mask;	}	new_line = cons->c_org;  }  /* Blank the new line at top or bottom. */  blank_color = cons->c_blank;  mem_vid_copy(BLANK_MEM, new_line, scr_width);  /* Set the new video origin. */  if (cons == curcons) set_6845(VID_ORG, cons->c_org);  flush(cons);}/*===========================================================================* *				flush					     * *===========================================================================*/PRIVATE void flush(cons)register console_t *cons;	/* pointer to console struct */{/* Send characters buffered in 'ramqueue' to screen memory, check the new * cursor position, compute the new hardware cursor position and set it. */  unsigned cur;  tty_t *tp = cons->c_tty;  /* Have the characters in 'ramqueue' transferred to the screen. */  if (cons->c_rwords > 0) {	mem_vid_copy(cons->c_ramqueue, cons->c_cur, cons->c_rwords);	cons->c_rwords = 0;	/* TTY likes to know the current column and if echoing messed up. */	tp->tty_position = cons->c_column;	tp->tty_reprint = TRUE;  }  /* Check and update the cursor position. */  if (cons->c_column < 0) cons->c_column = 0;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二三区在线观看| 91国在线观看| 久久综合给合久久狠狠狠97色69| 美国毛片一区二区三区| 日韩欧美一区二区三区在线| 成人一级片在线观看| 亚洲乱码国产乱码精品精98午夜 | 日韩一区二区在线观看视频播放| 在线日韩一区二区| 国产自产高清不卡| 亚洲视频香蕉人妖| 欧美亚洲尤物久久| 精品一区二区久久| 夜夜嗨av一区二区三区四季av| 日韩美一区二区三区| 日韩欧美三级在线| ww久久中文字幕| 欧美激情在线观看视频免费| 欧美艳星brazzers| 91精品国产色综合久久不卡蜜臀| 99久久精品免费精品国产| 男人的j进女人的j一区| 亚洲日本va午夜在线影院| 一区二区三区在线免费播放| 亚洲大型综合色站| 亚洲欧洲日韩av| 26uuu久久天堂性欧美| 国产欧美一区二区三区在线看蜜臀 | 亚洲特级片在线| 亚洲视频1区2区| 午夜精品一区二区三区电影天堂| 亚洲欧洲av在线| 亚洲另类中文字| 午夜精品久久久久久久蜜桃app| 日韩av网站在线观看| 亚洲电影你懂得| 经典三级一区二区| 99视频在线精品| 国产suv精品一区二区883| 国产一区二区三区精品视频| 日韩国产欧美三级| 国产精品18久久久久久vr| 亚洲精品视频在线观看免费 | 国产精品1024久久| 在线精品亚洲一区二区不卡| 日韩欧美亚洲另类制服综合在线 | 国产成人夜色高潮福利影视| 91福利资源站| 久久尤物电影视频在线观看| 亚洲伦理在线免费看| 裸体歌舞表演一区二区| 美美哒免费高清在线观看视频一区二区 | 色综合天天视频在线观看| 不卡的av中国片| 成人av资源站| 欧美一区二区三区系列电影| 国产精品美女久久福利网站| 亚洲欧美日韩成人高清在线一区| 国产精品大尺度| 亚洲天堂2016| 国产麻豆精品一区二区| 欧美三区在线观看| 欧美日韩不卡在线| 欧美日韩国产大片| 国产精品丝袜91| 久久丁香综合五月国产三级网站| 色婷婷综合激情| 欧美国产一区视频在线观看| 日韩精彩视频在线观看| 老司机午夜精品99久久| 色婷婷综合久久久中文字幕| 国产亚洲精品aa| 中文字幕日韩一区| 精彩视频一区二区三区| 欧美日韩不卡视频| 亚洲欧美欧美一区二区三区| 豆国产96在线|亚洲| 欧美一级二级三级蜜桃| 亚洲一区二区av在线| 日本不卡一二三| 在线观看日韩精品| 中文字幕一区二区5566日韩| 国产资源在线一区| 日韩欧美一区中文| 石原莉奈一区二区三区在线观看| 色一情一乱一乱一91av| 国产精品国产三级国产有无不卡| 精品一区二区三区不卡| 日韩视频一区二区在线观看| 亚洲h动漫在线| 在线免费观看日本欧美| 亚洲乱码国产乱码精品精98午夜 | 欧美美女一区二区| 久久久三级国产网站| 亚洲精品乱码久久久久久| 成人国产精品免费观看视频| 久久久99精品久久| 狠狠狠色丁香婷婷综合激情 | 五月综合激情婷婷六月色窝| 在线视频你懂得一区| 亚洲欧美日韩综合aⅴ视频| jiyouzz国产精品久久| 国产精品免费aⅴ片在线观看| 国产精品911| 日本一区二区三区久久久久久久久不 | 午夜精品久久久久久久99水蜜桃| 色婷婷综合中文久久一本| 亚洲精品乱码久久久久久久久 | 国产99久久久精品| 国产欧美一区二区精品秋霞影院| 国产乱人伦偷精品视频不卡| 国产亚洲成年网址在线观看| 国产高清精品久久久久| 中文字幕精品一区二区三区精品| fc2成人免费人成在线观看播放| 国产精品全国免费观看高清| voyeur盗摄精品| 亚洲影视在线播放| 欧美福利视频一区| 久久电影网电视剧免费观看| 久久精品一区二区| 99精品1区2区| 亚洲高清免费视频| 91色婷婷久久久久合中文| 久久蜜桃av一区二区天堂| 风间由美一区二区三区在线观看| 国产精品乱子久久久久| 91国偷自产一区二区三区成为亚洲经典 | 亚洲综合av网| 宅男噜噜噜66一区二区66| 亚洲视频小说图片| 欧美乱妇15p| 精品在线播放免费| 国产精品国产三级国产a| 91国偷自产一区二区三区观看 | 欧日韩精品视频| 免费成人你懂的| 国产清纯美女被跳蛋高潮一区二区久久w | 欧美国产精品专区| 91黄色激情网站| 精品亚洲国内自在自线福利| 国产精品视频yy9299一区| 欧美亚洲国产一区在线观看网站 | 欧美亚洲一区二区三区四区| 捆绑紧缚一区二区三区视频| 国产精品网曝门| 欧美日韩一区视频| 国产99精品在线观看| 性做久久久久久免费观看| 久久亚洲一区二区三区明星换脸 | 久久婷婷国产综合国色天香| 色一情一伦一子一伦一区| 久久se这里有精品| 亚洲视频一二区| 337p日本欧洲亚洲大胆精品| 91在线一区二区三区| 天堂影院一区二区| 国产精品三级久久久久三级| 91麻豆精品久久久久蜜臀| 91在线视频官网| 精品一区二区三区视频| 亚洲综合网站在线观看| 国产蜜臀97一区二区三区| 欧美一区二区三区免费视频 | 久久久蜜桃精品| 欧美日韩极品在线观看一区| 粉嫩一区二区三区性色av| 日韩电影免费在线看| 中文字幕一区av| 久久婷婷久久一区二区三区| 欧美精品黑人性xxxx| 91视视频在线直接观看在线看网页在线看| 日韩中文字幕av电影| 亚洲欧美成aⅴ人在线观看| 久久久影视传媒| 日韩精品中文字幕一区二区三区| 色噜噜久久综合| 成人午夜激情在线| 精品一区免费av| 视频一区国产视频| 夜夜夜精品看看| 亚洲免费观看高清在线观看| 国产三级欧美三级| 欧美大胆人体bbbb| 制服丝袜激情欧洲亚洲| 欧洲精品中文字幕| 色婷婷久久久综合中文字幕| 国产精品小仙女| 精品一区二区免费视频| 美腿丝袜一区二区三区| 日韩一区精品字幕| 亚洲成人一区在线| 亚洲一级电影视频| 一二三四社区欧美黄| 亚洲码国产岛国毛片在线| 国产精品大尺度| 国产精品入口麻豆九色| 国产精品久久久久一区 | 国产一区二区剧情av在线| 久久99精品久久久|