summaryrefslogtreecommitdiff
path: root/kernel/memory.c
diff options
context:
space:
mode:
authorAda Christine <adachristine18@gmail.com>2021-04-11 09:05:25 +0000
committerAda Christine <adachristine18@gmail.com>2021-04-11 09:05:25 +0000
commit19a91071908c49365290fb1a49a5da8e354989e2 (patch)
tree59667272fc339fec1095d9ce8ad383be13bd0b78 /kernel/memory.c
parent922e6ca1bc48cf62ad599ef1a2d63bf338a0e8c3 (diff)
added rule to compile .S files; page fault ISR and skeleton handler are present
Diffstat (limited to 'kernel/memory.c')
-rw-r--r--kernel/memory.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/kernel/memory.c b/kernel/memory.c
index d9bc8c3..f233b85 100644
--- a/kernel/memory.c
+++ b/kernel/memory.c
@@ -1,4 +1,5 @@
#include "memory.h"
+#include "kprint.h"
#include <kernel/memory/paging.h>
@@ -326,11 +327,10 @@ void kernel_unmap_page(void *vaddr)
phys_addr_t page_alloc(void)
{
- int index;
+ int index = first_free_page_index;
- if (first_free_page_index > 0)
+ if (index > 0)
{
- index = first_free_page_index;
page_array[index].used = 1;
first_free_page_index = page_array[index].next;
}
@@ -361,3 +361,11 @@ static uint64_t *get_kernel_pm2e(void *vaddr)
{
return &kernel_pm2[kpm2_index(vaddr)];
}
+
+int page_fault_handler(uint32_t code, void *address)
+{
+ (void)code;
+ (void)address;
+ kputs("page faulmt\n");
+ return 0;
+}