aboutsummaryrefslogtreecommitdiff
path: root/kernel/l0/kmain.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2014-12-02 18:10:14 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2014-12-02 18:10:14 +0100
commit456fc99e8feac598f7c6f1a3aaa82bf994404e39 (patch)
treec2aaf5b8225f7873f8189c5606bfe9041a7fa582 /kernel/l0/kmain.c
parent76795abc2f08f180b7a895aaf26e80b971caa81c (diff)
downloadkogata-456fc99e8feac598f7c6f1a3aaa82bf994404e39.tar.gz
kogata-456fc99e8feac598f7c6f1a3aaa82bf994404e39.zip
Begin implementation of paging
Diffstat (limited to 'kernel/l0/kmain.c')
-rw-r--r--kernel/l0/kmain.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/l0/kmain.c b/kernel/l0/kmain.c
index b4e2ef1..f6cda4e 100644
--- a/kernel/l0/kmain.c
+++ b/kernel/l0/kmain.c
@@ -6,6 +6,7 @@
#include <gdt.h>
#include <idt.h>
#include <frame.h>
+#include <paging.h>
void breakpoint_handler(registers_t *regs) {
dbg_printf("Breakpoint! (int3)\n");
@@ -34,10 +35,14 @@ void kmain(struct multiboot_info_t *mbd, int32_t mb_magic) {
// a pointer to this pointer is passed to the functions that might have
// to allocate memory ; they just increment it of the allocated quantity
void* kernel_data_end = (void*)K_END_ADDR;
+
frame_init_allocator(total_ram, &kernel_data_end);
dbg_printf("kernel_data_end: 0x%p\n", kernel_data_end);
dbg_print_frame_stats();
+ paging_setup(kernel_data_end);
+ dbg_printf("Paging seems to be working!\n");
+
// TODO:
// - setup allocator for physical pages (eg: buddy allocator, see OSDev wiki)
// - setup allocator for virtual memory space