-
Notifications
You must be signed in to change notification settings - Fork 569
Add Multiboot2 modules and Module file system #3099
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+1,733
−1,432
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
c91e54e
Added Multiboot2 Module Tag and PointerList (For storing modules)
31ae738
Added ModuleFileSystem (MFS), not detected yet
c97e12a
Added module adding feature (ISO/modules)
aa4a2aa
Merge branch 'master' into impl/mb2module
ADev531 e69af15
Merge branch 'master' into impl/mb2module
MishaProductions File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,123 @@ | ||
/* | ||
* PROJECT: Cosmos Development | ||
* CONTENT: Multiboot2 class | ||
* PROGRAMMERS: Valentin Charbonnier <valentinbreiz@gmail.com> | ||
* RESOURCES: https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html | ||
*/ | ||
|
||
using Cosmos.Core.Multiboot.Tags; | ||
using IL2CPU.API.Attribs; | ||
|
||
namespace Cosmos.Core.Multiboot | ||
{ | ||
/// <summary> | ||
/// Multiboot2 class. Used for multiboot parsing. | ||
/// </summary> | ||
public unsafe class Multiboot2 | ||
{ | ||
#region Properties | ||
|
||
public static BasicMemoryInformation* BasicMemoryInformation { get; set; } | ||
public static bool IsVBEAvailable => Framebuffer->Address != 753664; // Some kinda default number. | ||
public static Framebuffer* Framebuffer { get; set; } | ||
public static MemoryMap* MemoryMap { get; set; } | ||
/* | ||
* PROJECT: Cosmos Development | ||
* CONTENT: Multiboot2 class | ||
* PROGRAMMERS: Valentin Charbonnier <valentinbreiz@gmail.com> | ||
* RESOURCES: https://www.gnu.org/software/grub/manual/multiboot2/multiboot.html | ||
*/ | ||
|
||
using System.Collections.Generic; | ||
using Cosmos.Core.Multiboot.Tags; | ||
using IL2CPU.API.Attribs; | ||
|
||
namespace Cosmos.Core.Multiboot | ||
{ | ||
/// <summary> | ||
/// Multiboot2 class. Used for multiboot parsing. | ||
/// </summary> | ||
public unsafe class Multiboot2 | ||
{ | ||
#region Properties | ||
|
||
public static BasicMemoryInformation* BasicMemoryInformation { get; set; } | ||
public static bool IsVBEAvailable => Framebuffer->Address != 753664; // Some kinda default number. | ||
public static Framebuffer* Framebuffer { get; set; } | ||
public static MemoryMap* MemoryMap { get; set; } | ||
public static EFI64* EFI64 { get; set; } | ||
public static AcpiOld* AcpiOld { get; set; } | ||
public static AcpiNew* AcpiNew { get; set; } | ||
|
||
#endregion | ||
|
||
#region Methods | ||
|
||
/// /// <summary> | ||
/// Parse multiboot2 structure | ||
/// </summary> | ||
public static void Init() | ||
{ | ||
if (!isInitialized) | ||
{ | ||
isInitialized = true; | ||
|
||
uint MbAddress = GetMBIAddress(); | ||
|
||
MB2Tag* Tag; | ||
|
||
for (Tag = (MB2Tag*)(MbAddress + 8); Tag->Type != 0; Tag = (MB2Tag*)((byte*)Tag + (Tag->Size + 7 & ~7))) | ||
{ | ||
switch (Tag->Type) | ||
{ | ||
case 4: | ||
BasicMemoryInformation = (BasicMemoryInformation*)Tag; | ||
break; | ||
case 6: | ||
MemoryMap = (MemoryMap*)Tag; | ||
break; | ||
case 7: | ||
// Ignore because we use Framebuffer tags now :) | ||
//VBEInfo = (VBEInfo*)Tag; | ||
break; | ||
case 8: | ||
Framebuffer = (Framebuffer*)Tag; | ||
break; | ||
case 12: | ||
EFI64 = (EFI64*)Tag; | ||
public static AcpiNew* AcpiNew { get; set; } | ||
public static PointerList<MB2Module> Modules { get; set; } | ||
|
||
#endregion | ||
|
||
#region Methods | ||
|
||
/// <summary> | ||
/// Parse multiboot2 structure | ||
/// </summary> | ||
public static void Init() | ||
{ | ||
if (!isInitialized) | ||
{ | ||
isInitialized = true; | ||
|
||
Modules = new PointerList<MB2Module>(); | ||
|
||
uint MbAddress = GetMBIAddress(); | ||
MB2Tag* Tag; | ||
|
||
for (Tag = (MB2Tag*)(MbAddress + 8); Tag->Type != 0; Tag = (MB2Tag*)((byte*)Tag + (Tag->Size + 7 & ~7))) | ||
{ | ||
switch (Tag->Type) | ||
{ | ||
case 3: | ||
Modules.Add((MB2Module*)Tag); | ||
break; | ||
case 4: | ||
BasicMemoryInformation = (BasicMemoryInformation*)Tag; | ||
break; | ||
case 6: | ||
MemoryMap = (MemoryMap*)Tag; | ||
break; | ||
case 7: | ||
// Ignore because we use Framebuffer tags now :) | ||
//VBEInfo = (VBEInfo*)Tag; | ||
break; | ||
case 8: | ||
Framebuffer = (Framebuffer*)Tag; | ||
break; | ||
case 12: | ||
EFI64 = (EFI64*)Tag; | ||
break; | ||
case 14: | ||
AcpiOld = (AcpiOld*)Tag; | ||
break; | ||
case 15: | ||
AcpiNew = (AcpiNew*)Tag; | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Get MemLower | ||
/// </summary> | ||
/// <returns>MemLower</returns> | ||
public static uint GetMemLower() | ||
{ | ||
return BasicMemoryInformation->MemLower; | ||
} | ||
|
||
/// <summary> | ||
/// Get MemUpper | ||
/// </summary> | ||
/// <returns>MemUpper</returns> | ||
public static uint GetMemUpper() | ||
{ | ||
return BasicMemoryInformation->MemUpper; | ||
} | ||
|
||
/// <summary> | ||
/// Checks if Multiboot returned a memory map | ||
/// </summary> | ||
/// <returns>True if is available, false if not</returns> | ||
public static bool MemoryMapExists() => MemoryMap != null; | ||
|
||
/// /// <summary> | ||
/// Get Multiboot address. Plugged. | ||
/// </summary> | ||
/// <returns>The Multiboot Address</returns> | ||
[PlugMethod(PlugRequired = true)] | ||
public static uint GetMBIAddress() => throw null; | ||
|
||
#endregion | ||
|
||
#region Fields | ||
|
||
private static bool isInitialized = false; | ||
|
||
#endregion | ||
} | ||
break; | ||
default: | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
/// <summary> | ||
/// Get MemLower | ||
/// </summary> | ||
/// <returns>MemLower</returns> | ||
public static uint GetMemLower() | ||
{ | ||
return BasicMemoryInformation->MemLower; | ||
} | ||
/// <summary> | ||
/// Get MemUpper | ||
/// </summary> | ||
/// <returns>MemUpper</returns> | ||
public static uint GetMemUpper() | ||
{ | ||
return BasicMemoryInformation->MemUpper; | ||
} | ||
/// <summary> | ||
/// Checks if Multiboot returned a memory map | ||
/// </summary> | ||
/// <returns>True if is available, false if not</returns> | ||
public static bool MemoryMapExists() => MemoryMap != null; | ||
/// /// <summary> | ||
/// Get Multiboot address. Plugged. | ||
/// </summary> | ||
/// <returns>The Multiboot Address</returns> | ||
[PlugMethod(PlugRequired = true)] | ||
public static uint GetMBIAddress() => throw null; | ||
#endregion | ||
#region Fields | ||
private static bool isInitialized = false; | ||
#endregion | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cosmos.Core.Multiboot.Tags | ||
{ | ||
/// <summary> | ||
/// Multiboot2 Module tag | ||
/// </summary> | ||
[StructLayout(LayoutKind.Explicit, Size = 44)] | ||
public unsafe readonly struct MB2Module | ||
{ | ||
/// <summary> | ||
/// Information about the tag. | ||
/// </summary> | ||
[FieldOffset(0)] | ||
public readonly MB2Tag Info; | ||
|
||
/// <summary> | ||
/// Starting address of the module. | ||
/// </summary> | ||
[FieldOffset(8)] | ||
public readonly uint ModuleStartAddress; | ||
|
||
/// <summary> | ||
/// Ending address of the module. | ||
/// </summary> | ||
[FieldOffset(16)] | ||
public readonly uint ModuleEndAddress; | ||
|
||
/// <summary> | ||
/// Zero-end string of the command line. | ||
/// </summary> | ||
[FieldOffset(24)] | ||
public readonly char* CommandLine; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Reflection.Metadata.Ecma335; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Cosmos.Core | ||
{ | ||
/// <summary> | ||
/// PointerList class. Used for making list of pointers. | ||
/// </summary> | ||
/// <typeparam name="T">Non-pointer type of pointer.</typeparam> | ||
public unsafe class PointerList<T> : IEnumerable where T : unmanaged | ||
{ | ||
private T*[] values; | ||
private int index = 0; | ||
private int maxLength; | ||
private int enumerator_index = -1; | ||
|
||
/// <summary> | ||
/// Count of pointers. | ||
/// </summary> | ||
public int Count | ||
{ | ||
get | ||
{ | ||
return index; | ||
} | ||
} | ||
|
||
private void expand() | ||
{ | ||
T*[] newArray = new T*[maxLength + 1]; | ||
|
||
if (maxLength > 0) | ||
{ | ||
for (int i = 0; i < Count; i++) | ||
{ | ||
newArray[i] = values[i]; | ||
} | ||
} | ||
|
||
values = newArray; | ||
} | ||
|
||
public PointerList(int maxLength = 0) | ||
{ | ||
this.maxLength = maxLength; | ||
|
||
if (maxLength > 0) | ||
{ | ||
values = new T*[maxLength]; | ||
} | ||
} | ||
|
||
public void Add(T* value) | ||
{ | ||
if (index + 1 >= maxLength) | ||
{ | ||
expand(); | ||
} | ||
|
||
values[index++] = value; | ||
} | ||
|
||
public T* this[int key] | ||
{ | ||
get | ||
{ | ||
return values[key]; | ||
} | ||
} | ||
|
||
|
||
public IEnumerator GetEnumerator() | ||
{ | ||
return new PointerListEnum<T>(this); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Enumerator for PointerList class. | ||
/// </summary> | ||
public unsafe class PointerListEnum<T> : IEnumerator where T : unmanaged | ||
{ | ||
private int index = -1; | ||
private PointerList<T> list; | ||
|
||
public object Current => *list[index]; | ||
|
||
public PointerListEnum(PointerList<T> list) | ||
{ | ||
this.list = list; | ||
} | ||
|
||
bool IEnumerator.MoveNext() | ||
{ | ||
index++; | ||
return index < list.Count; | ||
} | ||
|
||
void IEnumerator.Reset() | ||
{ | ||
index = -1; | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,59 @@ | ||
{ | ||
"version": 1, | ||
"dependencies": { | ||
".NETFramework,Version=v4.7.2": { | ||
"Microsoft.NETFramework.ReferenceAssemblies": { | ||
"type": "Direct", | ||
"requested": "[1.0.3, )", | ||
"resolved": "1.0.3", | ||
"contentHash": "vUc9Npcs14QsyOD01tnv/m8sQUnGTGOw1BCmKcv77LBJY7OxhJ+zJF7UD/sCL3lYNFuqmQEVlkfS4Quif6FyYg==", | ||
"dependencies": { | ||
"Microsoft.NETFramework.ReferenceAssemblies.net472": "1.0.3" | ||
} | ||
}, | ||
"Microsoft.NETFramework.ReferenceAssemblies.net472": { | ||
"type": "Transitive", | ||
"resolved": "1.0.3", | ||
"contentHash": "0E7evZXHXaDYYiLRfpyXvCh+yzM2rNTyuZDI+ZO7UUqSc6GfjePiXTdqJGtgIKUwdI81tzQKmaWprnUiPj9hAw==" | ||
}, | ||
"Microsoft.Win32.Registry": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", | ||
"dependencies": { | ||
"System.Security.AccessControl": "5.0.0", | ||
"System.Security.Principal.Windows": "5.0.0" | ||
} | ||
}, | ||
"System.Security.AccessControl": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", | ||
"dependencies": { | ||
"System.Security.Principal.Windows": "5.0.0" | ||
} | ||
}, | ||
"System.Security.Principal.Windows": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" | ||
}, | ||
"cosmos.build.common": { | ||
"type": "Project", | ||
"dependencies": { | ||
"Microsoft.Win32.Registry": "[5.0.0, )" | ||
} | ||
} | ||
} | ||
} | ||
{ | ||
"version": 1, | ||
"dependencies": { | ||
".NETFramework,Version=v4.7.2": { | ||
"Microsoft.Win32.Registry": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", | ||
"dependencies": { | ||
"System.Security.AccessControl": "5.0.0", | ||
"System.Security.Principal.Windows": "5.0.0" | ||
} | ||
}, | ||
"System.Security.AccessControl": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", | ||
"dependencies": { | ||
"System.Security.Principal.Windows": "5.0.0" | ||
} | ||
}, | ||
"System.Security.Principal.Windows": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" | ||
}, | ||
"cosmos.build.common": { | ||
"type": "Project", | ||
"dependencies": { | ||
"Microsoft.Win32.Registry": "[5.0.0, )" | ||
} | ||
} | ||
}, | ||
".NETFramework,Version=v4.7.2/win7-x86": { | ||
"Microsoft.Win32.Registry": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==", | ||
"dependencies": { | ||
"System.Security.AccessControl": "5.0.0", | ||
"System.Security.Principal.Windows": "5.0.0" | ||
} | ||
}, | ||
"System.Security.AccessControl": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "dagJ1mHZO3Ani8GH0PHpPEe/oYO+rVdbQjvjJkBRNQkX4t0r1iaeGn8+/ybkSLEan3/slM0t59SVdHzuHf2jmw==", | ||
"dependencies": { | ||
"System.Security.Principal.Windows": "5.0.0" | ||
} | ||
}, | ||
"System.Security.Principal.Windows": { | ||
"type": "Transitive", | ||
"resolved": "5.0.0", | ||
"contentHash": "t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==" | ||
} | ||
} | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
source/Cosmos.System2/FileSystem/ModuleFS/MFSDirectoryEntry.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Cosmos.System.FileSystem.Listing; | ||
|
||
namespace Cosmos.System.FileSystem.ModuleFS | ||
{ | ||
public class MFSDirectoryEntry : DirectoryEntry | ||
{ | ||
private ModuleFileSystem mfs; | ||
private string path; | ||
private string name; | ||
|
||
public MFSDirectoryEntry(ModuleFileSystem fs, string fullPath, string fileName, uint size, DirectoryEntryTypeEnum entryType) : base(fs, null, fullPath, fileName, size, entryType) | ||
{ | ||
mfs = fs; | ||
path = fullPath; | ||
name = fileName; | ||
} | ||
|
||
public override Stream GetFileStream() | ||
{ | ||
return new MemoryStream(mfs.MFSReadFile(path.Replace(mfs.rootPath, ""))); | ||
} | ||
|
||
public override long GetUsedSpace() => 0; | ||
public override void SetName(string aName) => throw new NotImplementedException("Read-only File system"); | ||
public override void SetSize(long aSize) => throw new NotImplementedException("Read-only File system"); | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
source/Cosmos.System2/FileSystem/ModuleFS/ModuleFileSystem.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Cosmos.Core.Multiboot; | ||
using Cosmos.Core.Multiboot.Tags; | ||
using Cosmos.HAL.BlockDevice; | ||
using Cosmos.System.FileSystem.Listing; | ||
|
||
namespace Cosmos.System.FileSystem.ModuleFS | ||
{ | ||
public class ModuleFileSystem : FileSystem | ||
{ | ||
private string _label = "MFSDisk"; | ||
public override long AvailableFreeSpace => 0; | ||
public override long TotalFreeSpace => 0; | ||
public override string Type => "ModuleFS"; | ||
public override string Label { get => _label; set => _label = value; } | ||
|
||
internal string rootPath; | ||
|
||
public ModuleFileSystem(long Size, string rootPath) : base(null, rootPath, Size) | ||
{ | ||
this.rootPath = rootPath; | ||
} | ||
|
||
private unsafe string GetName(MB2Module module) | ||
{ | ||
string str = ""; | ||
|
||
for (int i = 0; module.CommandLine[i] != 0; i++) | ||
{ | ||
str = str + module.CommandLine[i]; | ||
} | ||
return str; | ||
} | ||
|
||
internal unsafe byte[] MFSReadFile(string path) | ||
{ | ||
byte[] data = null; | ||
|
||
foreach (MB2Module module in Multiboot2.Modules) | ||
{ | ||
if (path == GetName(module)) | ||
{ | ||
byte* file_pointer = (byte*)module.ModuleStartAddress; | ||
data = new byte[module.ModuleEndAddress - module.ModuleStartAddress]; | ||
|
||
for (int i = 0; i < module.ModuleEndAddress - module.ModuleStartAddress; i++) | ||
{ | ||
data[i] = file_pointer[i]; | ||
} | ||
} | ||
} | ||
|
||
return data; | ||
} | ||
|
||
public override DirectoryEntry CreateDirectory(DirectoryEntry aParentDirectory, string aNewDirectory) => throw new NotImplementedException(); | ||
public override DirectoryEntry CreateFile(DirectoryEntry aParentDirectory, string aNewFile) => throw new NotImplementedException(); | ||
public override void DeleteDirectory(DirectoryEntry aPath) => throw new NotImplementedException(); | ||
public override void DeleteFile(DirectoryEntry aPath) => throw new NotImplementedException(); | ||
|
||
public override void DisplayFileSystemInfo() | ||
{ | ||
global::System.Console.WriteLine("Volume label is " + _label); | ||
} | ||
|
||
public override void Format(string aDriveFormat, bool aQuick) => throw new NotImplementedException("Read-only File system"); | ||
public override List<DirectoryEntry> GetDirectoryListing(DirectoryEntry baseDirectory) | ||
{ | ||
List<DirectoryEntry > list = new List<DirectoryEntry>(); | ||
|
||
foreach (MB2Module module in Multiboot2.Modules) | ||
{ | ||
list.Add(new MFSDirectoryEntry(this, rootPath + GetName(module), GetName(module), module.ModuleEndAddress - module.ModuleStartAddress, DirectoryEntryTypeEnum.File)); | ||
} | ||
return list; | ||
} | ||
|
||
public override DirectoryEntry GetRootDirectory() | ||
{ | ||
return new MFSDirectoryEntry(this, rootPath, "RootDir", 0, DirectoryEntryTypeEnum.Directory); | ||
} | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
source/Cosmos.System2/FileSystem/ModuleFS/ModuleFileSystemFactory.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Cosmos.HAL.BlockDevice; | ||
|
||
namespace Cosmos.System.FileSystem.ModuleFS | ||
{ | ||
public class ModuleFileSystemFactory : FileSystemFactory | ||
{ | ||
private static ModuleFileSystem mfs_instance = null; | ||
public override string Name => "ModuleFS"; | ||
|
||
public override FileSystem Create(Partition aDevice, string aRootPath, long aSize) => new ModuleFileSystem(aSize, aRootPath); | ||
public override bool IsType(Partition aDevice) | ||
{ | ||
return false; | ||
} | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo the formatting changes to make reviewing easier.