diff --git a/.gdbinit b/.gdbinit index 8a8d45d..62ff712 100644 --- a/.gdbinit +++ b/.gdbinit @@ -2,8 +2,8 @@ set pagination off target remote localhost:1234 symbol-file kernel/kernel.elf add-symbol-file vfs/vfs -b kernel/cpu/i386/tasking.c:129 -b kernel/cpu/i386/tasking.c:140 +b kernel/cpu/i386/tasking.c:132 +b kernel/cpu/i386/tasking.c:143 commands 1 2 silent disable breakpoints diff --git a/kernel/cpu/i386/tasking.c b/kernel/cpu/i386/tasking.c index f2df364..34a8c52 100644 --- a/kernel/cpu/i386/tasking.c +++ b/kernel/cpu/i386/tasking.c @@ -97,7 +97,10 @@ Task* tasking_createTaskCr3KmodeParam(void* eip,void* cr3,char kmode,char param1 } if (tailTask) { tailTask->next=task; + task->prev=tailTask; tailTask=task; + } else { + task->prev=NULL; } if (task->pid!=0) { serial_printf("Created task with PID %d.\n",task->pid); diff --git a/kernel/cpu/i386/tasking.h b/kernel/cpu/i386/tasking.h index 17b7385..02e192c 100644 --- a/kernel/cpu/i386/tasking.h +++ b/kernel/cpu/i386/tasking.h @@ -12,6 +12,7 @@ typedef struct Task { char priv; int errno; uint32_t pid; + struct Task* prev; struct Task* next; } Task;