My Kernel v0.1.0
Collaboration diagram for Kernel Symbols:

Data Structures

struct  kernel_symbol
 A single symbol entry inside the symbol table @info The structure is ALWAYS followed by the symbol's name's string. More...
 
struct  kernel_symbol_table
 The symbol table for the kernel. More...
 

Functions

ALWAYS_INLINE const char * kernel_symbol_name (const kernel_symbol_t *sym)
 Retrieve a kernel symbol's raw name.
 
const kernel_symbol_t * kernel_symbol_from_address (vaddr_t address)
 Find the kernel symbol associated with a given address. More...
 

Variables

u32 kernel_symbol::size
 Size of the symbol (sizeof(size) + sizeof(address) + strlen(name))
 
u32 kernel_symbol::address
 Address of the symbol.
 

Detailed Description

Kernel Symbols

For debugging purposes, we want to be able to retrieve the name of a kernel's function given its address. This can let us identify a faulting address more easily.

To do so, during the compilation process, we manually inject the list of kernel's functions names, as well as their respective address, inside of the .kernel_symbols ELF segment.

Function Documentation

◆ kernel_symbol_from_address()

const kernel_symbol_t * kernel_symbol_from_address ( vaddr_t  address)

The returned symbol is the one with the biggest address lower than the one we're looking for.