1+ #ifndef APOLLO_CONFIG_H
2+ #define APOLLO_CONFIG_H
3+
4+ #define APOLLO_VERSION_MAJOR 1
5+ #define APOLLO_VERSION_MINOR 0
6+ #define APOLLO_VERSION_PATCH 0
7+ #define APOLLO_VERSION_STRING "1.0.0"
8+
9+ #define APOLLO_ARCH_X86_64 1
10+ #define APOLLO_ARCH_STRING "x86_64"
11+
12+ #define APOLLO_PAGE_SIZE 4096
13+ #define APOLLO_KERNEL_HEAP_SIZE (16 * 1024 * 1024) // 16MB
14+ #define APOLLO_KERNEL_STACK_SIZE (64 * 1024) // 64KB
15+ #define APOLLO_MEMORY_ALIGNMENT 8
16+
17+ #define APOLLO_VGA_WIDTH 80
18+ #define APOLLO_VGA_HEIGHT 25
19+ #define APOLLO_VGA_COLORS 16
20+
21+ #define APOLLO_KEYBOARD_BUFFER_SIZE 256
22+ #define APOLLO_COMMAND_MAX_LENGTH 256
23+ #define APOLLO_COMMAND_HISTORY_SIZE 32
24+ #define APOLLO_MAX_COMMAND_ARGS 16
25+
26+ #define APOLLO_MULTIBOOT2_MAGIC 0xe85250d6
27+ #define APOLLO_KERNEL_LOAD_ADDRESS 0x100000 // 1MB
28+
29+ #ifdef DEBUG
30+ #define APOLLO_DEBUG_ENABLED 1
31+ #define APOLLO_SERIAL_DEBUG 1
32+ #else
33+ #define APOLLO_DEBUG_ENABLED 0
34+ #define APOLLO_SERIAL_DEBUG 0
35+ #endif
36+
37+ #define APOLLO_FEATURE_MEMORY_MANAGER 1
38+ #define APOLLO_FEATURE_COMMAND_SHELL 1
39+ #define APOLLO_FEATURE_VGA_GRAPHICS 1
40+ #define APOLLO_FEATURE_PS2_KEYBOARD 1
41+ #define APOLLO_FEATURE_RTC_CLOCK 1
42+
43+ #define APOLLO_COMPILER_NAME "GCC"
44+ #define APOLLO_BUILD_DATE __DATE__
45+ #define APOLLO_BUILD_TIME __TIME__
46+
47+ #define APOLLO_MAX_FILENAME_LENGTH 255
48+ #define APOLLO_MAX_PATH_LENGTH 1024
49+ #define APOLLO_MAX_PROCESSES 32
50+ #define APOLLO_MAX_THREADS 128
51+
52+ #define APOLLO_ASSERT_ENABLED 1
53+ #define APOLLO_ERROR_CHECKING 1
54+
55+ #define APOLLO_CPU_VENDOR_INTEL 0x756e6547 // "Genu"
56+ #define APOLLO_CPU_VENDOR_AMD 0x68747541 // "Auth"
57+
58+ #define APOLLO_TIMER_FREQUENCY 1000 // 1000 Hz
59+ #define APOLLO_SCHEDULER_QUANTUM 10 // 10ms
60+
61+ #define APOLLO_VGA_CTRL_PORT 0x3D4
62+ #define APOLLO_VGA_DATA_PORT 0x3D5
63+ #define APOLLO_KB_DATA_PORT 0x60
64+ #define APOLLO_KB_STATUS_PORT 0x64
65+ #define APOLLO_CMOS_ADDRESS_PORT 0x70
66+ #define APOLLO_CMOS_DATA_PORT 0x71
67+
68+ #define APOLLO_HEAP_MAGIC 0xDEADBEEF
69+ #define APOLLO_STACK_MAGIC 0xCAFEBABE
70+ #define APOLLO_KERNEL_MAGIC 0x41504F4C // "APOL"
71+
72+ #define APOLLO_DEFAULT_FG_COLOR 7 // Light gray
73+ #define APOLLO_DEFAULT_BG_COLOR 0 // Black
74+ #define APOLLO_LOGO_COLOR 14 // Yellow
75+ #define APOLLO_ACCENT_COLOR 3 // Orange
76+
77+ #define APOLLO_KB (x ) ((x) * 1024)
78+ #define APOLLO_MB (x ) ((x) * 1024 * 1024)
79+ #define APOLLO_GB (x ) ((x) * 1024ULL * 1024 * 1024)
80+
81+ #define APOLLO_STRINGIFY (x ) #x
82+ #define APOLLO_TOSTRING (x ) APOLLO_STRINGIFY(x)
83+
84+ #if APOLLO_DEBUG_ENABLED
85+ #define APOLLO_DEBUG_PRINT (fmt , ...) debug_printf(fmt, ##__VA_ARGS__)
86+ #else
87+ #define APOLLO_DEBUG_PRINT (fmt , ...) do {} while(0)
88+ #endif
89+
90+ #define APOLLO_STATIC_ASSERT (cond , msg ) \
91+ typedef char apollo_static_assert_##msg[(cond) ? 1 : -1]
92+
93+ APOLLO_STATIC_ASSERT (APOLLO_PAGE_SIZE == 4096 , page_size_must_be_4k );
94+ APOLLO_STATIC_ASSERT (APOLLO_MEMORY_ALIGNMENT >= 8 , alignment_must_be_at_least_8 );
95+ APOLLO_STATIC_ASSERT (APOLLO_KEYBOARD_BUFFER_SIZE > 0 , keyboard_buffer_must_be_positive );
96+
97+ #endif
0 commit comments