forked from includeos/IncludeOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiboot.cpp
More file actions
42 lines (37 loc) · 908 Bytes
/
multiboot.cpp
File metadata and controls
42 lines (37 loc) · 908 Bytes
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
#include <cstdint>
#include <boot/multiboot.h>
// Let the linker provide as much info as possible
extern uintptr_t _MULTIBOOT_START_;
extern uintptr_t _LOAD_START_;
extern uintptr_t _LOAD_END_;
extern uintptr_t _BSS_END_;
extern uintptr_t _TEXT_START_;
extern uintptr_t _start;
#define MULTIBOOT_HEADER_FLAGS MULTIBOOT_MEMORY_INFO
extern "C" volatile const multiboot_header __multiboot__ {
// magic
MULTIBOOT_HEADER_MAGIC,
// flags
MULTIBOOT_HEADER_FLAGS,
// checksum
(uint32_t) 0 - (MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS),
// header_addr
(uint32_t)&_MULTIBOOT_START_,
// load_addr
(uint32_t)&_LOAD_START_,
// load_end_addr
(uint32_t)&_LOAD_END_,
// bss_end_addr
(uint32_t)&_BSS_END_,
// entry_addr
(uint32_t)&_start,
// Video mode
// mode_type
0, // Unused
// width
100, // Unused
// height
50, // Unused
// depth
1
};