Kernelite 0.1.0
Kernelite is a minimalist, educational operating system kernel built from scratch. The project aims to recreate core components of the Linux architecture to explore the fundamentals of operating system design and hardware-software interaction.
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions
mem_layout.h File Reference

Memory layout definitions. More...

#include <stdint.h>
Include dependency graph for mem_layout.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef uint64_t phy_addr
 Type for representing physical addresses.
 
typedef uint64_t virt_addr
 Type for representing virtual addresses.
 

Enumerations

enum  mem_layout_bases { USER_SPACE = 0x0000000000000000UL , KERNEL_BASE = 0xFFFF000000000000UL }
 Memory layout base addresses. More...
 

Functions

void update_kernel_base_va (void)
 Update the kernel base virtual address.
 
phy_addr va_to_pa (virt_addr v_addr)
 Convert a virtual address to a physical address.
 
virt_addr pa_to_va (phy_addr p_addr)
 Convert a physical address to a virtual address.
 

Detailed Description

Memory layout definitions.

Defines the memory layout for the kernel.

Author
Abhin Parekadan Jose
Date
2026-05-25

Enumeration Type Documentation

◆ mem_layout_bases

Memory layout base addresses.

Enumerator
USER_SPACE 

Start of user space (0x0)

KERNEL_BASE 

Base of kernel space

Function Documentation

◆ pa_to_va()

virt_addr pa_to_va ( phy_addr  p_addr)

Convert a physical address to a virtual address.

Parameters
p_addrThe physical address to convert.
Returns
The corresponding virtual address.

◆ va_to_pa()

phy_addr va_to_pa ( virt_addr  v_addr)

Convert a virtual address to a physical address.

Parameters
v_addrThe virtual address to convert.
Returns
The corresponding physical address.