feat: ext2 filesystem, installer updates, add update feature, and more
This commit is contained in:
@@ -32,9 +32,9 @@ namespace Montauk {
|
||||
|
||||
static int Sys_ReadDir(const char* path, const char** outNames, int maxEntries) {
|
||||
// Get entries from VFS into a kernel-local array
|
||||
const char* kernelNames[64];
|
||||
const char* kernelNames[256];
|
||||
int max = maxEntries;
|
||||
if (max > 64) max = 64;
|
||||
if (max > 256) max = 256;
|
||||
int count = Fs::Vfs::VfsReadDir(path, kernelNames, max);
|
||||
if (count <= 0) return count;
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Montauk {
|
||||
uint64_t physAddr = Memory::SubHHDM((uint64_t)page);
|
||||
uint64_t userVa = proc->heapNext;
|
||||
proc->heapNext += 0x1000;
|
||||
Memory::VMM::Paging::MapUserIn(proc->pml4Phys, physAddr, userVa);
|
||||
if (!Memory::VMM::Paging::MapUserIn(proc->pml4Phys, physAddr, userVa)) return -1;
|
||||
|
||||
// Copy strings into the user page and write pointers to outNames
|
||||
uint64_t offset = 0;
|
||||
|
||||
@@ -50,11 +50,13 @@ namespace Montauk {
|
||||
constexpr uint64_t userVa = 0x50000000ULL;
|
||||
|
||||
for (uint64_t i = 0; i < numPages; i++) {
|
||||
Memory::VMM::Paging::MapUserInWC(
|
||||
if (!Memory::VMM::Paging::MapUserInWC(
|
||||
proc->pml4Phys,
|
||||
fbPhys + i * 0x1000,
|
||||
userVa + i * 0x1000
|
||||
);
|
||||
)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return userVa;
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Montauk {
|
||||
void* page = Memory::g_pfa->AllocateZeroed();
|
||||
if (page == nullptr) return 0;
|
||||
uint64_t physAddr = Memory::SubHHDM((uint64_t)page);
|
||||
Memory::VMM::Paging::MapUserIn(proc->pml4Phys, physAddr, userVa + i * 0x1000);
|
||||
if (!Memory::VMM::Paging::MapUserIn(proc->pml4Phys, physAddr, userVa + i * 0x1000)) return 0;
|
||||
}
|
||||
|
||||
proc->heapNext += size;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include <Drivers/Storage/Gpt.hpp>
|
||||
#include <Fs/FsProbe.hpp>
|
||||
#include <Fs/Fat32.hpp>
|
||||
#include <Fs/Ext2.hpp>
|
||||
|
||||
#include "Syscall.hpp"
|
||||
|
||||
@@ -115,6 +116,10 @@ namespace Montauk {
|
||||
return (int64_t)Fs::Fat32::Format(
|
||||
part->BlockDevIndex, part->StartLba, part->SectorCount,
|
||||
params->label[0] ? params->label : nullptr);
|
||||
case FS_TYPE_EXT2:
|
||||
return (int64_t)Fs::Ext2::Format(
|
||||
part->BlockDevIndex, part->StartLba, part->SectorCount,
|
||||
params->label[0] ? params->label : nullptr);
|
||||
default:
|
||||
return -1; // unknown filesystem type
|
||||
}
|
||||
|
||||
@@ -297,6 +297,7 @@ namespace Montauk {
|
||||
|
||||
// Filesystem type IDs for SYS_FSFORMAT
|
||||
static constexpr int FS_TYPE_FAT32 = 1;
|
||||
static constexpr int FS_TYPE_EXT2 = 2;
|
||||
|
||||
struct FsFormatParams {
|
||||
int32_t partIndex; // global partition index
|
||||
|
||||
@@ -23,6 +23,8 @@ namespace Montauk {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Don't draw over the framebuffer once the GUI is active
|
||||
if (Kt::g_suppressKernelLog) return;
|
||||
Kt::Print(text);
|
||||
}
|
||||
|
||||
@@ -35,6 +37,8 @@ namespace Montauk {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Don't draw over the framebuffer once the GUI is active
|
||||
if (Kt::g_suppressKernelLog) return;
|
||||
Kt::Putchar(c);
|
||||
}
|
||||
};
|
||||
@@ -67,7 +67,10 @@ namespace WinServer {
|
||||
}
|
||||
uint64_t physAddr = Memory::SubHHDM((uint64_t)page);
|
||||
slot.pixelPhysPages[i] = physAddr;
|
||||
Memory::VMM::Paging::MapUserIn(ownerPml4, physAddr, userVa + (uint64_t)i * 0x1000);
|
||||
if (!Memory::VMM::Paging::MapUserIn(ownerPml4, physAddr, userVa + (uint64_t)i * 0x1000)) {
|
||||
slot.used = false;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
slot.ownerVa = userVa;
|
||||
@@ -173,8 +176,10 @@ namespace WinServer {
|
||||
uint64_t userVa = heapNext;
|
||||
|
||||
for (int i = 0; i < slot.pixelNumPages; i++) {
|
||||
Memory::VMM::Paging::MapUserIn(callerPml4, slot.pixelPhysPages[i],
|
||||
userVa + (uint64_t)i * 0x1000);
|
||||
if (!Memory::VMM::Paging::MapUserIn(callerPml4, slot.pixelPhysPages[i],
|
||||
userVa + (uint64_t)i * 0x1000)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
slot.desktopVa = userVa;
|
||||
@@ -230,7 +235,9 @@ namespace WinServer {
|
||||
if (page == nullptr) return -1;
|
||||
uint64_t physAddr = Memory::SubHHDM((uint64_t)page);
|
||||
slot.pixelPhysPages[i] = physAddr;
|
||||
Memory::VMM::Paging::MapUserIn(ownerPml4, physAddr, userVa + (uint64_t)i * 0x1000);
|
||||
if (!Memory::VMM::Paging::MapUserIn(ownerPml4, physAddr, userVa + (uint64_t)i * 0x1000)) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
slot.width = newW;
|
||||
|
||||
Reference in New Issue
Block a user