blob: 4afa6d2c4660b7d262fd95b594ab156feabb529a (
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
|
#include <serial.h>
#include <cpuid.h>
#include <lib.h>
#include <shim.h>
#include <memory.h>
#include "paging.h"
#include "mboot.h"
static struct boot_info boot_info;
// entry point for amd64
void* amd64_shim(void *mboot_data_ptr) {
serial_init();
paging_init();
kmap_page(mboot_data_ptr, mboot_data_ptr, F_WRITEABLE);
struct mboot_info mboot_info;
mboot_info = mboot_load_info(mboot_data_ptr);
struct mboot_tag *map_tag;
map_tag = mboot_get_tag(&mboot_info, MBOOT_MEMORYMAP);
boot_info.map = map_tag->data.memory_map;
return &boot_info;
}
|