diff --git a/kernel/malloc.asm b/kernel/malloc.asm index fe34e04..2f70a91 100644 --- a/kernel/malloc.asm +++ b/kernel/malloc.asm @@ -1,11 +1,34 @@ ; All these functions assume DS=0 +malloc_reserve_16: + push bx + call malloc_mark_allocated + pop bx + add bx, 0x10 + loop malloc_reserve_16 + ret + malloc_reset: xor ax, ax mov es, ax call malloc_get_table mov cx, 0x100 ; 256 words rep stosw + + ; reserve IVT and BDA + xor bx, bx + mov cx, 0x50 + call malloc_reserve_16 + + ; reserve malloc table itself + mov bx, 0x0600 + mov cx, 0x20 + call malloc_reserve_16 + + ; reserve location for chainloaded boot sector + mov bx, 0x7C00 + mov cx, 0x20 + call malloc_reserve_16 ret ; Input: