blob: b5bc210b880e3d502d4cc67ac4cc65969b7ab66b (
plain)
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
|
#include "../vendor/limine/limine.h"
#include <cstdint>
__attribute__ ((used, section(".requests")))
static volatile LIMINE_BASE_REVISION(3);
__attribute__ ((used, section(".requests")))
static volatile limine_framebuffer_request framebuffer_request = {
.id = LIMINE_FRAMEBUFFER_REQUEST,
.revision = 0,
.response = nullptr
};
__attribute__ ((used, section(".requests_start")))
static volatile LIMINE_REQUESTS_START_MARKER;
__attribute__ ((used, section(".requests_end")))
static volatile LIMINE_REQUESTS_END_MARKER;
static void hcf (void)
{
for (;;)
{
asm ("hlt");
}
}
void init (void);
extern "C" void _launch (void);
void _launch (void)
{
if (LIMINE_BASE_REVISION_SUPPORTED == false)
{
hcf();
}
struct limine_framebuffer *fb = framebuffer_request.response->framebuffers[0];
for (std::size_t i = 0; i < (fb->width - 1) * (fb->height - 1); i += 2)
{
volatile std::uint32_t *fbptr = static_cast<std::uint32_t *>(fb->address);
fbptr[i] = 0xffffff;
}
// Global C++ constructors
init();
hcf();
}
|