Compare commits

..

No commits in common. "a9ed5947a81d2e1396d3e7210e2b77bea66706b6" and "7b7cc86999c18de84cf30e276aa52b9f566163a3" have entirely different histories.

2 changed files with 4 additions and 9 deletions

View File

@ -4,11 +4,9 @@
#include "kprintf.h"
#include "memory.h"
#include "power.h"
#include "string.h"
#include "terminal.h"
extern u32 page_table1[1024];
extern const char *faults[];
__attribute__((noreturn)) void kpanic(const char *format, ...)
{
@ -19,12 +17,9 @@ __attribute__((noreturn)) void kpanic(const char *format, ...)
va_start(va, format);
kvprintf(format, &va);
va_end(va);
if (strcmp(format, faults[14]) == 0) {
u32 faulting_address;
__asm__ __volatile__("mov %%cr2, %0" : "=r"(faulting_address));
kprintf("fault at address: %p\n", faulting_address);
}
u32 faulting_address;
__asm__ __volatile__("mov %%cr2, %0" : "=r"(faulting_address));
kprintf("fault at address: %p\n", faulting_address);
/* for (int i = 16; i < 32; i++) */
/* kprintf("%p\n", page_table1[i]); */
/* show_valloc_mem(); */

View File

@ -8,5 +8,5 @@ uintptr_t __stack_chk_guard = STACK_CHK_GUARD;
__attribute__((noreturn)) void __stack_chk_fail(void)
{
kpanic("Stack smashing detected\n");
kpanic("Stack smashing detected");
}