From b615a8d28602de53ab8d4248d92cc65622d020ed Mon Sep 17 00:00:00 2001 From: ngiddings Date: Sat, 17 Apr 2021 06:27:55 -0500 Subject: [PATCH] More process in initialize() Function now constructs kernel state and enters a process --- include/allocator.h | 2 +- src/x86/quark_x86.c | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/allocator.h b/include/allocator.h index a9c0699..ad6172e 100644 --- a/include/allocator.h +++ b/include/allocator.h @@ -6,4 +6,4 @@ void initialize_allocator(void *bottom, void *top); void *allocate_from_bottom(size_t size); -void *allocate_from_top(size_t size); \ No newline at end of file +void *allocate_from_top(size_t size); diff --git a/src/x86/quark_x86.c b/src/x86/quark_x86.c index af3293c..cd03450 100644 --- a/src/x86/quark_x86.c +++ b/src/x86/quark_x86.c @@ -2,6 +2,7 @@ #include "pageallocator.h" #include "allocator.h" #include "mmgr.h" +#include "priorityqueue.h" #include "multiboot2.h" #include "memorymap.h" #include "apic.h" @@ -66,11 +67,20 @@ int initialize(void *multiboot_info) apic_registers->initial_count.value = 1024*1024*1024; apic_registers->lvt_timer.mask = 0; + + static struct priority_queue_t priority_queue; + construct_priority_queue(&priority_queue, &page_stack); + static struct resource_table_t resource_table; + construct_resource_table(&resource_table, &page_stack); kernel_state.page_stack = &page_stack; + kernel_state.resource_table = &resource_table; + kernel_state.priority_queue = &priority_queue; + kernel_state.active_process = NULL; for(int i = 0; i < boot_info.module_count; i++) { load_module(&kernel_state, &boot_info.modules[i]); } + next_process(&kernel_state, NULL); asm("sti"); while(1)