diff --git a/fs/buffer.c b/fs/buffer.c index f966d40d9da7d13962540023b60f80d83d63691d..3f12e16df0bd3188821a629921f8822d227f150a 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -249,11 +249,6 @@ void bread_page(unsigned long address,int dev,int b[4]) { struct buffer_head * bh[4]; int i; - for (i = 0; i < 4; i++) { - printk("%d,", b[i]); - } - printk("\n"); - for (i = 0; i < 4; i++) { if (b[i]) { if ((bh[i] = getblk(dev,b[i]))) { diff --git a/fs/open.c b/fs/open.c index dc8dbc1f93fab03cb433a23c26efa0edb5554787..d6c1970d0ddb7083c2edbbb7624e5ed4b3044c1a 100644 --- a/fs/open.c +++ b/fs/open.c @@ -109,7 +109,7 @@ int sys_open(const char * filename,int flag,int mode) { } if (S_ISCHR(inode->i_mode)) { - printk("open char dev %d\n", fd); + printk("open char dev %s\n", filename); } f->f_mode = inode->i_mode; diff --git a/kernel/chr_drv/kboard.c b/kernel/chr_drv/kboard.c index 30436a38107212a437f862b18f3df14fb34a15d4..04883bc5662b01fde9b20b1a08dd07240529b4bc 100644 --- a/kernel/chr_drv/kboard.c +++ b/kernel/chr_drv/kboard.c @@ -23,7 +23,6 @@ void uncaps(); void alt() {} void unalt() {} void unctrl() {} -void minus() {} void num() {} void scroll() {} @@ -41,7 +40,7 @@ static key_fn key_table[] = { do_self,do_self,lshift,do_self, /* 28-2B { para lshift , */ do_self,do_self,do_self,do_self, /* 2C-2F z x c v */ do_self,do_self,do_self,do_self, /* 30-33 b n m , */ - do_self,minus,rshift,do_self, /* 34-37 . - rshift * */ + do_self,do_self,rshift,do_self, /* 34-37 . - rshift * */ alt,do_self,caps,func, /* 38-3B alt sp caps f1 */ func,func,func,func, /* 3C-3F f2 f3 f4 f5 */ func,func,func,func, /* 40-43 f6 f7 f8 f9 */ @@ -101,7 +100,7 @@ static char key_map[0x7f] = { '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '=', 127, 9, 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', - 10, 0, + 13, 0, 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', 0, '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', @@ -110,14 +109,14 @@ static char key_map[0x7f] = { '-', 0, 0, 0, '+', 0,0,0,0,0,0,0, '>', - 0,0,0,0,0,0,0,0,0,0}; + 0,0,0,0,0,0,0,0,0,0}; static char shift_map[0x7f] = { 0,27, '!', '@', '#', '$', '%', '^', '&', '*','(',')','_','+', 127,9, 'Q','W','E','R','T','Y','U','I','O','P','{','}', - 10,0, + 13,0, 'A','S','D','F','G','H','J','K','L',':','\"', '~',0, '|','Z','X','C','V','B','N','M','<','>','?', diff --git a/kernel/chr_drv/tty_io.c b/kernel/chr_drv/tty_io.c index 80e704a03840ef9cbf95ec6841207a175ac49feb..9c3b7e951c08c326324f0782f3c386be75f11098 100644 --- a/kernel/chr_drv/tty_io.c +++ b/kernel/chr_drv/tty_io.c @@ -1,13 +1,23 @@ #include +#include +#include +#include + +#define ALRMMASK (1<<(SIGALRM-1)) + +#include #include #include +#include #define _L_FLAG(tty,f) ((tty)->termios.c_lflag & f) -#define _O_FLAG(tty,f) ((tty)->termios.c_oflag & f) #define _I_FLAG(tty,f) ((tty)->termios.c_iflag & f) +#define _O_FLAG(tty,f) ((tty)->termios.c_oflag & f) #define L_CANON(tty) _L_FLAG((tty),ICANON) +#define L_ISIG(tty) _L_FLAG((tty),ISIG) #define L_ECHO(tty) _L_FLAG((tty),ECHO) +#define L_ECHOE(tty) _L_FLAG((tty),ECHOE) #define L_ECHOCTL(tty) _L_FLAG((tty),ECHOCTL) #define O_POST(tty) _O_FLAG((tty),OPOST) @@ -28,7 +38,7 @@ struct tty_struct tty_table[] = { ICRNL, OPOST | ONLCR, 0, - ISIG | ICANON | ECHO | ECHOKE, + ISIG | ICANON | ECHO | ECHOCTL | ECHOKE, 0, INIT_C_CC }, @@ -42,11 +52,27 @@ struct tty_struct tty_table[] = { } }; - void tty_init() { con_init(); } +static void sleep_if_empty(struct tty_queue * queue) { + cli(); + while (!(current->signal & ~current->blocked) && EMPTY(*queue)) + interruptible_sleep_on(&queue->proc_list); + sti(); +} + +static void sleep_if_full(struct tty_queue * queue) { + if (!FULL(*queue)) + return; + + cli(); + while (!(current->signal & ~current->blocked) && LEFT(*queue)<128) + interruptible_sleep_on(&queue->proc_list); + sti(); +} + int tty_read(unsigned channel, char * buf, int nr) { struct tty_struct * tty; char c, * b=buf; @@ -73,6 +99,7 @@ int tty_read(unsigned channel, char * buf, int nr) { return (b - buf); } else { +// printk("tty_read:%c\n", c); put_fs_byte(c,b++); if (!--nr) break; @@ -126,8 +153,12 @@ int tty_write(unsigned channel, char* buf, int nr) { void copy_to_cooked(struct tty_struct * tty) { signed char c; - - while (!EMPTY(tty->read_q) && !FULL(tty->secondary)) { + + while (1) { + if (EMPTY(tty->read_q)) + break; + if (FULL(tty->secondary)) + break; GETCH(tty -> read_q, c); if (c == 13) { @@ -197,9 +228,6 @@ void copy_to_cooked(struct tty_struct * tty) { PUTCH('^', tty->write_q); PUTCH(c + 64, tty->write_q); } - else { - PUTCH(c, tty->write_q); - } } else PUTCH(c, tty->write_q); diff --git a/kernel/sys_call.S b/kernel/sys_call.S index db98b2d8d59d72bd38d0b43960d6f0dd07e3e72a..8b2311bb3c048061ae04053c3c4438347b4c2dff 100644 --- a/kernel/sys_call.S +++ b/kernel/sys_call.S @@ -55,11 +55,11 @@ system_call: movl $0x17, %edx movw %dx, %fs - //pushl %eax - //pushl $show_ind - //call printk - //popl %eax - //popl %eax + pushl %eax + pushl $show_ind + call printk + popl %eax + popl %eax call *sys_call_table(, %eax, 4) pushl %eax diff --git a/mm/memory.c b/mm/memory.c index e92758d2ccc7c5401a7fe156f16036307f8e2abc..e4a6147ee8dcfd2a6c202fafbbc14cee2c189f96 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -307,7 +307,6 @@ void do_no_page(unsigned long error_code,unsigned long address) { oom(); block = 1 + tmp / BLOCK_SIZE; - printk("blocks is %d, 0x%x\n", block, tmp); for (i = 0; i < 4; block++, i++) { nr[i] = bmap(current->executable, block);