Commit 839c9b5e authored by misane's avatar misane
Browse files

fix: fix heap start and heap end; init .bss section for uninit-issue

Showing with 12 additions and 2 deletions
+12 -2
......@@ -21,9 +21,11 @@ SECTIONS
}
. = ALIGN(16);
_bss_start = .;
.bss : {
*(.bss)
}
_bss_end = .;
_stack_top = ALIGN(16);
. = _stack_top + 0x4000;
......@@ -32,8 +34,10 @@ SECTIONS
end = .;
_end = .;
_heap_start = ALIGN(0x1000);
_heap_end = _heap_start + 0x20000;
. = ALIGN(0x1000);
_heap_start = .;
. = _heap_start + 0x20000;
_heap_end = .;
_kernel_end = .;
kernel_end = .;
......
#include "asm/cpu.h"
#include "klib.h"
extern int kmain();
extern char _stack_pointer;
extern char _bss_start, _bss_end;
void _start() {
void *ksp = &_stack_pointer - 0x20;
w_sp((uint64_t)ksp);
intr_off();
memset(&_bss_start, 0, &_bss_end-&_bss_start);
kmain();
while (1);
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment