feat: added Files app USB medium detection
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
|
||||
#pragma once
|
||||
#include <Fs/Vfs.hpp>
|
||||
#include <Fs/FsProbe.hpp>
|
||||
#include <Drivers/Storage/BlockDevice.hpp>
|
||||
#include <Sched/Scheduler.hpp>
|
||||
#include <Memory/PageFrameAllocator.hpp>
|
||||
#include <Memory/HHDM.hpp>
|
||||
@@ -126,4 +128,11 @@ namespace Montauk {
|
||||
static int Sys_DriveLabel(int driveNumber, char* outLabel, int maxLen) {
|
||||
return Fs::Vfs::VfsDriveLabel(driveNumber, outLabel, maxLen);
|
||||
}
|
||||
|
||||
static int Sys_DriveKind(int driveNumber) {
|
||||
int blockDev = Fs::FsProbe::GetBlockDeviceForDrive(driveNumber);
|
||||
if (blockDev < 0) return 0;
|
||||
auto* dev = Drivers::Storage::GetBlockDevice(blockDev);
|
||||
return dev ? (int)dev->Kind : 0;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user