Voxia OS v0.0.1
Hobby Project Operating System Targeting x86-64
Loading...
Searching...
No Matches
loader.c File Reference
#include "libk/serial.h"
#include "libk/stivale2.h"
#include "memory/memory_utils.h"
#include <init/init.h>
#include <init/loader.h>
#include <str.h>
#include <type.h>
#include <memory/entry.h>

Go to the source code of this file.

Functions

static uint8_t stack[4096 *32] __attribute__ ((aligned(4096)))
 
 __attribute__ ((section(".stivale2hdr"), used))
 
 __attribute__ ((noinline))
 
static uint32_t stivale2_mem_entry_type_converter (uint32_t type)
 
static void print_guid (struct stivale2_guid *g)
 
void build_context_from_stivale2 (struct stivale2_struct *stivale2_struct, init_context_t *ctx)
 
void run_all_init_calls (init_context_t *ctx)
 

Variables

static struct stivale2_header_tag_smp smp_hdr_tag
 
static struct stivale2_header_tag_framebuffer framebuffer_hdr_tag
 
initcall_t __init_early_start []
 
initcall_t __init_early_end []
 

Function Documentation

◆ __attribute__() [1/3]

static uint8_t stack[4096 *32] __attribute__ ( (aligned(4096)) )
static

References stack.

◆ __attribute__() [2/3]

__attribute__ ( (noinline) )

Definition at line 34 of file loader.c.

References stivale2_tag::identifier, stivale2_tag::next, NULL, and stivale2_struct::tags.

◆ __attribute__() [3/3]

__attribute__ ( (section(".stivale2hdr"), used) )

Definition at line 27 of file loader.c.

References framebuffer_hdr_tag, stack, and used.

◆ build_context_from_stivale2()

void build_context_from_stivale2 ( struct stivale2_struct * stivale2_struct,
init_context_t * ctx )

Definition at line 81 of file loader.c.

References stivale2_mmap_entry::base, stivale2_module::begin, stivale2_struct_tag_framebuffer::blue_mask_shift, stivale2_struct_tag_framebuffer::blue_mask_size, stivale2_module::end, stivale2_struct_tag_memmap::entries, init_context_t::framebuffer, stivale2_struct_tag_framebuffer::framebuffer_addr, stivale2_struct_tag_framebuffer::framebuffer_bpp, stivale2_struct_tag_framebuffer::framebuffer_height, stivale2_struct_tag_framebuffer::framebuffer_pitch, stivale2_struct_tag_framebuffer::framebuffer_width, stivale2_struct_tag_framebuffer::green_mask_shift, stivale2_struct_tag_framebuffer::green_mask_size, stivale2_struct_tag_boot_volume::guid, init_context_t::initrd_module, stivale2_struct_tag_kernel_file_v2::kernel_file, init_context_t::kernel_raw_addr, init_context_t::kernel_raw_size, stivale2_struct_tag_kernel_file_v2::kernel_size, stivale2_mmap_entry::length, LOG_INFO, LOG_WARN, MAX_MEMORY_ENTRIES, stivale2_struct_tag_memmap::memmap, init_context_t::memory, memory_context_t::memory_entries, memory_context_t::memory_map, stivale2_struct_tag_modules::module_count, stivale2_struct_tag_modules::modules, stivale2_struct_tag_boot_volume::part_guid, print_guid(), stivale2_struct_tag_framebuffer::red_mask_shift, stivale2_struct_tag_framebuffer::red_mask_size, stivale2_struct_tag_rsdp::rsdp, init_context_t::rsdp_addr, serial_trace, initrd_module::size, initrd_module::start, stivale2_get_tag(), stivale2_mem_entry_type_converter(), STIVALE2_STRUCT_TAG_BOOT_VOLUME_ID, STIVALE2_STRUCT_TAG_FRAMEBUFFER_ID, STIVALE2_STRUCT_TAG_KERNEL_FILE_V2_ID, STIVALE2_STRUCT_TAG_MEMMAP_ID, STIVALE2_STRUCT_TAG_MODULES_ID, STIVALE2_STRUCT_TAG_RSDP_ID, stivale2_module::string, strncmp(), stivale2_mmap_entry::type, and VIRT2PHYS.

Referenced by __attribute__().

◆ print_guid()

static void print_guid ( struct stivale2_guid * g)
static

◆ run_all_init_calls()

void run_all_init_calls ( init_context_t * ctx)

Definition at line 215 of file loader.c.

References __init_early_end, __init_early_start, and LOG_INFO.

Referenced by __attribute__().

◆ stivale2_mem_entry_type_converter()

Variable Documentation

◆ __init_early_end

initcall_t __init_early_end[]
extern

Referenced by run_all_init_calls().

◆ __init_early_start

initcall_t __init_early_start[]
extern

Referenced by run_all_init_calls().

◆ framebuffer_hdr_tag

struct stivale2_header_tag_framebuffer framebuffer_hdr_tag
static
Initial value:
= {
.tag = {.identifier = STIVALE2_HEADER_TAG_FRAMEBUFFER_ID,
.next = (uint64_t) &smp_hdr_tag},
.framebuffer_width = 0,
.framebuffer_height = 0,
.framebuffer_bpp = 0}
static struct stivale2_header_tag_smp smp_hdr_tag
Definition loader.c:16
#define STIVALE2_HEADER_TAG_FRAMEBUFFER_ID
Definition stivale2.h:54
unsigned long uint64_t
Definition type.h:25

Definition at line 20 of file loader.c.

Referenced by __attribute__().

◆ smp_hdr_tag

struct stivale2_header_tag_smp smp_hdr_tag
static
Initial value:
= {
.tag = {.identifier = STIVALE2_HEADER_TAG_SMP_ID, .next = 0},
.flags = 0}
#define STIVALE2_HEADER_TAG_SMP_ID
Definition stivale2.h:96

Definition at line 16 of file loader.c.