|
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.
|
Implementation of utility functions for kernel development. More...
#include "utils/utils.h"#include "allocator/page_allocator.h"#include "asm/asm_helper.h"#include "fdt/fdt.h"#include "linker/symbols.h"#include "utils/kprintf.h"#include <libfdt.h>
Data Structures | |
| union | current_el_t |
| AArch64 CurrentEL register. More... | |
Typedefs | |
| typedef union current_el_t | current_el_t |
| AArch64 CurrentEL register. | |
Functions | |
| static current_el_t | read_current_el (void) |
| Reads the current Exception Level via the CurrentEL system register. | |
| static bool | reserve_kernel_img_pages (void) |
| Reserve pages occupied by the kernel image. | |
| static bool | reserve_fdt_pages (const void *fdt_addr) |
| Reserve pages occupied by the Device Tree Blob (FDT). | |
| bool | setup_page_allocator (const void *fdt_addr) |
| Set up the global page allocator. | |
| void | print_kernelite_logo (void) |
| Prints the Kernelite ASCII art logo and banner to the console. | |
| uint32_t | get_core_id (void) |
| Gets the core id. | |
| void | print_current_el (void) |
| Prints the current exeception level. | |
Implementation of utility functions for kernel development.
This module contains utility functions for kernel development, including functions for reserving kernel image pages, setting up the global page allocator, and other helper functions used across the kernel.
| typedef union current_el_t current_el_t |
AArch64 CurrentEL register.
Contains the current Exception Level. Read-only. The EL field is at bits [3:2]; bits [1:0] are RES0.
| uint32_t get_core_id | ( | void | ) |
Gets the core id.
|
inlinestatic |
Reads the current Exception Level via the CurrentEL system register.
|
static |
Reserve pages occupied by the Device Tree Blob (FDT).
This function calculates the number of pages occupied by the FDT and reserves those pages in the page allocator to prevent them from being allocated for other purposes.
| fdt_addr | Pointer to the FDT blob. |
|
static |
Reserve pages occupied by the kernel image.
This function calculates the number of pages occupied by the kernel image based on the linker-provided symbols and reserves those pages in the page allocator to prevent them from being allocated for other purposes.
| bool setup_page_allocator | ( | const void * | fdt_addr | ) |
Set up the global page allocator.
This function initializes the global page allocator based on the memory map obtained from the Device Tree Blob (FDT).
| fdt_addr | Pointer to the FDT blob. |