Tasks now are a doubly-linked list

This commit is contained in:
pjht 2019-08-25 17:06:19 -05:00
parent c18c7cff2f
commit 5a5fee4d74
3 changed files with 6 additions and 2 deletions

View File

@ -2,8 +2,8 @@ set pagination off
target remote localhost:1234 target remote localhost:1234
symbol-file kernel/kernel.elf symbol-file kernel/kernel.elf
add-symbol-file vfs/vfs add-symbol-file vfs/vfs
b kernel/cpu/i386/tasking.c:129 b kernel/cpu/i386/tasking.c:132
b kernel/cpu/i386/tasking.c:140 b kernel/cpu/i386/tasking.c:143
commands 1 2 commands 1 2
silent silent
disable breakpoints disable breakpoints

View File

@ -97,7 +97,10 @@ Task* tasking_createTaskCr3KmodeParam(void* eip,void* cr3,char kmode,char param1
} }
if (tailTask) { if (tailTask) {
tailTask->next=task; tailTask->next=task;
task->prev=tailTask;
tailTask=task; tailTask=task;
} else {
task->prev=NULL;
} }
if (task->pid!=0) { if (task->pid!=0) {
serial_printf("Created task with PID %d.\n",task->pid); serial_printf("Created task with PID %d.\n",task->pid);

View File

@ -12,6 +12,7 @@ typedef struct Task {
char priv; char priv;
int errno; int errno;
uint32_t pid; uint32_t pid;
struct Task* prev;
struct Task* next; struct Task* next;
} Task; } Task;