-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkmain.cpp
More file actions
executable file
·66 lines (47 loc) · 1.26 KB
/
kmain.cpp
File metadata and controls
executable file
·66 lines (47 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
////////////////////////////////////////////////////////////////
//
// Boot low-level main setup function
//
// File: boot.cpp
// Date: 21 Mar 2023
//
// Copyright (c) 2017 - 2022, Igor Baklykov
// All rights reserved.
//
//
// IgrOS-Kernel arch
#include <arch/cpu.hpp>
// IgrOS-Kernel multiboot
#include <multiboot/multiboot.hpp>
// IgrOS-Kernel platform
#include <platform/platform.hpp>
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// Kernel main function
[[noreturn]]
void kmain(const igros::multiboot::info_t* const multiboot, const igros::igros_dword_t magic) noexcept {
// Initialize platform
igros::platform::Platform::current().initialize();
// Write Multiboot magic error message message
igros::klib::kprintf("IgrOS kernel");
// Test multiboot (Hang on error)
multiboot->test(magic);
// Print kernel header
multiboot->printHeader();
// Show multiboot flags
multiboot->printFlags();
// Show VBE info
multiboot->printVBEInfo();
// Show framebuffer info
multiboot->printFBInfo();
// Show memory map
multiboot->printMemMap();
// Write "Booted successfully" message
igros::klib::kprintf("Booted successfully");
// Halt CPU
igros::arch::cpu::get().halt();
}
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus