add printing pagetable location

This commit is contained in:
Quinten Kock 2020-12-05 03:33:49 +01:00
parent 95ac2d439a
commit e5cf785097
1 changed files with 13 additions and 2 deletions

View File

@ -2,8 +2,10 @@
#include <stdint.h>
#include <stddef.h>
#include "../../main.h"
#include "arch/x86/stivale2-parse.h"
#include <arch/x86/stivale2-parse.h>
#include <print/print.h>
#include <main.h>
static uint8_t stack[4096] = {0};
void stivale2_main(struct stivale2_struct *info);
@ -28,6 +30,15 @@ void stivale2_main(struct stivale2_struct *info) {
parse_stivale2(info);
print_stivale2_memmap(info);
uint64_t* cr3;
__asm__ __volatile__ (
"movq %%cr3, %0\n\t"
: "=r" (cr3)
: /* no input */
: /* no clobbers */
);
printf("PAGE TABLE AT: %x\n", cr3);
char *argv[3] = {"stivale2", info->bootloader_brand, info->bootloader_version};
kmain(3, argv);
}