Mercurial > lcfOS
diff cos/kernel/kernel.h @ 25:d3c4bf3720a3
Beginning of multitasking
author | windel |
---|---|
date | Tue, 27 Dec 2011 13:31:38 +0100 |
parents | d8627924d40d |
children | dcce92b1efbc |
line wrap: on
line diff
--- a/cos/kernel/kernel.h Fri Dec 02 14:00:02 2011 +0100 +++ b/cos/kernel/kernel.h Tue Dec 27 13:31:38 2011 +0100 @@ -31,6 +31,11 @@ void* kmalloc(uint64_t size); void kfree(void* ptr); +// task related functions: +void initialize_tasking(); +void new_task(); +void task_scheduler(); + // STDout funcs: void printf(const char* fmt, ... ); void memset(void* ptr, uint32_t value, uint32_t num); @@ -56,6 +61,7 @@ // ASM helper: void loadIDT(void); +uint64_t read_rip(); // Panic exit: void halt(void); @@ -78,7 +84,6 @@ // Memory functions: void mappage(uint64_t address); -int querymode(void); void loadPageTable(void* tableAddress); // Variable argument list things: @@ -122,14 +127,17 @@ unsigned char screendata[80*25]; // All chars in the console! } console_t; -typedef struct { - uint32_t esp; - uint32_t ss; +typedef struct task_t { + struct task_t* next; uint32_t kstack; uint32_t ustack; - uint32_t cr3; - uint32_t number; + uint64_t cr3; + uint64_t rip; + uint64_t rsp; + uint64_t rbp; + + uint32_t pid; uint32_t parent; uint32_t owner; uint32_t groups; @@ -140,7 +148,7 @@ char naam[32]; console_t *console; -} programma_t; +} task_t; #endif