[MULTITASKING] Preemptive multitasking

This commit is contained in:
2016-11-18 10:36:21 +01:00
parent d3d065b2e2
commit 664379b35c
7 changed files with 26 additions and 8 deletions

View File

@@ -14,3 +14,6 @@ uint64_t read_cr4();
#define CR4_OSFXSR (1<<9)
#define CR4_OSXMMEXCPT (1<<10)
#define RFLAGS_IF (1<<9)

View File

@@ -3,11 +3,13 @@ typedef struct thread_st thread_t;
#include <stdint.h>
#include <list.h>
#include <process.h>
#include <int.h>
#define THREAD_STACK_SIZE 0x1000-sizeof(thread_t)
typedef struct thread_st
{
registers_t r;
uint64_t stack_pointer; // Top of the kernel stack for thread
uint64_t tid;
uint64_t state;
@@ -32,6 +34,7 @@ typedef struct thread_stack_st
uint64_t R13;
uint64_t R14;
uint64_t R15;
uint64_t thread;
uint64_t zero_frame;
uint64_t function_address;
thread_t tcb;