Module virtual_memory_mapper

Source
Expand description

This very specific to 64-bit x86 architecture, if this is to be ported to other architectures this will need to be changed

Modulesยง

flags

Structsยง

PageDirectoryTable ๐Ÿ”’
PageDirectoryTablePtr ๐Ÿ”’
VirtualMemoryMapEntry
VirtualMemoryMapper

Constantsยง

ADDR_MASK ๐Ÿ”’
KERNEL_L3_INDEX_END ๐Ÿ”’
KERNEL_L3_INDEX_START ๐Ÿ”’
KERNEL_L3_PROCESS_INDEX_END ๐Ÿ”’
KERNEL_L3_PROCESS_INDEX_START ๐Ÿ”’
KERNEL_L4_INDEX ๐Ÿ”’
KERNEL_PROCESS_VIRTUAL_ADDRESS_START
MAX_USER_VIRTUAL_ADDRESS
NUM_USER_L4_INDEXES ๐Ÿ”’

Staticsยง

KERNEL_VIRTUAL_MEMORY_MANAGER ๐Ÿ”’

Functionsยง

clone_current_vm_as_user
get_current_vm
get_l1 ๐Ÿ”’
get_l2 ๐Ÿ”’
get_l3 ๐Ÿ”’
get_l4 ๐Ÿ”’
init_kernel_vm
is_address_mapped_in_kernel
map_kernel
switch_to_kernelโš 
Safety
unmap_kernel
is_allocated is used to indicate if the physical pages were allocated by the caller i.e. when we called map_kernel, the physical_address is None and we will allocate the pages, and thus when calling this function, you should pass is_allocated = true