Initialize heap, increase stack size

This commit is contained in:
TuxSH 2018-05-04 23:56:01 +02:00
parent dc3099781d
commit 0d344e45af
2 changed files with 21 additions and 10 deletions

View file

@ -14,6 +14,14 @@ char g_bct0[0x8000];
/* Allow for main(int argc, void **argv) signature. */ /* Allow for main(int argc, void **argv) signature. */
#pragma GCC diagnostic ignored "-Wmain" #pragma GCC diagnostic ignored "-Wmain"
void __init_heap(void) {
extern char* fake_heap_start;
extern char* fake_heap_end;
fake_heap_start = (char*)0xF0000000;
fake_heap_end = (char*)0xFFF00000;
}
int main(int argc, void **argv) { int main(int argc, void **argv) {
stage2_args_t args = {0}; stage2_args_t args = {0};
loader_ctx_t *loader_ctx = get_loader_ctx(); loader_ctx_t *loader_ctx = get_loader_ctx();

View file

@ -33,7 +33,7 @@ _start:
_relocation_loop_end: _relocation_loop_end:
/* Set the stack pointer */ /* Set the stack pointer */
ldr sp, =0x40008000 ldr sp, =0x40010000
mov fp, #0 mov fp, #0
stmfd sp!, {r0, r1} stmfd sp!, {r0, r1}
@ -44,6 +44,9 @@ _start:
sub r2, r2, r0 sub r2, r2, r0
bl memset bl memset
/* Initialize the heap */
bl __init_heap
/* Call global constructors */ /* Call global constructors */
bl __libc_init_array bl __libc_init_array