prototypes for displaying some memory maps

but now I need to write an arena allocator...so brb
This commit is contained in:
2025-09-04 17:51:52 -04:00
parent c10394a0cd
commit 86d966811b

View File

@@ -85,5 +85,37 @@ GetMemoryMap:
__CDECL16_EXIT __CDECL16_EXIT
ret ret
PrintMemoryMap:
__CDECL16_ENTRY
.func:
mov eax, dword [SteviaInfo + SteviaInfoStruct_t.MemoryMapEntries]
cmp eax, 0
je PrintMemoryMap.endp ; if entries == 0, exit
mov ecx, eax ; store # of entries in counter
mov eax, BIOSMemoryMap ; address to start of e820 mmap
push dword ecx
push dword eax
call FormatMemoryMapEntry
add sp, 0x8
; ax contains segment offset to string after call
; TODO: going to need an allocator for strings and stuff...
; print_string strformat_buffer
.endp:
__CDECL16_EXIT
ret
FormatMemoryMapEntry:
__CDECL16_ENTRY
.func:
; create a string buffer somewhere and return address to result string in ax
.endp:
__CDECL16_EXIT
ret
%endif %endif
%define __INC_E820MEMORY_MAP %define __INC_E820MEMORY_MAP