From e8c6577617bffa4402c07c7aa20e3c24f03c1c20 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Sun, 6 Sep 2020 00:48:07 -0400 Subject: program loading, others big kernel additions: paging, elf loading, separate kernel and user page allocation it now properly loads and runs sd0:bin/init.elf still need to determine which disk was booted from, and start the init on that disk --- src/kernel/task.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'src/kernel/task.h') 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 #include -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 -- cgit v1.2.3