pmm.inc

Our PMM is just a linked list of page-aligned size blocks.

┌─────┐      ┌─────┐
│size │  ┌──►│size │
│next ├──┘   │next ├────► 0
└─────┘      └─────┘

Constants

PMM_VIRT_TEMP

Macros

PAGE_ALIGN_UP reg

PAGE_ALIGN_DOWN reg

Structs

PMMFreeRange

private functions

Summary
Functions
_pmm_map_temp_pageMap physical address at PMM_VIRT_TEMP
_pmm_unmap_temp_pageUnmap PMM_VIRT_TEMP
_pmm_init_regionAdd new memory region to the linked list.
_pmm_init_low_memoryInitialize bitmap for lower memory (below 1Mb)
_pmm_merge_block

Functions

_pmm_map_temp_page

_pmm_map_temp_page

Map physical address at PMM_VIRT_TEMP

In

EAXPhysical address

_pmm_unmap_temp_page

_pmm_unmap_temp_page

Unmap PMM_VIRT_TEMP

_pmm_init_region

_pmm_init_region

Add new memory region to the linked list.

In

EAXStart
EDXEnd

_pmm_init_low_memory

_pmm_init_low_memory

Initialize bitmap for lower memory (below 1Mb)

_pmm_merge_block

_pmm_merge_block

Functions

pmm_alloc

pmm_alloc

In

EAXsize in page

Out

EAXfirst page physical address, 0 on error
EDXerror code

pmm_alloc_page

pmm_alloc_page

Out

EAXpage physical address, 0 on error
EDXerror code

pmm_free

pmm_free

In

EAXStart
EDXPage count

pmm_free_page

pmm_free_page

In

EAXPhysical address

pmm_init

pmm_init

Out

EAXreturn -1 on error

variables

Summary
Variables
pPMMFreeListHeadHold first free list entry physical address

Variables

pPMMFreeListHead

Hold first free list entry physical address

_pmm_map_temp_page
Map physical address at PMM_VIRT_TEMP
_pmm_unmap_temp_page
Unmap PMM_VIRT_TEMP
_pmm_init_region
Add new memory region to the linked list.
_pmm_init_low_memory
Initialize bitmap for lower memory (below 1Mb)
_pmm_merge_block
pmm_alloc
pmm_alloc_page
pmm_free
pmm_free_page
pmm_init
Close