mirror of
https://github.com/SmallPond/MIT6.828_OS.git
synced 2026-04-29 13:21:17 +08:00
LAB 4 IS DONE.
This commit is contained in:
11
lab/user/faultevilhandler.c
Normal file
11
lab/user/faultevilhandler.c
Normal file
@@ -0,0 +1,11 @@
|
||||
// test evil pointer for user-level fault handler
|
||||
|
||||
#include <inc/lib.h>
|
||||
|
||||
void
|
||||
umain(int argc, char **argv)
|
||||
{
|
||||
sys_page_alloc(0, (void*) (UXSTACKTOP - PGSIZE), PTE_P|PTE_U|PTE_W);
|
||||
sys_env_set_pgfault_upcall(0, (void*) 0xF0100020);
|
||||
*(int*)0 = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user