From 3259715b0ed510ededeeb8240cc3bbdcdfc362a3 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sat, 17 Apr 2021 16:43:28 +0200 Subject: [PATCH] Improve task stack management --- src/bringelle.c | 13 +++++++------ src/core/scheduler.c | 11 +++++++++-- src/core/scheduler.h | 2 +- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/bringelle.c b/src/bringelle.c index 17d3845..22791f3 100644 --- a/src/bringelle.c +++ b/src/bringelle.c @@ -5,6 +5,8 @@ #include "core/paging.h" #include "core/scheduler.h" +#define TASK_WAIT 50000000 + extern void interrupt_enable(); void utask(){ @@ -13,7 +15,7 @@ void utask(){ msg[1]='\0'; while(1){ asm("mov $0x1, %%eax;int $0x30"::"b"(msg)); - for(int i=0;i<5000;i++){ + for(int i=0;ipage_dir=page_dir; nproc++; } + else + print("Could not create more task!"); } void scheduler_start(){ diff --git a/src/core/scheduler.h b/src/core/scheduler.h index 62d6561..3410ba1 100644 --- a/src/core/scheduler.h +++ b/src/core/scheduler.h @@ -47,7 +47,7 @@ void schedule(u32 *stack); /** * Create a new task to be schedule */ -void task_create(int *page_dir, void *task, int task_size, int stack_offset); +void task_create(void *task, int task_size); /** * Stack the scheduler starting by task with PID 0