fix: simple multitasking work !!!!

add a stack at every task, and execute task while multitasking switching
This commit is contained in:
2025-01-24 12:33:29 +01:00
parent dc84d5856b
commit 95fec015f2
5 changed files with 40 additions and 24 deletions

View File

@ -1,6 +1,7 @@
#pragma once
#include "list.h"
#include "memory.h"
#include <stdint.h>
@ -9,6 +10,8 @@ extern struct task *current_task;
enum status { ZOMBIE, THREAD, RUN };
enum owner { OWNER_KERNEL, OWNER_USER };
#define STACK_SIZE PAGE_SIZE * 4
struct task {
uint32_t *esp;
uint32_t *esp0;