diff --git a/25_day/bootpack.c b/25_day/bootpack.c index 95e569d..8a2a773 100644 --- a/25_day/bootpack.c +++ b/25_day/bootpack.c @@ -14,7 +14,7 @@ void HariMain(void) struct SHTCTL *shtctl; char s[40]; struct FIFO32 fifo, keycmd; - int fifobuf[128], keycmd_buf[32]; + int fifobuf[128], keycmd_buf[32], *cons_fifo[2]; int mx, my, i; unsigned int memtotal; struct MOUSE_DEC mdec; @@ -97,6 +97,8 @@ void HariMain(void) task_run(task_cons[i], 2, 2); /* level=2, priority=2 */ sht_cons[i]->task = task_cons[i]; sht_cons[i]->flags |= 0x20; /*有光标*/ + cons_fifo[i] = (int *) memman_alloc_4k(memman, 128 * 4); + fifo32_init(&task_cons[i]->fifo, 128, cons_fifo[i], task_cons[i]); } /* sht_mouse */ @@ -116,7 +118,6 @@ void HariMain(void) sheet_updown(sht_cons[0], 2); sheet_updown(sht_mouse, 3); key_win = sht_cons[0]; - keywin_on(key_win); /*为了避免和键盘当前状态冲突,在一开始先进行设置*/ fifo32_put(&keycmd, KEYCMD_LED); diff --git a/25_day/console.c b/25_day/console.c index 1b58cd6..2cfb82a 100644 --- a/25_day/console.c +++ b/25_day/console.c @@ -9,7 +9,7 @@ void console_task(struct SHEET *sheet, unsigned int memtotal) struct TIMER *timer; struct TASK *task = task_now(); struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR; - int i, fifobuf[128], *fat = (int *) memman_alloc_4k(memman, 4 * 2880); + int i, *fat = (int *) memman_alloc_4k(memman, 4 * 2880); struct CONSOLE cons; char cmdline[30]; cons.sht = sheet; @@ -18,7 +18,6 @@ void console_task(struct SHEET *sheet, unsigned int memtotal) cons.cur_c = -1; task->cons = &cons; - fifo32_init(&task->fifo, 128, fifobuf, task); timer = timer_alloc(); timer_init(timer, &task->fifo, 1); timer_settime(timer, 50);