From d1e4c441491157f1f4d1eb894b31e7d1f7526425 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Fri, 13 May 2016 11:21:01 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=EF=BC=883=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 25_day/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/25_day/console.c b/25_day/console.c index dc323db..1b58cd6 100644 --- a/25_day/console.c +++ b/25_day/console.c @@ -294,12 +294,12 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline) dathrb = *((int *) (p + 0x0014)); q = (char *) memman_alloc_4k(memman, segsiz); task->ds_base = (int) q; - set_segmdesc(gdt + 1003, finfo->size - 1, (int) p, AR_CODE32_ER + 0x60); - set_segmdesc(gdt + 1004, segsiz - 1, (int) q, AR_DATA32_RW + 0x60); + set_segmdesc(gdt + task->sel / 8 + 1000, finfo->size - 1, (int) p, AR_CODE32_ER + 0x60); + set_segmdesc(gdt + task->sel / 8 + 2000, segsiz - 1, (int) q, AR_DATA32_RW + 0x60); for (i = 0; i < datsiz; i++) { q[esp + i] = p[dathrb + i]; } - start_app(0x1b, 1003 * 8, esp, 1004 * 8, &(task->tss.esp0)); + start_app(0x1b, task->sel + 1000 * 8, esp, task->sel + 2000 * 8, &(task->tss.esp0)); shtctl = (struct SHTCTL *) *((int *) 0x0fe4); for (i = 0; i < MAX_SHEETS; i++) { sht = &(shtctl->sheets0[i]);