From 7eb65e35ce4a51c132debc91999877db8c6ad0fc Mon Sep 17 00:00:00 2001 From: ikari Date: Mon, 27 Feb 2012 12:43:50 +0100 Subject: [PATCH] bootldr: properly chain from vector table entry --- src/bootldr/config.h | 2 +- src/bootldr/main.c | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/bootldr/config.h b/src/bootldr/config.h index a9d89e5..ba6b9df 100644 --- a/src/bootldr/config.h +++ b/src/bootldr/config.h @@ -1,7 +1,7 @@ #ifndef _CONFIG_H #define _CONFIG_H -//#define DEBUG_BL +// #define DEBUG_BL // #define DEBUG_SD // #define DEBUG_IRQ diff --git a/src/bootldr/main.c b/src/bootldr/main.c index e19b8d6..f483ba0 100644 --- a/src/bootldr/main.c +++ b/src/bootldr/main.c @@ -23,7 +23,7 @@ int i; volatile enum diskstates disk_state; extern volatile tick_t ticks; -int (*chain)(void) = (void*)(FW_START+0x000001c5); +int (*chain)(void); int main(void) { SNES_CIC_PAIR_REG->FIODIR = BV(SNES_CIC_PAIR_BIT); @@ -86,6 +86,16 @@ DBG_BL printf("PCONP=%lx\n", LPC_SC->PCONP); NVIC_DisableIRQ(UART_IRQ); SCB->VTOR=FW_START+0x00000100; + chain = (void*)(*((uint32_t*)(FW_START+0x00000104))); + uart_putc("0123456789abcdef"[((uint32_t)chain>>28)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain>>24)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain>>20)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain>>16)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain>>12)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain>>8)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain>>4)&15]); + uart_putc("0123456789abcdef"[((uint32_t)chain)&15]); + uart_putc('\n'); chain(); while(1); }