2017-11-04 11:45:48 +00:00
|
|
|
#include "console.h"
|
2017-11-08 04:54:47 +00:00
|
|
|
#include "panic.h"
|
2017-11-08 05:10:09 +00:00
|
|
|
#include "pfa.h"
|
2017-11-04 02:32:23 +00:00
|
|
|
#include "protected.h"
|
2017-11-04 15:08:59 +00:00
|
|
|
#include "paging.h"
|
2017-11-04 02:32:23 +00:00
|
|
|
|
2017-11-04 10:38:28 +00:00
|
|
|
#include <kernelmq/info.h>
|
|
|
|
#include <kernelmq/stdlib.h>
|
2017-11-05 10:57:23 +00:00
|
|
|
#include <kernelmq/module.h>
|
2017-11-04 10:38:28 +00:00
|
|
|
|
|
|
|
static struct KernelMQ_Info kinfo;
|
|
|
|
|
|
|
|
void main(const struct KernelMQ_Info *const kinfo_ptr)
|
2017-11-04 02:32:23 +00:00
|
|
|
{
|
2017-11-04 11:45:48 +00:00
|
|
|
console_initialize();
|
|
|
|
|
2017-11-04 10:38:28 +00:00
|
|
|
kmemset(&kinfo, 0, sizeof(struct KernelMQ_Info));
|
|
|
|
|
2017-11-08 04:54:47 +00:00
|
|
|
assert(kernelmq_info_validate_and_copy(&kinfo, kinfo_ptr), "Invalid kernel information.");
|
2017-11-04 10:38:28 +00:00
|
|
|
|
2017-11-08 05:10:09 +00:00
|
|
|
pfa_initialize(&kinfo);
|
2017-11-05 07:13:54 +00:00
|
|
|
|
2017-11-05 15:26:30 +00:00
|
|
|
protected_initialize(&kinfo);
|
2017-11-04 02:32:23 +00:00
|
|
|
|
2017-11-04 15:08:59 +00:00
|
|
|
// Set up a new post-relocate bootstrap pagetable so that
|
|
|
|
// we can map in VM, and we no longer rely on pre-relocated
|
|
|
|
// data.
|
|
|
|
paging_clear();
|
2017-11-05 05:56:53 +00:00
|
|
|
paging_identity(); // Still need 1:1 for lapic and video mem and such.
|
2017-11-04 15:08:59 +00:00
|
|
|
paging_mapkernel(&kinfo);
|
|
|
|
paging_load();
|
2017-11-04 02:32:23 +00:00
|
|
|
}
|