mbv: use new ninja-based build

This commit is contained in:
2025-03-30 17:42:20 -07:00
parent 922f258884
commit a5c14f089b
9 changed files with 307 additions and 85 deletions

19
mbv/hal/start.cc Normal file
View 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) {
}
}