mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-28 15:34:33 +00:00
Update code
This commit is contained in:
parent
abb9ff0517
commit
c4798a69b1
@ -33,11 +33,12 @@ SECTIONS
|
|||||||
*(.multiboot2)
|
*(.multiboot2)
|
||||||
*(.bootstrap .bootstrap.*)
|
*(.bootstrap .bootstrap.*)
|
||||||
}
|
}
|
||||||
_bootstrap_end = .;
|
. += CONSTANT(MAXPAGESIZE);
|
||||||
|
_bootstrap_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
|
||||||
. += KERNEL_VMA;
|
. += KERNEL_VMA;
|
||||||
|
. += CONSTANT(MAXPAGESIZE);
|
||||||
_kernel_start = .;
|
_kernel_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
.text : AT(ADDR(.text) - KERNEL_VMA)
|
.text : AT(ADDR(.text) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
*(.text .text.*)
|
*(.text .text.*)
|
||||||
|
@ -33,11 +33,12 @@ SECTIONS
|
|||||||
*(.multiboot2)
|
*(.multiboot2)
|
||||||
*(.bootstrap .bootstrap.*)
|
*(.bootstrap .bootstrap.*)
|
||||||
}
|
}
|
||||||
_bootstrap_end = .;
|
. += CONSTANT(MAXPAGESIZE);
|
||||||
|
_bootstrap_end = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
|
|
||||||
. += KERNEL_VMA;
|
. += KERNEL_VMA;
|
||||||
|
. += CONSTANT(MAXPAGESIZE);
|
||||||
_kernel_start = .;
|
_kernel_start = ALIGN(CONSTANT(MAXPAGESIZE));
|
||||||
.text : AT(ADDR(.text) - KERNEL_VMA)
|
.text : AT(ADDR(.text) - KERNEL_VMA)
|
||||||
{
|
{
|
||||||
*(.text .text.*)
|
*(.text .text.*)
|
||||||
|
@ -24,6 +24,8 @@
|
|||||||
|
|
||||||
#include "../../kernel.h"
|
#include "../../kernel.h"
|
||||||
|
|
||||||
|
extern "C" char BootPageTable[]; // 0x10000 in length
|
||||||
|
|
||||||
namespace Memory
|
namespace Memory
|
||||||
{
|
{
|
||||||
uint64_t Physical::GetTotalMemory()
|
uint64_t Physical::GetTotalMemory()
|
||||||
@ -450,7 +452,7 @@ namespace Memory
|
|||||||
|
|
||||||
for (uint64_t i = 0; i < Info->Memory.Entries; i++)
|
for (uint64_t i = 0; i < Info->Memory.Entries; i++)
|
||||||
{
|
{
|
||||||
if (Info->Memory.Entry[i].Type == Usable)
|
if (Info->Memory.Entry[i].Type == Usable && Info->Memory.Entry[i].BaseAddress != 0x0)
|
||||||
this->UnreservePages(Info->Memory.Entry[i].BaseAddress, TO_PAGES(Info->Memory.Entry[i].Length));
|
this->UnreservePages(Info->Memory.Entry[i].BaseAddress, TO_PAGES(Info->Memory.Entry[i].Length));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,6 +462,10 @@ namespace Memory
|
|||||||
|
|
||||||
debug("Reserving bitmap pages...");
|
debug("Reserving bitmap pages...");
|
||||||
this->ReservePages(PageBitmap.Buffer, TO_PAGES(PageBitmap.Size));
|
this->ReservePages(PageBitmap.Buffer, TO_PAGES(PageBitmap.Size));
|
||||||
|
debug("Reserving kernel...");
|
||||||
|
this->ReservePages(BootPageTable, TO_PAGES(0x10000));
|
||||||
|
this->ReservePages(&_bootstrap_start, TO_PAGES((uintptr_t)&_bootstrap_end - (uintptr_t)&_bootstrap_start));
|
||||||
|
this->ReservePages(&_kernel_start, TO_PAGES((uintptr_t)&_kernel_end - (uintptr_t)&_kernel_start));
|
||||||
}
|
}
|
||||||
|
|
||||||
Physical::Physical() {}
|
Physical::Physical() {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user