aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/paging
diff options
context:
space:
mode:
authorMarvin Borner2019-10-13 20:11:32 +0200
committerMarvin Borner2019-10-13 20:11:32 +0200
commit8754542ce074bef0984f91ce1b1cd8aff9b3d5e9 (patch)
tree66c6df9f2a2e9e4482ddfbce10490f706f78da33 /src/kernel/paging
parent58804851fc49f6db1c87f791d39779766108efb0 (diff)
Fixed all compiler warnings
Diffstat (limited to 'src/kernel/paging')
-rw-r--r--src/kernel/paging/kheap.c4
-rw-r--r--src/kernel/paging/ordered_array.c2
-rw-r--r--src/kernel/paging/paging.c12
3 files changed, 9 insertions, 9 deletions
diff --git a/src/kernel/paging/kheap.c b/src/kernel/paging/kheap.c
index e4f3d20..9af33f7 100644
--- a/src/kernel/paging/kheap.c
+++ b/src/kernel/paging/kheap.c
@@ -160,7 +160,7 @@ void *alloc(uint32_t size, unsigned char page_align, heap_t *heap) {
uint32_t idx = -1;
uint32_t value = 0x0;
- while (iterator < heap->index.size) {
+ while (iterator < (int) heap->index.size) {
uint32_t tmp = (uint32_t) lookup_ordered_array(iterator, &heap->index);
if (tmp > value) {
value = tmp;
@@ -169,7 +169,7 @@ void *alloc(uint32_t size, unsigned char page_align, heap_t *heap) {
iterator++;
}
- if (idx == -1) {
+ if ((int) idx == -1) {
header_t *header = (header_t *) old_end_address;
header->magic = HEAP_MAGIC;
header->size = new_length - old_length;
diff --git a/src/kernel/paging/ordered_array.c b/src/kernel/paging/ordered_array.c
index 563a936..688ff8f 100644
--- a/src/kernel/paging/ordered_array.c
+++ b/src/kernel/paging/ordered_array.c
@@ -33,7 +33,7 @@ void destroy_ordered_array(ordered_array_t *array) {
}
void insert_ordered_array(type_t item, ordered_array_t *array) {
- assert(array->less_than);
+ assert((int) array->less_than);
uint32_t iterator = 0;
while (iterator < array->size && array->less_than(array->array[iterator], item))
iterator++;
diff --git a/src/kernel/paging/paging.c b/src/kernel/paging/paging.c
index 8f95bab..4bb69d0 100644
--- a/src/kernel/paging/paging.c
+++ b/src/kernel/paging/paging.c
@@ -1,7 +1,7 @@
#include "paging.h"
#include "kheap.h"
+#include "../system.h"
#include "../lib/lib.h"
-#include "../graphics/graphics.h"
#include "../io/io.h"
page_directory_t *kernel_directory = 0;
@@ -29,12 +29,12 @@ static void clear_frame(uint32_t frame_addr) {
frames[idx] &= ~(0x1 << off);
}
-static uint32_t test_frame(uint32_t frame_addr) {
+/*static uint32_t test_frame(uint32_t frame_addr) {
uint32_t frame = frame_addr / 0x1000;
uint32_t idx = INDEX_FROM_BIT(frame);
uint32_t off = OFFSET_FROM_BIT(frame);
return (frames[idx] & (0x1 << off));
-}
+}*/
static uint32_t first_frame() {
uint32_t i, j;
@@ -48,6 +48,7 @@ static uint32_t first_frame() {
}
}
}
+ return -1;
}
void alloc_frame(page_t *page, int is_kernel, int is_writeable) {
@@ -80,12 +81,11 @@ void initialise_paging() {
frames = (uint32_t *) kmalloc(INDEX_FROM_BIT(nframes));
memory_set(frames, 0, INDEX_FROM_BIT(nframes));
- uint32_t phys;
kernel_directory = (page_directory_t *) kmalloc_a(sizeof(page_directory_t));
memory_set(kernel_directory, 0, sizeof(page_directory_t));
kernel_directory->physicalAddr = (uint32_t) kernel_directory->tablesPhysical;
- int i = 0;
+ unsigned int i = 0;
for (i = KHEAP_START; i < KHEAP_START + KHEAP_INITIAL_SIZE; i += 0x1000)
get_page(i, 1, kernel_directory);
@@ -139,7 +139,7 @@ void page_fault(struct regs *r) {
int rw = r->err_code & 0x2;
int us = r->err_code & 0x4;
int reserved = r->err_code & 0x8;
- int id = r->err_code & 0x10;
+ // int id = r->err_code & 0x10;
serial_write("Page fault! ( ");
if (present) serial_write("present ");