diff --git a/BaS_GNU/BaS_GNU/bas.lk.in b/BaS_GNU/BaS_GNU/bas.lk.in index 52e9abc..6fa0e29 100644 --- a/BaS_GNU/BaS_GNU/bas.lk.in +++ b/BaS_GNU/BaS_GNU/bas.lk.in @@ -14,6 +14,11 @@ SECTIONS { ___SDRAM = ABSOLUTE(0x00000000); ___SDRAM_SIZE = ABSOLUTE(0x20000000); + /* Flash components */ + __FIRETOS = ABSOLUTE(0xe0400000); + __EMUTOS = ABSOLUTE(0xe0600000); + __EMUTOS_SIZE = ABSOLUTE(0x00100000); + /* VIDEO RAM BASIS */ __VRAM = ABSOLUTE(0x60000000); diff --git a/BaS_GNU/BaS_GNU/sources/BaS.c b/BaS_GNU/BaS_GNU/sources/BaS.c index 6f08dea..7e3ad34 100644 --- a/BaS_GNU/BaS_GNU/sources/BaS.c +++ b/BaS_GNU/BaS_GNU/sources/BaS.c @@ -23,6 +23,12 @@ extern int sd_card_init(); extern void wait_10ms(); extern void wait_1ms(); +/* Symbols from the linker script */ +extern uint8_t _EMUTOS[]; +#define EMUTOS ((uint32_t)_EMUTOS) /* where EmuTOS is stored in flash */ +extern uint8_t _EMUTOS_SIZE[]; +#define EMUTOS_SIZE ((uint32_t)_EMUTOS_SIZE) /* size of EmuTOS, in bytes */ + /********************************************************************/ void BaS(void) { @@ -61,8 +67,8 @@ void BaS(void) } /* copy EMUTOS */ - src = (uint8_t *) 0xe0600000L; - while (src < (uint8_t *) 0xe0700000L) + src = (uint8_t *)EMUTOS; + while (src < (uint8_t *)(EMUTOS + EMUTOS_SIZE)) { *dst++ = *src++; } diff --git a/BaS_GNU/BaS_GNU/sources/sysinit.c b/BaS_GNU/BaS_GNU/sources/sysinit.c index c917fc0..a4847e7 100644 --- a/BaS_GNU/BaS_GNU/sources/sysinit.c +++ b/BaS_GNU/BaS_GNU/sources/sysinit.c @@ -667,6 +667,9 @@ livo: /* Symbols from the linker script */ +extern uint8_t _FIRETOS[]; +#define FIRETOS ((uint32_t)_FIRETOS) /* where FireTOS is stored in flash */ + extern uint8_t _BAS_LMA[]; #define BAS_LMA ((uint32_t)_BAS_LMA) /* where the BaS is stored in flash */ @@ -700,7 +703,7 @@ void initialize_hardware(void) { /* Jump into FireTOS */ typedef void void_func(void); - void_func* FireTOS = (void_func*)0xe0400000; + void_func* FireTOS = (void_func*)FIRETOS; FireTOS(); // Should never return return; }