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
mem_layout.h
Go to the documentation of this file.
1
11#ifndef MEM_LAYOUT_MEM_LAYOUT_H
12#define MEM_LAYOUT_MEM_LAYOUT_H
13
14#include <stdint.h>
15
17typedef uint64_t phy_addr;
18
20typedef uint64_t virt_addr;
21
25 USER_SPACE = 0x0000000000000000UL,
26
28 KERNEL_BASE = 0xFFFF000000000000UL,
29};
30
32void update_kernel_base_va(void);
33
40
47
48#endif /* MEM_LAYOUT_MEM_LAYOUT_H */
uint64_t virt_addr
Type for representing virtual addresses.
Definition mem_layout.h:20
phy_addr va_to_pa(virt_addr v_addr)
Convert a virtual address to a physical address.
Definition mem_layout.c:23
virt_addr pa_to_va(phy_addr p_addr)
Convert a physical address to a virtual address.
Definition mem_layout.c:28
mem_layout_bases
Memory layout base addresses.
Definition mem_layout.h:23
@ KERNEL_BASE
Definition mem_layout.h:28
@ USER_SPACE
Definition mem_layout.h:25
uint64_t phy_addr
Type for representing physical addresses.
Definition mem_layout.h:17
void update_kernel_base_va(void)
Update the kernel base virtual address.
Definition mem_layout.c:18