Started separating important structs from kernel.c

This commit is contained in:
2023-11-08 14:13:03 -06:00
parent 108e04a8f0
commit c5ef8c53a7
6 changed files with 160 additions and 0 deletions

22
src/addressspace.c Normal file
View File

@@ -0,0 +1,22 @@
#include "addressspace.h"
#include "heap.h"
#include "mmgr.h"
addressspace_t *addressspace_construct()
{
addressspace_t *as = kmalloc(sizeof(addressspace_t));
if(as == NULL)
{
return NULL;
}
as->page_table = create_address_space();
if(as->page_table == ENOMEM)
{
kfree(as);
return NULL;
}
as->refcount = 0;
return as;
}