mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-02-02 17:49:01 +08:00
增加命令行窗口(2)
This commit is contained in:
@@ -212,6 +212,8 @@ struct TASK {
|
||||
int level, priority; /* 优先级 */
|
||||
struct FIFO32 fifo;
|
||||
struct TSS32 tss;
|
||||
struct CONSOLE *cons;
|
||||
int ds_base;
|
||||
};
|
||||
struct TASKLEVEL {
|
||||
int running; /*正在运行的任务数量*/
|
||||
|
||||
@@ -16,7 +16,7 @@ void console_task(struct SHEET *sheet, unsigned int memtotal)
|
||||
cons.cur_x = 8;
|
||||
cons.cur_y = 28;
|
||||
cons.cur_c = -1;
|
||||
*((int *) 0x0fec) = (int) &cons;
|
||||
task->cons = &cons;
|
||||
|
||||
fifo32_init(&task->fifo, 128, fifobuf, task);
|
||||
timer = timer_alloc();
|
||||
@@ -293,7 +293,7 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
|
||||
datsiz = *((int *) (p + 0x0010));
|
||||
dathrb = *((int *) (p + 0x0014));
|
||||
q = (char *) memman_alloc_4k(memman, segsiz);
|
||||
*((int *) 0xfe8) = (int) q;
|
||||
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);
|
||||
for (i = 0; i < datsiz; i++) {
|
||||
@@ -323,9 +323,9 @@ int cmd_app(struct CONSOLE *cons, int *fat, char *cmdline)
|
||||
|
||||
int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int eax)
|
||||
{
|
||||
int ds_base = *((int *) 0xfe8);
|
||||
struct TASK *task = task_now();
|
||||
struct CONSOLE *cons = (struct CONSOLE *) *((int *) 0x0fec);
|
||||
int ds_base = task->ds_base;
|
||||
struct CONSOLE *cons = task->cons;
|
||||
struct SHTCTL *shtctl = (struct SHTCTL *) *((int *) 0x0fe4);
|
||||
struct SHEET *sht;
|
||||
int *reg = &eax + 1; /* eax后面的地址*/
|
||||
@@ -435,8 +435,8 @@ int *hrb_api(int edi, int esi, int ebp, int esp, int ebx, int edx, int ecx, int
|
||||
|
||||
int *inthandler0c(int *esp)
|
||||
{
|
||||
struct CONSOLE *cons = (struct CONSOLE *) *((int *) 0x0fec);
|
||||
struct TASK *task = task_now();
|
||||
struct CONSOLE *cons = task->cons;
|
||||
char s[30];
|
||||
cons_putstr0(cons, "\nINT 0C :\n Stack Exception.\n");
|
||||
sprintf(s, "EIP = %08X\n", esp[11]);
|
||||
@@ -446,8 +446,8 @@ int *inthandler0c(int *esp)
|
||||
|
||||
int *inthandler0d(int *esp)
|
||||
{
|
||||
struct CONSOLE *cons = (struct CONSOLE *) *((int *) 0x0fec);
|
||||
struct TASK *task = task_now();
|
||||
struct CONSOLE *cons = task->cons;
|
||||
char s[30];
|
||||
cons_putstr0(cons, "\nINT 0D :\n General Protected Exception.\n");
|
||||
sprintf(s, "EIP = %08X\n", esp[11]);
|
||||
|
||||
Reference in New Issue
Block a user