1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:57:45 +00:00

Kernel: Make the kernel compile & link for x86_64

It's now possible to build the whole kernel with an x86_64 toolchain.
There's no bootstrap code so it doesn't work yet (obviously.)
This commit is contained in:
Andreas Kling 2021-03-04 17:50:05 +01:00
parent aae91dda66
commit adb2e6be5f
15 changed files with 316 additions and 48 deletions

View file

@ -75,7 +75,7 @@ RefPtr<AnonymousVMObject> AnonymousVMObject::create_with_size(size_t size, Alloc
{
if (commit == AllocationStrategy::Reserve || commit == AllocationStrategy::AllocateNow) {
// We need to attempt to commit before actually creating the object
if (!MM.commit_user_physical_pages(ceil_div(size, PAGE_SIZE)))
if (!MM.commit_user_physical_pages(ceil_div(size, static_cast<size_t>(PAGE_SIZE))))
return {};
}
return adopt(*new AnonymousVMObject(size, commit));

View file

@ -699,7 +699,7 @@ NonnullRefPtrVector<PhysicalPage> MemoryManager::allocate_contiguous_supervisor_
{
VERIFY(!(size % PAGE_SIZE));
ScopedSpinLock lock(s_mm_lock);
size_t count = ceil_div(size, PAGE_SIZE);
size_t count = ceil_div(size, static_cast<size_t>(PAGE_SIZE));
NonnullRefPtrVector<PhysicalPage> physical_pages;
for (auto& region : m_super_physical_regions) {

View file

@ -57,12 +57,12 @@ constexpr FlatPtr page_round_down(FlatPtr x)
return ((FlatPtr)(x)) & ~(PAGE_SIZE - 1);
}
inline u32 low_physical_to_virtual(u32 physical)
inline FlatPtr low_physical_to_virtual(FlatPtr physical)
{
return physical + 0xc0000000;
}
inline u32 virtual_to_low_physical(u32 physical)
inline FlatPtr virtual_to_low_physical(FlatPtr physical)
{
return physical - 0xc0000000;
}

View file

@ -37,7 +37,7 @@ VMObject::VMObject(const VMObject& other)
VMObject::VMObject(size_t size)
{
m_physical_pages.resize(ceil_div(size, PAGE_SIZE));
m_physical_pages.resize(ceil_div(size, static_cast<size_t>(PAGE_SIZE)));
MM.register_vmobject(*this);
}