LF OS
Hobby operating system for amd64 with high ambitions
Loading...
Searching...
No Matches
loader.h
Go to the documentation of this file.
1#ifndef _LOADER_H_INCLUDED
2#define _LOADER_H_INCLUDED
3
4#include <stdint.h>
6static const uint64_t LFOS_LOADER_SIGNATURE = 0x17a15174545c8b4f;
8// basic "what is this memory for" attributes
10#define MEMORY_REGION_USABLE (1ULL << 0)
12#define MEMORY_REGION_FIRMWARE (1ULL << 1)
14#define MEMORY_REGION_CODE (1ULL << 2)
16#define MEMORY_REGION_RO (1ULL << 3)
18// "what kinda memory is this"
20#define MEMORY_REGION_NV (1ULL << 4)
22#define MEMORY_REGION_MORE_RELIABLE (1ULL << 5)
24// cacheability flags
26#define MEMORY_REGION_UC (1ULL << 16)
28#define MEMORY_REGION_WC (1ULL << 17)
30#define MEMORY_REGION_WT (1ULL << 18)
32#define MEMORY_REGION_WB (1ULL << 19)
34#define MEMORY_REGION_UCE (1ULL << 20)
35
37#define MEMORY_REGION_WP (1ULL << 21)
39#define MEMORY_REGION_RP (1ULL << 22)
41#define MEMORY_REGION_XP (1ULL << 23)
42
79
91
94 char name[256];
95
98
101}__attribute__((packed));
102
103#endif
unsigned short uint16_t
Definition arch.h:8
uint64_t ptr_t
Definition arch.h:17
unsigned long uint64_t
Definition arch.h:14
unsigned char uint8_t
Definition arch.h:5
uint16_t fb_stride
Pixels per scanline (including invisible pixels)
Definition loader.h:68
uint64_t offset
Offset where the file contents are located after LoaderStruct.
Definition loader.h:100
uint64_t flags
Flags for the memory region. See MEMORY_REGION_ defines.
Definition loader.h:89
uint64_t signature
Signature. always 0x17a15174545c8b4f.
Definition loader.h:46
uint64_t num_files
Number of loaded files.
Definition loader.h:74
uint16_t fb_width
Width of the framebuffer in visible pixels.
Definition loader.h:56
ptr_t firmware_info
Firmware info data, e.g. EFI_SYSTEM_TABLE on UEFI.
Definition loader.h:77
size_t num_pages
Number of pages, where page size is 4096 bytes.
Definition loader.h:86
static const uint64_t LFOS_LOADER_SIGNATURE
Definition loader.h:6
ptr_t fb_location
Location of framebuffer as physical address.
Definition loader.h:53
uint64_t size
Size of the loaded file.
Definition loader.h:97
uint64_t num_mem_desc
Number of memory descriptors.
Definition loader.h:71
uint8_t fb_bpp
Bytes per pixel for the framebuffer.
Definition loader.h:62
uint16_t size
Definition loader.h:50
ptr_t start_address
Start of the region as physical address.
Definition loader.h:83
char name[256]
Zero terminated string with the name of the file.
Definition loader.h:94
uint16_t fb_height
Height of the framebuffer in pixels.
Definition loader.h:59
uint8_t fb_reserved1
reserved location
Definition loader.h:65
Main interface between loader and kernel.
Definition loader.h:44
Describes a single memory region.
Definition loader.h:81