diff --git a/include/proto.h b/include/proto.h index dc7a860..a7b1ce1 100644 --- a/include/proto.h +++ b/include/proto.h @@ -39,7 +39,6 @@ void keyboard_read(); /* tty.c */ // added by mingxuan 2019-5-19 -void in_process(TTY *p_tty, u32 key); void task_tty(); void tty_write(NTTY *tty, char *buf, int len); int tty_read(NTTY *tty, char *buf, int len); diff --git a/include/tty.h b/include/tty.h index 3e9f2db..bcc0358 100644 --- a/include/tty.h +++ b/include/tty.h @@ -27,28 +27,6 @@ #define TTY_STATE_WAIT_SPACE 2 /*010*/ #define TTY_STATE_DISPLAY 1 /*001*/ -struct s_tty; -struct s_console; - -/* TTY */ -typedef struct s_tty -{ - u32 ibuf[TTY_IN_BYTES]; /* TTY input buffer */ - u32 *ibuf_head; /* the next free slot */ - u32 *ibuf_tail; /* 缓冲区显示位置指针 */ - u32 *ibuf_read; - int ibuf_cnt; /* how many */ - int ibuf_read_cnt; - int status; - - int mouse_left_button; - int mouse_mid_button; - int mouse_X; - int mouse_Y; - - struct s_console *console; -} TTY; - typedef struct n_tty { int driver_type; // 1-vga&kbd; 2-serial @@ -110,7 +88,6 @@ NTTY *get_tty(const int nr_tty); void vga_tty_init(NTTY *tty); void vga_tty_write(NTTY *tty, char ch); void vga_tty_flush(NTTY *tty); -void vga_tty_backspace(NTTY *tty); void vga_tty_scroll(NTTY *tty, int direction); void vga_tty_select(NTTY *tty); diff --git a/kernel/global.c b/kernel/global.c index 5eee110..1ee7d94 100644 --- a/kernel/global.c +++ b/kernel/global.c @@ -78,6 +78,3 @@ system_call sys_call_table[NR_SYS_CALL] = { sys_createdir, // added by mingxuan 2019-5-17 sys_deletedir // added by mingxuan 2019-5-17 }; - -TTY tty_table[NR_CONSOLES]; // added by mingxuan 2019-5-19 -CONSOLE console_table[NR_CONSOLES]; // added by mingxuan 2019-5-19 \ No newline at end of file diff --git a/kernel/vga.c b/kernel/vga.c index fe8452b..3c0b072 100644 --- a/kernel/vga.c +++ b/kernel/vga.c @@ -633,23 +633,6 @@ void vga_tty_write(NTTY *tty, char ch) // kprintf("row: %d; ", vga->cur_row); } -void vga_tty_backspace(NTTY *tty) -{ - vga_buf *vga = tty->output_buf; - u16 *buf = vga->buf; - if (vga->cur_col == 0) - { - vga->cur_col = SCR_WIDTH - 1; - vga->scr_cur_line = LASTLINE(vga->scr_cur_line); - } - else - { - vga->cur_col--; - } - buf[INDEX(vga->scr_cur_line, vga->cur_col)] = BLANK; - vga->cur_row = CYCLE_SUB(vga->scr_top_line, vga->scr_cur_line, SCR_MAXLINE); -} - void vga_tty_flush(NTTY *tty) { vga_buf *vga = tty->output_buf;