documentation/kernel/drivers/elf/mapping.h.md

19 lines
1.4 KiB
Markdown
Raw Normal View History

2023-05-28 17:16:43 +00:00
# mapping.h
Handles the memory mappings that an ELF file can request.
# `elf_mapping_T` - struct
A mapping describes an area of memory,
that should be copied from the elf file into the RAM and how/where it should be mapped.
| Name | Type | Description |
|----------------|----------|------------------------------------------------------------------------------------------------------------------|
| offset_file | uint64_t | The mappings' start in the elf file |
| offset_virtual | uint64_t | The mappings' start in memory |
| length_file | uint64_t | The mappings' size in the elf file |
| length_virtual | uint64_t | The mappings' size in memory, if this is bigger than _length_file_ the remaining space will be filled with zeros |
# `elf_mappings_apply(mappings, num_mappings, buffer, base, page_map)` - function (void)
Maps all **_mappings_** into **_page_map_** and copies the related data from **_buffer_** (elf file) to the mapped memory.
**_base_** specifies where the mappings should start in the virtual address space.