A class used to setup and interact with the Global Descriptor Table (GDT).
More...
#include <gdt_manager.hpp>
|
| uint64_t | setup_entry (uint32_t base, uint32_t limit, uint8_t access, uint8_t flags) |
| |
A class used to setup and interact with the Global Descriptor Table (GDT).
◆ GdtManager()
| arion::GdtManager::GdtManager |
( |
std::weak_ptr< Arion > |
arion | ) |
|
|
inline |
◆ find_free_idx()
| uint8_t arion::GdtManager::find_free_idx |
( |
uint8_t |
start_idx | ) |
|
Retrieves the first free index in the GDT, where one segment descriptor can then be inserted.
- Returns
- The index.
◆ get_segment_base()
| uint32_t arion::GdtManager::get_segment_base |
( |
uint16_t |
selector | ) |
|
Fetches a segment base address from the GDT, based on its corresponding selector.
- Parameters
-
| [in] | selector | The selector to identify the GDT segment. |
- Returns
- The base address of the segment.
◆ initialize()
| static std::unique_ptr< GdtManager > arion::GdtManager::initialize |
( |
std::weak_ptr< Arion > |
arion | ) |
|
|
static |
◆ insert_entry()
| void arion::GdtManager::insert_entry |
( |
uint8_t |
idx, |
|
|
uint32_t |
base, |
|
|
uint32_t |
limit, |
|
|
uint8_t |
access, |
|
|
uint8_t |
flags |
|
) |
| |
Builds and inserts an entry in the GDT, identifying a segment.
- Parameters
-
| [in] | idx | Index in the GDT. |
| [in] | base | The linear address where the segment begins. |
| [in] | limit | The maximum addressable unit. |
| [in] | access | The Access Byte which stores permissions over the segment. |
| [in] | flags | Additional flags. |
◆ setup()
| void arion::GdtManager::setup |
( |
| ) |
|
Used to GDT in memory and its mandatory segments.
◆ setup_entry()
| uint64_t arion::GdtManager::setup_entry |
( |
uint32_t |
base, |
|
|
uint32_t |
limit, |
|
|
uint8_t |
access, |
|
|
uint8_t |
flags |
|
) |
| |
|
private |
Generates a segment descriptor to be added to the GDT.
- Parameters
-
| [in] | base | The linear address where the segment begins. |
| [in] | limit | The maximum addressable unit. |
| [in] | access | The Access Byte which stores permissions over the segment. |
| [in] | flags | Additional flags. |
- Returns
- The segment descriptor.
◆ setup_selector()
| uint16_t arion::GdtManager::setup_selector |
( |
uint8_t |
idx, |
|
|
uint16_t |
flags |
|
) |
| |
Builds a segment selector, identifying the segment descriptor to use.
- Parameters
-
| [in] | idx | Index of the selector identifying the descriptor in its table. |
| [in] | flags | Flags related to the selector (table and privileges). |
- Returns
- The selector.
◆ arion
| std::weak_ptr<Arion> arion::GdtManager::arion |
|
private |
◆ gdt_addr
| ADDR arion::GdtManager::gdt_addr |
|
private |
The address where the GDT stands in memory.
The documentation for this class was generated from the following file: