More process in initialize()

Function now constructs kernel state and enters a process
This commit is contained in:
2021-04-17 06:27:55 -05:00
parent 461194fdfd
commit b615a8d286
2 changed files with 11 additions and 1 deletions

View File

@@ -6,4 +6,4 @@ void initialize_allocator(void *bottom, void *top);
void *allocate_from_bottom(size_t size); void *allocate_from_bottom(size_t size);
void *allocate_from_top(size_t size); void *allocate_from_top(size_t size);

View File

@@ -2,6 +2,7 @@
#include "pageallocator.h" #include "pageallocator.h"
#include "allocator.h" #include "allocator.h"
#include "mmgr.h" #include "mmgr.h"
#include "priorityqueue.h"
#include "multiboot2.h" #include "multiboot2.h"
#include "memorymap.h" #include "memorymap.h"
#include "apic.h" #include "apic.h"
@@ -66,11 +67,20 @@ int initialize(void *multiboot_info)
apic_registers->initial_count.value = 1024*1024*1024; apic_registers->initial_count.value = 1024*1024*1024;
apic_registers->lvt_timer.mask = 0; 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.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++) for(int i = 0; i < boot_info.module_count; i++)
{ {
load_module(&kernel_state, &boot_info.modules[i]); load_module(&kernel_state, &boot_info.modules[i]);
} }
next_process(&kernel_state, NULL);
asm("sti"); asm("sti");
while(1) while(1)