Skip to content

Commit

Permalink
变得更像真正的操作系统(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 13, 2016
1 parent 95542da commit 5bc0ade
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions 25_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 */
Expand All @@ -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);
Expand Down
3 changes: 1 addition & 2 deletions 25_day/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 5bc0ade

Please sign in to comment.