diff --git a/source/Cosmos.System2/FileSystem/CosmosVFS.cs b/source/Cosmos.System2/FileSystem/CosmosVFS.cs index 534c493f5..1d062af11 100644 --- a/source/Cosmos.System2/FileSystem/CosmosVFS.cs +++ b/source/Cosmos.System2/FileSystem/CosmosVFS.cs @@ -355,10 +355,11 @@ namespace Cosmos.System.FileSystem for (int i = 0; i < mPartitions.Count; i++) { string xRootPath = string.Concat(i, VolumeSeparatorChar, DirectorySeparatorChar); + var xSize = (long)(mPartitions[i].BlockCount * mPartitions[i].BlockSize / 1024 / 1024); switch (FileSystem.GetFileSystemType(mPartitions[i])) { case FileSystemType.FAT: - mFileSystems.Add(new FatFileSystem(mPartitions[i], xRootPath)); + mFileSystems.Add(new FatFileSystem(mPartitions[i], xRootPath, xSize)); break; default: global::System.Console.WriteLine("Unknown filesystem type!"); diff --git a/source/Cosmos.System2/FileSystem/FAT/FatFileSystem.cs b/source/Cosmos.System2/FileSystem/FAT/FatFileSystem.cs index 44929705c..21c513a8f 100644 --- a/source/Cosmos.System2/FileSystem/FAT/FatFileSystem.cs +++ b/source/Cosmos.System2/FileSystem/FAT/FatFileSystem.cs @@ -359,8 +359,8 @@ namespace Cosmos.System.FileSystem.FAT /// The partition. /// The root path. /// FAT signature not found. - public FatFileSystem(Partition aDevice, string aRootPath) - : base(aDevice, aRootPath) + public FatFileSystem(Partition aDevice, string aRootPath, long aSize) + : base(aDevice, aRootPath, aSize) { if (aDevice == null) { @@ -603,7 +603,7 @@ namespace Cosmos.System.FileSystem.FAT { Global.mFileSystemDebugger.SendInternal("-- FatFileSystem.GetRootDirectory --"); - var xRootEntry = new FatDirectoryEntry(this, null, mRootPath, mRootPath, RootCluster); + var xRootEntry = new FatDirectoryEntry(this, null, mRootPath, mSize, mRootPath, RootCluster); return xRootEntry; } diff --git a/source/Cosmos.System2/FileSystem/FAT/Listing/FatDiretoryEntry.cs b/source/Cosmos.System2/FileSystem/FAT/Listing/FatDiretoryEntry.cs index c36b8356c..66633ac09 100644 --- a/source/Cosmos.System2/FileSystem/FAT/Listing/FatDiretoryEntry.cs +++ b/source/Cosmos.System2/FileSystem/FAT/Listing/FatDiretoryEntry.cs @@ -42,9 +42,10 @@ namespace Cosmos.System.FileSystem.FAT.Listing FatFileSystem aFileSystem, FatDirectoryEntry aParent, string aFullPath, + long aSize, string aName, uint aFirstCluster) - : base(aFileSystem, aParent, aFullPath, aName, 0, DirectoryEntryTypeEnum.Directory) + : base(aFileSystem, aParent, aFullPath, aName, aSize, DirectoryEntryTypeEnum.Directory) { if (aFirstCluster < aFileSystem.RootCluster) { diff --git a/source/Cosmos.System2/FileSystem/FileSystem.cs b/source/Cosmos.System2/FileSystem/FileSystem.cs index 03a92ddac..5486127f2 100644 --- a/source/Cosmos.System2/FileSystem/FileSystem.cs +++ b/source/Cosmos.System2/FileSystem/FileSystem.cs @@ -9,10 +9,11 @@ namespace Cosmos.System.FileSystem { public abstract class FileSystem { - protected FileSystem(Partition aDevice, string aRootPath) + protected FileSystem(Partition aDevice, string aRootPath, long aSize) { mDevice = aDevice; mRootPath = aRootPath; + mSize = aSize; } public static FileSystemType GetFileSystemType(Partition aDevice) @@ -42,5 +43,7 @@ namespace Cosmos.System.FileSystem protected Partition mDevice { get; } public string mRootPath { get; } + + public long mSize { get; } } }