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)
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
110#define BOOT_UEFI_x64 1
111#define BOOT_UEFI_ARM64 2
112#define BOOT_LITTLEBOOT_ARM64 3
117typedef struct _KERNEL_BOOT_INFO_ {
118 /* Boot type either UEFI_BOOT or BIOS_BOOT */
120
122
124
125 /* map -- UEFI memory map */
126 void *map;
127
128 /* descriptor_size -- UEFI memory map descriptor size */
130
131 /* mem_map_size -- UEFI memory map size */
133
134 /* graphics_framebuffer -- framebuffer address passed by XNLDR */
136
137 /* fb_size -- framebuffer total size */
138 size_t fb_size;
139
140 /* X_Resolution -- Total width of the entire display */
142
143 /* Y_Resolution -- Total height of the entire display */
145
146 /* pixels_per_line -- scanline of the current display */
148
149 /* redmask, greenmask, bluemask, resvmask -- color mask */
154
155 /* acpi_table_pointer -- acpi base memory map */
157
158 /* kernel_size -- total kernel image size */
160
161 /* psf_font_data -- screen font address loaded
162 by XNLDR to use for debugging purpose */
164
165 /* printf_gui -- character printing function pointer to use
166 for debugging purpose provided by XNLDR */
167 void(*printf_gui) (const char* text, ...);
168
169 /* unused pointer entries */
176 void* apcode;
181
182/*
183 * AuGetBootInfoStruc -- return kernel boot information
184 */
186
187#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:164
#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:117
uint16_t pixels_per_line
Definition aurora.h:147
uint8_t * driver_entry6
ATA.
Definition aurora.h:175
int boot_type
Definition aurora.h:119
void * allocated_stack
Definition aurora.h:121
uint32_t redmask
Definition aurora.h:150
void * acpi_table_pointer
Definition aurora.h:156
uint32_t greenmask
Definition aurora.h:151
size_t fb_size
Definition aurora.h:138
uint8_t * driver_entry5
FLOPPY.
Definition aurora.h:174
uint64_t reserved_mem_count
Definition aurora.h:123
uint64_t descriptor_size
Definition aurora.h:129
void * apcode
USB.
Definition aurora.h:176
uint32_t * graphics_framebuffer
Definition aurora.h:135
uint32_t bluemask
Definition aurora.h:152
uint8_t * driver_entry2
Definition aurora.h:171
uint8_t * driver_entry4
AHCI.
Definition aurora.h:173
uint8_t * driver_entry3
NVME.
Definition aurora.h:172
uint64_t mem_map_size
Definition aurora.h:132
uint32_t cid
Definition aurora.h:179
uint16_t X_Resolution
Definition aurora.h:141
uint8_t * driver_entry1
Definition aurora.h:170
void * map
Definition aurora.h:126
uint8_t * psf_font_data
Definition aurora.h:163
void(* printf_gui)(const char *text,...)
Definition aurora.h:167
uint16_t Y_Resolution
Definition aurora.h:144
size_t kernel_size
Definition aurora.h:159
uint32_t resvmask
Definition aurora.h:153
uint32_t hid
Definition aurora.h:177
uint32_t uid
Definition aurora.h:178
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