XenevaOS
Loading...
Searching...
No Matches
aurora.h
Go to the documentation of this file.
1
30#ifndef __AURORA_H__
31#define __AURORA_H__
32
33#include <stdint.h>
34
35
36#ifdef __GNUC__
37#define AU_EXPORT __attribute__((visibility("default")))
38#define AU_IMPORT
39#define AU_ALIGN(x) __attribute__((aligned(x)))
40#else
41#define AU_EXPORT __declspec(dllexport) __declspec(noinline)
42#define AU_IMPORT __declspec(dllimport)
43#define AU_ALIGN(x) __declspec(align(x))
44#endif
45
46#ifdef __AU_KERNEL__
47#define AU_FUNC AU_EXPORT
48#else
49#define AU_FUNC AU_IMPORT
50#endif
51
52#ifdef __cplusplus
53#define AU_EXTERN extern "C"
54#else
55#define AU_EXTERN extern
56#endif
57
59
60#ifdef ARCH_X64
61#define KERNEL_STACK_LOCATION 0xFFFFFB0000000000
62#elif ARCH_ARM64
63#define KERNEL_STACK_LOCATION 0xFFFFB00000000000 //0x0000000B00000000
64#endif
65
66#define KERNEL_STACK_SIZE 40960//16384 //16KiB
67
68// macro for llvm compatibility
69#ifndef ALIGNED
70#if defined(_MSC_VER)
71 #define ALIGNED(x) __declspec(align(x))
72#elif defined(__GNUC__) || defined(__clang__)
73 #define ALIGNED(x) __attribute__((aligned(x)))
74#else
75 #define ALIGNED(x)
76#endif
77#endif
78
79
80typedef struct _lbprotocol_ {
86 /* we should take care of
87 * little boot binary occupied
88 * memory area also, becasuse
89 * upto the main kernel becomes
90 * standalone, we can't neglect
91 * little boot code. because memory
92 * map data structure, and paging
93 * data structures are statically
94 * allocated within this region
95 */
98
99 /* usable memory map describes
100 * usable memory areas*/
107
108
109#define BOOT_UEFI_x64 1
110#define BOOT_UEFI_ARM64 2
111#define BOOT_LITTLEBOOT_ARM64 3
116typedef struct _KERNEL_BOOT_INFO_ {
117 /* Boot type either UEFI_BOOT or BIOS_BOOT */
119
121
123
124 /* map -- UEFI memory map */
125 void *map;
126
127 /* descriptor_size -- UEFI memory map descriptor size */
129
130 /* mem_map_size -- UEFI memory map size */
132
133 /* Install the physical direct map here from the loader itself --axiss */
136
137 /* graphics_framebuffer -- framebuffer address passed by XNLDR */
139
140 /* fb_size -- framebuffer total size */
141 size_t fb_size;
142
143 /* X_Resolution -- Total width of the entire display */
145
146 /* Y_Resolution -- Total height of the entire display */
148
149 /* pixels_per_line -- scanline of the current display */
151
152 /* redmask, greenmask, bluemask, resvmask -- color mask */
157
158 /* acpi_table_pointer -- acpi base memory map */
160
161 /* kernel_size -- total kernel image size */
163
164 /* psf_font_data -- screen font address loaded
165 by XNLDR to use for debugging purpose */
167
168 /* printf_gui -- character printing function pointer to use
169 for debugging purpose provided by XNLDR */
170 void(*printf_gui) (const char* text, ...);
171
172 /* unused pointer entries */
179 void* apcode;
184
185/*
186 * AuGetBootInfoStruc -- return kernel boot information
187 */
189
190#endif
struct _KERNEL_BOOT_INFO_ * PKERNEL_BOOT_INFO
#define AU_EXTERN
Definition aurora.h:55
struct _lbprotocol_ AuLittleBootProtocol
struct _KERNEL_BOOT_INFO_ KERNEL_BOOT_INFO
AU_EXTERN AU_EXPORT KERNEL_BOOT_INFO * AuGetBootInfoStruc()
AuGetBootInfoStruc – return kernel boot information.
Definition init.c:161
#define AU_EXPORT
Definition aurora.h:41
uint32_t CapRights
Definition aurora.h:58
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
COMPILER_DEPENDENT_UINT64 uint64_t
Definition acefiex.h:165
unsigned short int uint16_t
Definition acefiex.h:162
Definition aurora.h:116
uint16_t pixels_per_line
Definition aurora.h:150
uint8_t * driver_entry6
ATA.
Definition aurora.h:178
int boot_type
Definition aurora.h:118
void * allocated_stack
Definition aurora.h:120
uint32_t redmask
Definition aurora.h:153
void * acpi_table_pointer
Definition aurora.h:159
uint32_t greenmask
Definition aurora.h:154
size_t fb_size
Definition aurora.h:141
uint8_t * driver_entry5
FLOPPY.
Definition aurora.h:177
uint64_t reserved_mem_count
Definition aurora.h:122
uint64_t descriptor_size
Definition aurora.h:128
void * apcode
USB.
Definition aurora.h:179
uint32_t * graphics_framebuffer
Definition aurora.h:138
uint32_t bluemask
Definition aurora.h:155
uint64_t physical_direct_map_size
Definition aurora.h:135
uint8_t * driver_entry2
Definition aurora.h:174
uint8_t * driver_entry4
AHCI.
Definition aurora.h:176
uint8_t * driver_entry3
NVME.
Definition aurora.h:175
uint64_t mem_map_size
Definition aurora.h:131
uint32_t cid
Definition aurora.h:182
uint16_t X_Resolution
Definition aurora.h:144
uint8_t * driver_entry1
Definition aurora.h:173
void * map
Definition aurora.h:125
uint8_t * psf_font_data
Definition aurora.h:166
uint64_t physical_direct_map_base
Definition aurora.h:134
void(* printf_gui)(const char *text,...)
Definition aurora.h:170
uint16_t Y_Resolution
Definition aurora.h:147
size_t kernel_size
Definition aurora.h:162
uint32_t resvmask
Definition aurora.h:156
uint32_t hid
Definition aurora.h:180
uint32_t uid
Definition aurora.h:181
Definition aurora.h:80
uint64_t physicalEnd
Definition aurora.h:104
uint64_t device_tree_end
Definition aurora.h:84
uint64_t initrd_end
Definition aurora.h:82
uint64_t littleBootStart
Definition aurora.h:96
uint64_t numberOfPages
Definition aurora.h:105
uint64_t device_tree_sz
Definition aurora.h:85
uint64_t initrd_start
Definition aurora.h:81
uint64_t littleBootEnd
Definition aurora.h:97
int usable_region_count
Definition aurora.h:102
uint64_t physicalStart
Definition aurora.h:103
void * usable_memory_map
Definition aurora.h:101
uint64_t device_tree_base
Definition aurora.h:83