mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-17 08:37:17 -04:00
Prepare some space for early transfer
This commit is contained in:
parent
4c87d6386a
commit
e2272caf4e
21
kernel/include/early_memory.hpp
Normal file
21
kernel/include/early_memory.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
//=======================================================================
|
||||
// Copyright Baptiste Wicht 2013-2016.
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//=======================================================================
|
||||
|
||||
/*
|
||||
* This header contains addresses where the init stage of the kernel writes information for the later stage
|
||||
*/
|
||||
|
||||
#ifndef EARLY_MEMORY_H
|
||||
#define EARLY_MEMORY_H
|
||||
|
||||
// The number of MiB used by the kernel
|
||||
constexpr const uint32_t kernel_mib = 0x90000; //4 bytes (32 bits)
|
||||
|
||||
// The address of the kernel
|
||||
constexpr const uint32_t kernel_address = 0x100000; //1Mib aligned size (kernel_mib)
|
||||
|
||||
#endif
|
@ -11,6 +11,7 @@
|
||||
#include "kernel.hpp"
|
||||
#include "paging.hpp"
|
||||
#include "early_logging.hpp"
|
||||
#include "early_memory.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -136,6 +137,9 @@ void pm_main(){
|
||||
//Setup paging
|
||||
setup_paging();
|
||||
|
||||
// TODO This will need to be computed from the init loader
|
||||
*reinterpret_cast<uint32_t*>(kernel_mib) = 1;
|
||||
|
||||
//Enable long mode by setting the EFER.LME flag
|
||||
enable_long_mode();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user