toaruos/modules/crash.c

23 lines
433 B
C
Raw Normal View History

#include <module.h>
2014-04-13 00:51:50 -07:00
#include <printf.h>
#include <mod/shell.h>
DEFINE_SHELL_FUNCTION(crash, "Dereference NULL.") {
2014-04-13 00:51:50 -07:00
fprintf(tty, "*0x0 = %x\n", *((int *)0x00));
*((int *)0x0) = 0x42;
fprintf(tty, "*0x0 = %x\n", *((int *)0x00));
return 0;
}
static int crash_init(void) {
BIND_SHELL_FUNCTION(crash);
2014-03-18 22:57:07 -07:00
return 0;
}
static int crash_fini(void) {
2014-03-18 22:57:07 -07:00
return 0;
}
MODULE_DEF(crash, crash_init, crash_fini);
2014-03-18 20:11:56 -07:00
MODULE_DEPENDS(debugshell);