feat: ext2 filesystem, installer updates, add update feature, and more
This commit is contained in:
@@ -115,7 +115,11 @@ namespace Sched {
|
||||
uint64_t virtAddr = segBase + p * 0x1000;
|
||||
|
||||
// Map into the process's PML4 with User bit set
|
||||
Memory::VMM::Paging::MapUserIn(pml4Phys, physAddr, virtAddr);
|
||||
if (!Memory::VMM::Paging::MapUserIn(pml4Phys, physAddr, virtAddr)) {
|
||||
Kt::KernelLogStream(Kt::ERROR, "ELF") << "Failed to map page";
|
||||
Memory::g_heap->Free(fileData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Copy file data that overlaps this page (via HHDM)
|
||||
uint64_t pageStart = virtAddr;
|
||||
|
||||
@@ -149,7 +149,10 @@ namespace Sched {
|
||||
return -1;
|
||||
}
|
||||
uint64_t physAddr = Memory::SubHHDM((uint64_t)page);
|
||||
Memory::VMM::Paging::MapUserIn(pml4Phys, physAddr, userStackBase + i * 0x1000);
|
||||
if (!Memory::VMM::Paging::MapUserIn(pml4Phys, physAddr, userStackBase + i * 0x1000)) {
|
||||
Kt::KernelLogStream(Kt::ERROR, "Sched") << "Failed to map user stack page";
|
||||
return -1;
|
||||
}
|
||||
if (i == UserStackPages - 1) topStackPagePhys = physAddr;
|
||||
}
|
||||
|
||||
@@ -162,7 +165,10 @@ namespace Sched {
|
||||
return -1;
|
||||
}
|
||||
uint64_t stubPhys = Memory::SubHHDM((uint64_t)stubPage);
|
||||
Memory::VMM::Paging::MapUserIn(pml4Phys, stubPhys, ExitStubAddr);
|
||||
if (!Memory::VMM::Paging::MapUserIn(pml4Phys, stubPhys, ExitStubAddr)) {
|
||||
Kt::KernelLogStream(Kt::ERROR, "Sched") << "Failed to map exit stub";
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Write: xor edi, edi; xor eax, eax; syscall
|
||||
uint8_t* stub = (uint8_t*)stubPage;
|
||||
|
||||
Reference in New Issue
Block a user