#include <stdio.h> #include <io.h> #include <dev/board.h> #include <sys/timer.h> #include <sys/version.h> int main(void) { u_long baud = 115200; int *bad; /* * Register and initialize the DEBUG device as stdout. */ NutRegisterDevice(&DEV_DEBUG, 0, 0); freopen(DEV_DEBUG_NAME, "w", stdout); _ioctl(_fileno(stdout), UART_SETSPEED, &baud); /* * Print a banner, so we can show that we are running. */ printf("/n/nData Abort Sample - Nut/OS %s/n", NutVersionString()); /* * Set a pointer to a bad memory address. */ bad = (u_long *)0x09000000; /* * This will crash. */ *bad = 0x12345678; /* * We will never reach this point. */ puts("Brave new world!"); return 0; }