diff --git a/include/util/arena_alloc.nasm b/include/util/arena_alloc.nasm index 8ebbf38..43901fa 100644 --- a/include/util/arena_alloc.nasm +++ b/include/util/arena_alloc.nasm @@ -18,12 +18,13 @@ arena_init: mov di, ax xor eax, eax - mov word [di + ArenaStateStruc_t.mark], eax + mov word [di + ArenaStateStruc_t.mark], ax mov word [di + ArenaStateStruc_t.end], word (__ARENA_HEAP_START + __ARENA_HEAP_SIZE) mov word [di + ArenaStateStruc_t.start], __ARENA_HEAP_START ; zero out heap area on init ; void* kmemset_byte(void* dst, uint8_t val, uint16_t len); + ; TODO: use word or qword spacing at least to speed this up mov ax, __ARENA_HEAP_SIZE push ax ; len xor ax, ax diff --git a/src/stage2/stage2.nasm b/src/stage2/stage2.nasm index da800bb..c0ec4dc 100755 --- a/src/stage2/stage2.nasm +++ b/src/stage2/stage2.nasm @@ -158,8 +158,10 @@ main: print_string HelloPrompt_info ; setup the early heap - push area + mov ax, early_heap_state + push ax ; address in bss of state structure call arena_init + add sp, 0x2 ; enable A20 gate call EnableA20