Implement MMU-based user memory validation

This commit is contained in:
EDiasAlberto
2024-11-29 23:03:31 +00:00
2 changed files with 89 additions and 80 deletions

View File

@@ -146,6 +146,14 @@ page_fault (struct intr_frame *f)
write = (f->error_code & PF_W) != 0;
user = (f->error_code & PF_U) != 0;
/* Kernel page fault is further handled by the kernel itself. */
if (kernel)
{
f->eip = (void *)f->eax;
f->eax = 0xffffffff;
return;
}
if (user)
{
if (try_alloc_new_page (fault_addr, f->esp))