feat: expose drive labels to userspace, render in Files
This commit is contained in:
@@ -122,4 +122,8 @@ namespace Montauk {
|
||||
static int Sys_DriveList(int* outDrives, int maxEntries) {
|
||||
return Fs::Vfs::VfsDriveList(outDrives, maxEntries);
|
||||
}
|
||||
|
||||
static int Sys_DriveLabel(int driveNumber, char* outLabel, int maxLen) {
|
||||
return Fs::Vfs::VfsDriveLabel(driveNumber, outLabel, maxLen);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -209,6 +209,10 @@ namespace Montauk {
|
||||
if ((int64_t)frame->arg2 < 0) return -1;
|
||||
if (!UserMemory::Range(frame->arg1, (uint64_t)frame->arg2 * sizeof(int), true)) return -1;
|
||||
return (int64_t)Sys_DriveList((int*)frame->arg1, (int)frame->arg2);
|
||||
case SYS_DRIVELABEL:
|
||||
if ((int64_t)frame->arg3 <= 0) return -1;
|
||||
if (!UserMemory::Range(frame->arg2, frame->arg3, true)) return -1;
|
||||
return (int64_t)Sys_DriveLabel((int)frame->arg1, (char*)frame->arg2, (int)frame->arg3);
|
||||
case SYS_TERMSCALE:
|
||||
return Sys_TermScale(frame->arg1, frame->arg2);
|
||||
case SYS_RESOLVE:
|
||||
|
||||
@@ -222,6 +222,9 @@ namespace Montauk {
|
||||
/* Input.hpp */
|
||||
static constexpr uint64_t SYS_INPUT_WAIT = 123;
|
||||
|
||||
/* Filesystem.hpp */
|
||||
static constexpr uint64_t SYS_DRIVELABEL = 124;
|
||||
|
||||
static constexpr uint32_t CLIPBOARD_MAX_TEXT_BYTES = 256 * 1024;
|
||||
|
||||
static constexpr uint32_t IPC_SIGNAL_READABLE = 1u << 0;
|
||||
|
||||
Reference in New Issue
Block a user