[Bootloader]

- use full featured exception handler
- cleaned up Linker script
- added exception and interrupt processing


git-svn-id: http://moon:8086/svn/mips@26 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2015-05-27 18:56:09 +00:00
parent 9c1ca0aaf3
commit ca387a1ef4
5 changed files with 204 additions and 52 deletions
+8 -5
View File
@@ -3,6 +3,7 @@ void main()
{
uint32_t i;
volatile uint32_t *pUART0_stat = (uint32_t*)SYS_UART_STAT;
volatile uint32_t *pGPIO = (uint32_t*)SYS_GPIO_0_DATA;
volatile uint32_t *pGPIODIR = (uint32_t*)SYS_GPIO_0_DIR;
volatile uint32_t *pRAM = (uint32_t*)SDRAM_BASE;
@@ -10,21 +11,23 @@ void main()
*pGPIODIR = GPIO_0_DFLT_DIR;
uint8_t led = 0;
// UART: enable RX interrupt
*pUART0_stat |= (1 << 6);
interrupt_enable(3);
sputs("Hello, world!\n");
while(1)
{
sputs("Iteration # ");print_word(led);sputs("\n");
sputs("Uart status : ");print_word(*pUART0_stat);sputs("\n");
sputs("CPU status : ");print_word(CP0_SR_read());sputs("\n");
*pGPIO = led;
if(led == 0)
{
memdump((uint8_t*)pRAM, 0, 16, 256);
}
*pGPIO = led;
for (i=0; i < 1024*1024; i++)
{
pRAM[i] = i;
}
led = (led+1) % 64;
}
*pGPIO = 1;