* more re-work
[mascara-docs.git] / i386 / junos / standford / 2004 / src / lab5 / user / faultbadhandler.c
blobb5547e0e38a25ce9f40effbd715b9bb8aee60a8f
1 // test bad pointer for user-level fault handler
2 // this is going to fault in the fault handler accessing eip (always!)
3 // so eventually the kernel kills it (PFM_KILL) because
4 // we outrun the stack with invocations of the user-level handler
6 #include <inc/lib.h>
8 void
9 umain(void)
11 sys_mem_alloc(0, UXSTACKTOP-BY2PG, PTE_P|PTE_U|PTE_W);
12 sys_set_pgfault_entry(0, 0xDeadBeef);
13 *(int*)0 = 0;