LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
loader.h File Reference

(29312b1 fbconsole, panic: render panic after framebuffer was given to userspace - without clearing screen contents)

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

Go to the source code of this file.

Data Structures

struct  LoaderStruct
 Main interface between loader and kernel. More...
 
struct  MemoryRegion
 Describes a single memory region. More...
 
struct  FileDescriptor
 

Macros

#define MEMORY_REGION_USABLE   (1ULL << 0)
 memory is free to be used
 
#define MEMORY_REGION_FIRMWARE   (1ULL << 1)
 memory is in use by the firmware
 
#define MEMORY_REGION_CODE   (1ULL << 2)
 memory holds code
 
#define MEMORY_REGION_RO   (1ULL << 3)
 memory supports being mapped read-only
 
#define MEMORY_REGION_NV   (1ULL << 4)
 memory is non-volatile
 
#define MEMORY_REGION_MORE_RELIABLE   (1ULL << 5)
 memory is more reliable than other memory in the system
 
#define MEMORY_REGION_UC   (1ULL << 16)
 supports uncachable
 
#define MEMORY_REGION_WC   (1ULL << 17)
 supports write-combine
 
#define MEMORY_REGION_WT   (1ULL << 18)
 supports write-through
 
#define MEMORY_REGION_WB   (1ULL << 19)
 supports write-back
 
#define MEMORY_REGION_UCE   (1ULL << 20)
 supports uncacheable, exported and "fetch and add" semaphore mechanism
 
#define MEMORY_REGION_WP   (1ULL << 21)
 Supports write-protected.
 
#define MEMORY_REGION_RP   (1ULL << 22)
 Supports read-protected.
 
#define MEMORY_REGION_XP   (1ULL << 23)
 Supports execute-protected.
 

Functions

struct LoaderStruct __attribute__ ((packed))
 

Variables

static const uint64_t LFOS_LOADER_SIGNATURE = 0x17a15174545c8b4f
 
uint64_t signature
 Signature. always 0x17a15174545c8b4f.
 
uint16_t size
 Size of the loaded file.
 
ptr_t fb_location
 Location of framebuffer as physical address.
 
uint16_t fb_width
 Width of the framebuffer in visible pixels.
 
uint16_t fb_height
 Height of the framebuffer in pixels.
 
uint8_t fb_bpp
 Bytes per pixel for the framebuffer.
 
uint8_t fb_reserved1
 reserved location
 
uint16_t fb_stride
 Pixels per scanline (including invisible pixels)
 
uint64_t num_mem_desc
 Number of memory descriptors.
 
uint64_t num_files
 Number of loaded files.
 
ptr_t firmware_info
 Firmware info data, e.g. EFI_SYSTEM_TABLE on UEFI.
 
ptr_t start_address
 Start of the region as physical address.
 
size_t num_pages
 Number of pages, where page size is 4096 bytes.
 
uint64_t flags
 Flags for the memory region. See MEMORY_REGION_ defines.
 
char name [256]
 Zero terminated string with the name of the file.
 
uint64_t offset
 Offset where the file contents are located after LoaderStruct.
 

Data Structure Documentation

◆ LoaderStruct

struct LoaderStruct

Main interface between loader and kernel.

Definition at line 44 of file loader.h.

+ Collaboration diagram for LoaderStruct:
Data Fields
uint8_t fb_bpp Bytes per pixel for the framebuffer.
uint16_t fb_height Height of the framebuffer in pixels.
ptr_t fb_location Location of framebuffer as physical address.
uint8_t fb_reserved1 reserved location
uint16_t fb_stride Pixels per scanline (including invisible pixels)
uint16_t fb_width Width of the framebuffer in visible pixels.
ptr_t firmware_info Firmware info data, e.g. EFI_SYSTEM_TABLE on UEFI.
uint64_t num_files Number of loaded files.
uint64_t num_mem_desc Number of memory descriptors.
uint64_t signature Signature. always 0x17a15174545c8b4f.
uint16_t size

Size of this structure, allowing us to add fields at the end for new features.

◆ MemoryRegion

struct MemoryRegion

Describes a single memory region.

Definition at line 81 of file loader.h.

+ Collaboration diagram for MemoryRegion:
Data Fields
uint64_t flags Flags for the memory region. See MEMORY_REGION_ defines.
size_t num_pages Number of pages, where page size is 4096 bytes.
ptr_t start_address Start of the region as physical address.

◆ FileDescriptor

struct FileDescriptor

Definition at line 92 of file loader.h.

+ Collaboration diagram for FileDescriptor:
Data Fields
char name[256] Zero terminated string with the name of the file.
uint64_t offset Offset where the file contents are located after LoaderStruct.
uint64_t size Size of the loaded file.

Macro Definition Documentation

◆ MEMORY_REGION_CODE

#define MEMORY_REGION_CODE   (1ULL << 2)

memory holds code

Definition at line 14 of file loader.h.

◆ MEMORY_REGION_FIRMWARE

#define MEMORY_REGION_FIRMWARE   (1ULL << 1)

memory is in use by the firmware

Definition at line 12 of file loader.h.

◆ MEMORY_REGION_MORE_RELIABLE

#define MEMORY_REGION_MORE_RELIABLE   (1ULL << 5)

memory is more reliable than other memory in the system

Definition at line 22 of file loader.h.

◆ MEMORY_REGION_NV

#define MEMORY_REGION_NV   (1ULL << 4)

memory is non-volatile

Definition at line 20 of file loader.h.

◆ MEMORY_REGION_RO

#define MEMORY_REGION_RO   (1ULL << 3)

memory supports being mapped read-only

Definition at line 16 of file loader.h.

◆ MEMORY_REGION_RP

#define MEMORY_REGION_RP   (1ULL << 22)

Supports read-protected.

Definition at line 39 of file loader.h.

◆ MEMORY_REGION_UC

#define MEMORY_REGION_UC   (1ULL << 16)

supports uncachable

Definition at line 26 of file loader.h.

◆ MEMORY_REGION_UCE

#define MEMORY_REGION_UCE   (1ULL << 20)

supports uncacheable, exported and "fetch and add" semaphore mechanism

Definition at line 34 of file loader.h.

◆ MEMORY_REGION_USABLE

#define MEMORY_REGION_USABLE   (1ULL << 0)

memory is free to be used

Definition at line 10 of file loader.h.

◆ MEMORY_REGION_WB

#define MEMORY_REGION_WB   (1ULL << 19)

supports write-back

Definition at line 32 of file loader.h.

◆ MEMORY_REGION_WC

#define MEMORY_REGION_WC   (1ULL << 17)

supports write-combine

Definition at line 28 of file loader.h.

◆ MEMORY_REGION_WP

#define MEMORY_REGION_WP   (1ULL << 21)

Supports write-protected.

Definition at line 37 of file loader.h.

◆ MEMORY_REGION_WT

#define MEMORY_REGION_WT   (1ULL << 18)

supports write-through

Definition at line 30 of file loader.h.

◆ MEMORY_REGION_XP

#define MEMORY_REGION_XP   (1ULL << 23)

Supports execute-protected.

Definition at line 41 of file loader.h.

Function Documentation

◆ __attribute__()

struct LoaderStruct __attribute__ ( (packed)  )

Definition at line 28 of file hpet.c.

References _reserved1.

Variable Documentation

◆ fb_bpp

uint8_t fb_bpp

Bytes per pixel for the framebuffer.

Definition at line 17 of file loader.h.

◆ fb_height

uint16_t fb_height

Height of the framebuffer in pixels.

Definition at line 14 of file loader.h.

◆ fb_location

ptr_t fb_location

Location of framebuffer as physical address.

Definition at line 8 of file loader.h.

◆ fb_reserved1

uint8_t fb_reserved1

reserved location

Definition at line 20 of file loader.h.

◆ fb_stride

uint16_t fb_stride

Pixels per scanline (including invisible pixels)

Definition at line 23 of file loader.h.

◆ fb_width

uint16_t fb_width

Width of the framebuffer in visible pixels.

Definition at line 11 of file loader.h.

◆ firmware_info

ptr_t firmware_info

Firmware info data, e.g. EFI_SYSTEM_TABLE on UEFI.

Definition at line 32 of file loader.h.

◆ flags

uint64_t flags

Flags for the memory region. See MEMORY_REGION_ defines.

Definition at line 7 of file loader.h.

◆ LFOS_LOADER_SIGNATURE

const uint64_t LFOS_LOADER_SIGNATURE = 0x17a15174545c8b4f
static

Definition at line 6 of file loader.h.

◆ name

uint32_t name

Zero terminated string with the name of the file.

Definition at line 1 of file loader.h.

◆ num_files

uint64_t num_files

Number of loaded files.

Definition at line 29 of file loader.h.

◆ num_mem_desc

uint64_t num_mem_desc

Number of memory descriptors.

Definition at line 26 of file loader.h.

◆ num_pages

size_t num_pages

Number of pages, where page size is 4096 bytes.

Definition at line 4 of file loader.h.

◆ offset

uint64_t offset

Offset where the file contents are located after LoaderStruct.

Definition at line 7 of file loader.h.

◆ signature

uint64_t signature

Signature. always 0x17a15174545c8b4f.

Definition at line 1 of file loader.h.

◆ size

uint64_t size

Size of the loaded file.

Size of this structure, allowing us to add fields at the end for new features.

Definition at line 5 of file loader.h.

◆ start_address

ptr_t start_address

Start of the region as physical address.

Definition at line 1 of file loader.h.