diff options
Diffstat (limited to 'src/kernel/task.h')
-rw-r--r-- | src/kernel/task.h | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/src/kernel/task.h b/src/kernel/task.h index c3f2acd..838f27b 100644 --- a/src/kernel/task.h +++ b/src/kernel/task.h @@ -4,11 +4,27 @@ #include <stdbool.h> #include <stdint.h> -typedef uint8_t segment_id; -typedef uint8_t task_handle; +struct task_state { + uint32_t ret_addr; + void *page_directory; + //maybe put scheduling or priviledge information here? -segment_id new_segment(bool is_code, uint32_t length, uint32_t *location_out); -segment_id mirror_segment(bool is_code, segment_id other); -task_handle new_task(segment_id cs, segment_id ds, uint32_t eip, uint32_t esp); + uint32_t ebx; + uint32_t ecx; + uint32_t edx; + uint32_t esi; + uint32_t edi; + uint32_t ebp; + uint32_t esp; +} __attribute__ ((packed)); + +extern struct task_state *active_task; + +void init_tasks(); + +void new_task(struct task_state state); +void advance_active_task(); + +void delete_task(struct task_state *state); #endif
\ No newline at end of file |