basic arena allocator implementation
This commit is contained in:
@@ -68,6 +68,7 @@ arena_alloc:
|
|||||||
.func:
|
.func:
|
||||||
; remove bytes from pool and increment mark to the new cursor location
|
; remove bytes from pool and increment mark to the new cursor location
|
||||||
; return a pointer to the begining of allocated segment
|
; return a pointer to the begining of allocated segment
|
||||||
|
ERROR STEVIA_DEBUG_UNIMPLEMENTED
|
||||||
.endp:
|
.endp:
|
||||||
__CDECL16_EXIT
|
__CDECL16_EXIT
|
||||||
ret
|
ret
|
||||||
@@ -76,6 +77,7 @@ arena_mark:
|
|||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.func:
|
.func:
|
||||||
; return the current location of the 'cursor' in the allocator
|
; return the current location of the 'cursor' in the allocator
|
||||||
|
ERROR STEVIA_DEBUG_UNIMPLEMENTED
|
||||||
.endp:
|
.endp:
|
||||||
__CDECL16_EXIT
|
__CDECL16_EXIT
|
||||||
ret
|
ret
|
||||||
@@ -84,6 +86,7 @@ arena_reset_to:
|
|||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.func:
|
.func:
|
||||||
; rewind the arena to a previously marked point
|
; rewind the arena to a previously marked point
|
||||||
|
ERROR STEVIA_DEBUG_UNIMPLEMENTED
|
||||||
.endp:
|
.endp:
|
||||||
__CDECL16_EXIT
|
__CDECL16_EXIT
|
||||||
ret
|
ret
|
||||||
@@ -92,6 +95,7 @@ arena_reset:
|
|||||||
__CDECL16_ENTRY
|
__CDECL16_ENTRY
|
||||||
.func:
|
.func:
|
||||||
; reset the entire heap to a fresh state
|
; reset the entire heap to a fresh state
|
||||||
|
ERROR STEVIA_DEBUG_UNIMPLEMENTED
|
||||||
.endp:
|
.endp:
|
||||||
__CDECL16_EXIT
|
__CDECL16_EXIT
|
||||||
ret
|
ret
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ init:
|
|||||||
jmp word __STAGE2_SEGMENT:main
|
jmp word __STAGE2_SEGMENT:main
|
||||||
|
|
||||||
; ###############
|
; ###############
|
||||||
; Functions
|
; Core Functions
|
||||||
; ###############
|
; ###############
|
||||||
|
|
||||||
%include "util/kmem_func.nasm"
|
%include "util/kmem_func.nasm"
|
||||||
@@ -96,6 +96,11 @@ init:
|
|||||||
%include "util/kmemset4_func.nasm"
|
%include "util/kmemset4_func.nasm"
|
||||||
%include "util/error_func.nasm"
|
%include "util/error_func.nasm"
|
||||||
|
|
||||||
|
; ###############
|
||||||
|
; Functions
|
||||||
|
; ###############
|
||||||
|
%include "util/arena_alloc.nasm"
|
||||||
|
|
||||||
; ###############
|
; ###############
|
||||||
; FAT32 Driver
|
; FAT32 Driver
|
||||||
; ###############
|
; ###############
|
||||||
@@ -152,6 +157,10 @@ main:
|
|||||||
call disable_cursor_bios
|
call disable_cursor_bios
|
||||||
print_string HelloPrompt_info
|
print_string HelloPrompt_info
|
||||||
|
|
||||||
|
; setup the early heap
|
||||||
|
push area
|
||||||
|
call arena_init
|
||||||
|
|
||||||
; enable A20 gate
|
; enable A20 gate
|
||||||
call EnableA20
|
call EnableA20
|
||||||
print_string A20_Enabled_OK_info
|
print_string A20_Enabled_OK_info
|
||||||
@@ -413,6 +422,10 @@ fat32_state:
|
|||||||
align 16, resb 1
|
align 16, resb 1
|
||||||
SteviaInfo:
|
SteviaInfo:
|
||||||
resd 4
|
resd 4
|
||||||
|
|
||||||
|
align 16, resb 1
|
||||||
|
early_heap_state:
|
||||||
|
resb ArenaStateStruc_t_size
|
||||||
;
|
;
|
||||||
; post-bss init globals
|
; post-bss init globals
|
||||||
;
|
;
|
||||||
|
|||||||
Reference in New Issue
Block a user