mbv: use new ninja-based build
This commit is contained in:
19
mbv/hal/start.cc
Normal file
19
mbv/hal/start.cc
Normal file
@@ -0,0 +1,19 @@
|
||||
#include <cstdint>
|
||||
|
||||
extern "C" uint32_t _bss_begin, _bss_end, _initial_stack_pointer;
|
||||
extern "C" int main();
|
||||
|
||||
__attribute__((section(".start"), used, naked))
|
||||
void _start() {
|
||||
// clear .bss
|
||||
for (uint32_t* ptr = &_bss_begin; ptr < &_bss_end; ptr++) {
|
||||
*ptr = 0;
|
||||
}
|
||||
|
||||
asm volatile ( "la sp, _initial_stack_pointer" );
|
||||
|
||||
main();
|
||||
|
||||
while (true) {
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user