Add ARM basic bootloader build
This commit is contained in:
30
arm/vector_table.cc
Normal file
30
arm/vector_table.cc
Normal file
@@ -0,0 +1,30 @@
|
||||
#include <cstdint>
|
||||
|
||||
extern "C" uint32_t _bss_begin, _bss_end;
|
||||
extern "C" int main();
|
||||
|
||||
namespace {
|
||||
|
||||
enum VectorTableEntry {
|
||||
StackPointer = 0,
|
||||
Reset = 1,
|
||||
};
|
||||
|
||||
void ResetHandler() {
|
||||
// clear .bss
|
||||
for (uint32_t* ptr = &_bss_begin; ptr < &_bss_end; ptr++) {
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
main();
|
||||
|
||||
while(true) {}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
__attribute__((section(".vector_table")))
|
||||
uint32_t vector_table[16] = {
|
||||
[StackPointer] = 0x00010000,
|
||||
[Reset] = reinterpret_cast<uint32_t>(ResetHandler),
|
||||
};
|
||||
Reference in New Issue
Block a user