Initial checkin. Basic build and runtime environment, prior to first

test on actual hardware.
This commit is contained in:
2011-05-04 00:03:28 +00:00
commit f5159013b3
4 changed files with 290 additions and 0 deletions

18
main.c Normal file
View File

@@ -0,0 +1,18 @@
#define U0THR (*((volatile unsigned char *) 0xE000C000)) /* UART0 transmitter holding register */
#define U0LSR (*((volatile unsigned char *) 0xE000C014)) /* UART0 line status register */
#define U0THRE ((U0LSR & (1<<5))) /* UART0 transmitter holding register is empty */
void putch(char c) {
while (!U0THRE);
U0THR = c;
}
void putstr(char *s) {
while (*s) putch(*s++);
}
int main(void) {
putstr("Your entire life has been a mathematical error... a mathematical error I'm about to correct!\n");
return 0;
}