URL
https://opencores.org/ocsvn/s6soc/s6soc/trunk
[/] [s6soc/] [trunk/] [sw/] [zipos/] [bootloader.c] - Diff between revs 27 and 45
Show entire file |
Details |
Blame |
View Log
Rev 27 |
Rev 45 |
Line 36... |
Line 36... |
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
//
|
//
|
#include "board.h"
|
#include "board.h"
|
|
#include "bootloader.h"
|
|
|
// These values will be filled in by the linker. They are unknown at compile
|
// These values will be filled in by the linker. They are unknown at compile
|
// time.
|
// time.
|
extern int load_image_start, load_image_end, bss_image_end;
|
|
|
|
void bootloader(void) {
|
void _bootloader(void) __attribute__ ((section(".boot")));
|
int len = ((int)&load_image_end) - RAMADDR;
|
|
int *flash = &load_image_start;
|
void _bootloader(void) {
|
int *mem = (int *)RAMADDR;
|
int *flash = _kernel_image_start;
|
|
int *mem = _blkram;
|
|
|
|
while(mem < _kernel_image_end)
|
|
*mem++ = *flash++;
|
|
|
for(int i=0; i<len; i++)
|
|
mem[i] = flash[i];
|
|
// While I'd love to continue and clear to the end of memory, doing
|
// While I'd love to continue and clear to the end of memory, doing
|
// so will corrupt my stack and perhaps even my return address. Hence
|
// so will corrupt my stack and perhaps even my return address. Hence
|
// we only do this much.
|
// we only do this much.
|
for(int i=len; i< ((int)&bss_image_end)-RAMADDR; i++)
|
while(mem < _bss_image_end)
|
mem[i] = 0;
|
*mem++ = 0;
|
}
|
}
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.