jos/user/faultevilhandler.c

12 lines
248 B
C
Raw Normal View History

2018-10-06 06:52:47 -07:00
// 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;
}