Skip to content

Commit

Permalink
增加命令行窗口(4)
Browse files Browse the repository at this point in the history
  • Loading branch information
yourtion committed May 13, 2016
1 parent d1e4c44 commit 24945dd
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions 25_day/bootpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void HariMain(void)
struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR;
unsigned char *buf_back, buf_mouse[256], *buf_win, *buf_cons[2];
struct SHEET *sht_back, *sht_mouse, *sht_win, *sht_cons[2];
struct TASK *task_a, *task_cons[2];
struct TASK *task_a, *task_cons[2], *task;
struct TIMER *timer;
static char keytable0[0x80] = {
0, 0, '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '^', 0, 0,
Expand Down Expand Up @@ -232,13 +232,15 @@ void HariMain(void)
fifo32_put(&keycmd, KEYCMD_LED);
fifo32_put(&keycmd, key_leds);
}
if (i == 256 + 0x3b && key_shift != 0 && task_cons[0]->tss.ss0 != 0) { /* Shift+F1 */
cons = (struct CONSOLE *) *((int *) 0x0fec);
cons_putstr0(cons, "\nBreak(key) :\n");
io_cli(); /*强制结束处理时禁止任务切换*/
task_cons[0]->tss.eax = (int) &(task_cons[0]->tss.esp0);
task_cons[0]->tss.eip = (int) asm_end_app;
io_sti();
if (i == 256 + 0x3b && key_shift != 0) {
task = key_win->task;
if (task != 0 && task->tss.ss0 != 0) { /* Shift+F1 */
cons_putstr0(cons, "\nBreak(key) :\n");
io_cli(); /*强制结束处理时禁止任务切换*/
task->tss.eax = (int) &(task->tss.esp0);
task->tss.eip = (int) asm_end_app;
io_sti();
}
}
if (i == 256 + 0x57 && shtctl->top > 2) { /* F11 */
sheet_updown(shtctl->sheets[1], shtctl->top - 1);
Expand Down Expand Up @@ -298,11 +300,11 @@ void HariMain(void)
if (sht->bxsize - 21 <= x && x < sht->bxsize - 5 && 5 <=y && y < 19) {
/*点击“×”按钮*/
if ((sht->flags & 0x10) != 0) { /*该窗口是否为应用程序窗口?*/
cons = (struct CONSOLE *) *((int *) 0x0fec);
task = sht->task;
cons_putstr0(cons, "\nBreak(mouse) :\n");
io_cli(); /*强制结束处理中禁止切换任务*/
task_cons[0]->tss.eax = (int) &(task_cons[0]->tss.esp0);
task_cons[0]->tss.eip = (int) asm_end_app;
io_cli(); /*强制结束处理时禁止任务切换*/
task->tss.eax = (int) &(task->tss.esp0);/*到此结束*/
task->tss.eip = (int) asm_end_app;
io_sti();
}
}
Expand Down

0 comments on commit 24945dd

Please sign in to comment.