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#ifdef __GNUC__
36#define AU_EXPORT __attribute__((visibility("default")))
37#define AU_IMPORT
38#define AU_ALIGN(x) __attribute__((aligned(x)))
39#else
40#define AU_EXPORT __declspec(dllexport) __attribute__((__noinline__))
41#define AU_IMPORT __declspec(dllimport)
42#define AU_ALIGN(x) __declspec(align(x))
43#endif
44
45#ifdef __AU_KERNEL__
46#define AU_FUNC AU_EXPORT
47#else
48#define AU_FUNC AU_IMPORT
49#endif
50
51#ifdef __cplusplus
52#define AU_EXTERN extern "C"
53#else
54#define AU_EXTERN extern
55#endif
56
58
59#ifdef ARCH_X64
60#define KERNEL_STACK_LOCATION 0xFFFFFB0000000000
61#elif ARCH_ARM64
62#define KERNEL_STACK_LOCATION 0xFFFFB00000000000 //0x0000000B00000000
63#endif
64
65#define KERNEL_STACK_SIZE 40960 //16384 //16KiB
66
67// macro for llvm compatibility
68#ifndef ALIGNED
69#if defined(_MSC_VER)
70#define ALIGNED(x) __declspec(align(x))
71#elif defined(__GNUC__) || defined(__clang__)
72#define ALIGNED(x) __attribute__((aligned(x)))
73#else
74#define ALIGNED(x)
75#endif
76#endif
77
83#define XENEVA_OS_NAME "XenevaOS"
84
85//using hardcoded value
86#define XENEVA_OS_NODENAME "jajabor-xeneva"
87
88#define XENEVA_KERNEL_NAME "Aurora_Bordoisila"
89
90/* each architectural release may
91 * be in different version/release
92 */
93#ifdef ARCH_X64
94#define XENEVA_KERNEL_VERSION "1.0.0"
95#define XENEVA_KERNEL_RELEASE "1.0.0"
96#define XENEVA_KERNEL_BUILD "x86_64"
97#define XENEVA_KERNEL_BUILD_TAG "jajabor"
99#define XENEVA_KERNEL_ARCH "x86_64"
100#define XENEVA_KERNEL_MACHINE
101
102#elif ARCH_ARM64
103#define XENEVA_KERNEL_VERSION "1.0.0"
104#define XENEVA_KERNEL_RELEASE "1.0.0"
106#define XENEVA_KERNEL_ARCH "arm64"
107#define XENEVA_KERNEL_BUILD "arm64"
108#define XENEVA_KERNEL_BUILD_TAG "jajabor"
109
111#ifdef __TARGET_BOARD_QEMU_VIRT__
112#define XENEVA_KERNEL_MACHINE "aarch64-qemu-virt"
113#elif __TARGET_BOARD_RPI3__
114#define XENEVA_KERNEL_MACHINE "aarch64_rpi3"
115#endif
116
117#elif ARCH_RISCV64
118#define XENEVA_KERNEL_VERSION "1.0.0"
119#define XENEVA_KERNEL_RELEASE "1.0.0"
121#define XENEVA_KERNEL_ARCH "riscv64"
122#define XENEVA_KERNEL_BUILD "riscv64"
123#define XENEVA_KERNEL_BUILD_TAG "jajabor"
124#define XENEVA_KERNEL_MACHINE
125#endif
126
128#define XENEVA_KERNEL_SMP 0
129#define XENEVA_KERNEL_PREEMPT 1
130
131typedef struct _lbprotocol_ {
137 /* we should take care of
138 * little boot binary occupied
139 * memory area also, becasuse
140 * upto the main kernel becomes
141 * standalone, we can't neglect
142 * little boot code. because memory
143 * map data structure, and paging
144 * data structures are statically
145 * allocated within this region
146 */
149
150 /* usable memory map describes
151 * usable memory areas*/
158
159#define BOOT_UEFI_x64 1
160#define BOOT_UEFI_ARM64 2
161#define BOOT_LITTLEBOOT_ARM64 3
166typedef struct _KERNEL_BOOT_INFO_ {
167 /* Boot type either UEFI_BOOT or BIOS_BOOT */
169
171
173
174 /* map -- UEFI memory map */
175 void* map;
176
177 /* descriptor_size -- UEFI memory map descriptor size */
179
180 /* mem_map_size -- UEFI memory map size */
182
183 /* Install the physical direct map here from the loader itself --axiss */
186
187 /* graphics_framebuffer -- framebuffer address passed by XNLDR */
189
190 /* fb_size -- framebuffer total size */
191 size_t fb_size;
192
193 /* X_Resolution -- Total width of the entire display */
195
196 /* Y_Resolution -- Total height of the entire display */
198
199 /* pixels_per_line -- scanline of the current display */
201
202 /* redmask, greenmask, bluemask, resvmask -- color mask */
207
208 /* acpi_table_pointer -- acpi base memory map */
210
211 /* kernel_size -- total kernel image size */
213
214 /* psf_font_data -- screen font address loaded
215 by XNLDR to use for debugging purpose */
217
218 /* printf_gui -- character printing function pointer to use
219 for debugging purpose provided by XNLDR */
220 void (*printf_gui)(const char* text, ...);
221
222 /* unused pointer entries */
229 void* apcode;
233
234 /* DesktopOverrideWidth/Height -- requested desktop (virtio-gpu scanout)
235 * size chosen in the loader menu, independent of the firmware GOP mode.
236 * 0 means none: drivers fall back to X_Resolution/Y_Resolution. The
237 * firmware framebuffer geometry above always describes the real GOP
238 * surface, so the early console never runs off it. --axiss */
242
243/*
244 * AuGetBootInfoStruc -- return kernel boot information
245 */
247
248#endif
struct _KERNEL_BOOT_INFO_ * PKERNEL_BOOT_INFO
#define AU_EXTERN
Definition aurora.h:54
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:166
#define AU_EXPORT
Definition aurora.h:40
uint32_t CapRights
Definition aurora.h:57
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:166
uint16_t pixels_per_line
Definition aurora.h:200
uint8_t * driver_entry6
ATA.
Definition aurora.h:228
int boot_type
Definition aurora.h:168
void * allocated_stack
Definition aurora.h:170
uint32_t redmask
Definition aurora.h:203
void * acpi_table_pointer
Definition aurora.h:209
uint32_t greenmask
Definition aurora.h:204
size_t fb_size
Definition aurora.h:191
uint8_t * driver_entry5
FLOPPY.
Definition aurora.h:227
uint64_t reserved_mem_count
Definition aurora.h:172
uint64_t descriptor_size
Definition aurora.h:178
void * apcode
USB.
Definition aurora.h:229
uint32_t * graphics_framebuffer
Definition aurora.h:188
uint32_t bluemask
Definition aurora.h:205
uint64_t physical_direct_map_size
Definition aurora.h:185
uint8_t * driver_entry2
Definition aurora.h:224
uint8_t * driver_entry4
AHCI.
Definition aurora.h:226
uint8_t * driver_entry3
NVME.
Definition aurora.h:225
uint16_t DesktopOverrideWidth
Definition aurora.h:239
uint64_t mem_map_size
Definition aurora.h:181
uint32_t cid
Definition aurora.h:232
uint16_t X_Resolution
Definition aurora.h:194
uint8_t * driver_entry1
Definition aurora.h:223
void * map
Definition aurora.h:175
uint16_t DesktopOverrideHeight
Definition aurora.h:240
uint8_t * psf_font_data
Definition aurora.h:216
uint64_t physical_direct_map_base
Definition aurora.h:184
void(* printf_gui)(const char *text,...)
Definition aurora.h:220
uint16_t Y_Resolution
Definition aurora.h:197
size_t kernel_size
Definition aurora.h:212
uint32_t resvmask
Definition aurora.h:206
uint32_t hid
Definition aurora.h:230
uint32_t uid
Definition aurora.h:231
Definition aurora.h:131
uint64_t physicalEnd
Definition aurora.h:155
uint64_t device_tree_end
Definition aurora.h:135
uint64_t initrd_end
Definition aurora.h:133
uint64_t littleBootStart
Definition aurora.h:147
uint64_t numberOfPages
Definition aurora.h:156
uint64_t device_tree_sz
Definition aurora.h:136
uint64_t initrd_start
Definition aurora.h:132
uint64_t littleBootEnd
Definition aurora.h:148
int usable_region_count
Definition aurora.h:153
uint64_t physicalStart
Definition aurora.h:154
void * usable_memory_map
Definition aurora.h:152
uint64_t device_tree_base
Definition aurora.h:134