feat: filesystem and Files app support for >64 file entries, 64-bit sizes, async ops, GUI toolkit improvements to devexplorer app

This commit is contained in:
2026-06-07 09:33:46 +02:00
parent 6554ef7e15
commit 3d620673c0
27 changed files with 1110 additions and 293 deletions
+1 -1
View File
@@ -12,4 +12,4 @@
#pragma once
#define MONTAUK_BUILD_NUMBER 66
#define MONTAUK_BUILD_NUMBER 68
+10 -1
View File
@@ -36,15 +36,24 @@ namespace Montauk {
Ipc::CloseHandle(handle);
}
static int Sys_ReadDirAt(const char* path, const char** outNames, int maxEntries,
int startIndex);
static int Sys_ReadDir(const char* path, const char** outNames, int maxEntries) {
return Sys_ReadDirAt(path, outNames, maxEntries, 0);
}
static int Sys_ReadDirAt(const char* path, const char** outNames, int maxEntries,
int startIndex) {
char resolved[256];
if (!ResolveProcessPath(path, resolved, sizeof(resolved))) return -1;
if (startIndex < 0) return -1;
// Get entries from VFS into a kernel-local array
const char* kernelNames[256];
int max = maxEntries;
if (max > 256) max = 256;
int count = Fs::Vfs::VfsReadDir(resolved, kernelNames, max);
int count = Fs::Vfs::VfsReadDirAt(resolved, kernelNames, max, startIndex);
if (count <= 0) return count;
// Allocate a user-accessible page for string data via process heap
+13
View File
@@ -97,6 +97,19 @@ namespace Montauk {
return (int64_t)Sys_ReadDir((const char*)frame->arg1,
(const char**)frame->arg2,
(int)frame->arg3);
case SYS_READDIR_AT:
if ((int64_t)frame->arg3 < 0) return -1;
if ((int64_t)frame->arg4 < 0) return -1;
if (!UserMemory::String(frame->arg1, kMaxPathBytes)) return -1;
if (!UserMemory::Range(frame->arg2,
(uint64_t)((frame->arg3 > 256) ? 256 : frame->arg3) * sizeof(const char*),
true)) {
return -1;
}
return (int64_t)Sys_ReadDirAt((const char*)frame->arg1,
(const char**)frame->arg2,
(int)frame->arg3,
(int)frame->arg4);
case SYS_ALLOC:
return (int64_t)Sys_Alloc(frame->arg1);
case SYS_FREE:
+3
View File
@@ -255,6 +255,9 @@ namespace Montauk {
/* Power.hpp -- cross-process graceful power-off request channel */
static constexpr uint64_t SYS_POWER_REQUEST = 135;
/* Filesystem.hpp -- paginated directory read (path, names, max, startIndex) */
static constexpr uint64_t SYS_READDIR_AT = 136;
// Graceful power-off request actions (SYS_POWER_REQUEST). The desktop posts
// a pending action and exits; login.elf reads it, runs the shutdown stages,
// then issues the matching SYS_SHUTDOWN / SYS_RESET.