Skip to content

Commit

Permalink
修复缓冲队列未初始化造成键盘驱动崩溃的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyi1212 committed Nov 6, 2024
1 parent 01cf7f3 commit cd3be76
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/driver/tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ tty_t* default_tty_alloc(){
tty->fifo = kmalloc(sizeof(struct FIFO8));
char* buf = kmalloc(512);
fifo8_init(tty->fifo, 512, (unsigned char *)buf);

return tty;
}

Expand All @@ -56,5 +55,9 @@ void tty_init(void){
default_tty.putchar = tty_putchar;
strcpy(default_tty.name,"ost/default");

default_tty.fifo = kmalloc(sizeof(struct FIFO8));
char* buf = kmalloc(512);
fifo8_init(default_tty.fifo, 512, (unsigned char *)buf);

tty_status = TTY_VGA_OUTPUT;
}

0 comments on commit cd3be76

Please sign in to comment.