CosmosOS / Cosmos

Cosmos is an operating system "construction kit". Build your own OS using managed languages such as C#, VB.NET, and more!
https://www.goCosmos.org
BSD 3-Clause "New" or "Revised" License
2.91k stars 549 forks source link

Error with NoobOS file system... #356

Closed AndDOS closed 8 years ago

AndDOS commented 8 years ago

private static PrimaryPartition workPartition = null;

    /// <summary>
    /// The Init of NoobOS System.
    /// </summary>
    public static void RunInit()
    {

        #region Disks and Partitions
        Helper.WriteLine("Getting Disks...");
        IDE[] IDEs = IDE.Devices.ToArray();
        Helper.WriteLine("Number of IDE disks: " + IDEs.Length);
        Helper.WriteLine("Looking for valid partitions...");
        for (int i = 0; i < IDEs.Length; i++)
        {
            PrimaryPartition[] parts = IDEs[i].PrimaryPartitions;
            for (int j = 0; j < parts.Length; j++)
            {
                if (parts[j].Infos.SystemID == 0xFA)
                {
                    workPartition = parts[j];
                }
            }
        }
        //#warning Revert to == null!!!
        if (workPartition == null)
        {
            DiskHandler.CreatePartitions(IDEs);
            Helper.WriteLine("The machine needs to be restarted.");

        }
        Helper.Done();
        #endregion
        #region FileSystem
        Helper.Write("Checking FileSystem... ");
        NoobFileSystem fs;
        try
        {
            fs = new NoobFileSystem(workPartition);
            NoobFileSystem.AddMapping("/", fs);
            Helper.Done();
        }
        catch (Exception ex)
        {
            Helper.Error("Error!" + ex.Message);
            Error = true;
        }
        #endregion
        //i have a problem with Creating directory....

     NoobFileSystem.mFS.Root.AddDirectory("asd");

   }

i have a problem with this: NoobFileSystem.mFS.Root.AddDirectory("asd"); errors: Ошибка 10 Native code encountered, plug required. Please see http://cosmos.codeplex.com/wikipage?title=Plugs). System.Void System.Buffer._Memmove(System.Byte, System.Byte_, System.UInt32). Called from : System.Void System.Buffer.Memmove(System.Byte, System.Byte, System.UInt32) System.Void System.Buffer.Memmove(System.Byte, System.Byte, System.UInt32) System.Void System.Buffer.Memcpy(System.Byte, System.Byte, System.Int32) System.Void System.String.wstrcpy(System.Char, System.Char_, System.Int32) System.String System.String.InternalSubString(System.Int32, System.Int32) System.String System.String.CreateTrimmedString(System.Int32, System.Int32) System.String System.String.TrimHelper(System.Int32) System.String System.String.TrimEnd(System.Char[]) System.String NoobOS.FileSystem.NoobFileSystem.NoobFileSystem.CombineDir(System.String, System.String) NoobOS.FileSystem.NoobFileSystem.NoobEntry[] NoobOS.FileSystem.NoobFileSystem.NoobDirectory.GetEntries() System.Void NoobOS.FileSystem.NoobFileSystem.NoobDirectory.AddDirectory(System.String) System.Void NoobOS.Init.RunInit() System.Void CosmosKernel1.Kernel.Run() System.Void Cosmos.System.Kernel.Run()

в Cosmos.IL2CPU.ILScanner.ScanMethod(MethodBase aMethod, Boolean aIsPlug, String sourceItem) в g:\IL2CPU\source2\IL2CPU\Cosmos.IL2CPU\ILScanner.cs:строка 541 в Cosmos.IL2CPU.ILScanner.ScanQueue() в g:\IL2CPU\source2\IL2CPU\Cosmos.IL2CPU\ILScanner.cs:строка 686 в Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod) в g:\IL2CPU\source2\IL2CPU\Cosmos.IL2CPU\ILScanner.cs:строка 277 в Cosmos.Build.MSBuild.IL2CPUTask.Execute() в g:\IL2CPU\source2\Build\Cosmos.Build.MSBuild\IL2CPUTask.cs:строка 239 C:\Program Files (x86)\MSBuild\Cosmos\Cosmos.targets 31 6 KernelBoot

What i must make for creating directorys and files ?

Excuse me ,my english is bad..... :( vs 2013 cosmos-last version 108447

Technochips commented 8 years ago

Ошибка 10 Native code encountered, plug required. Please see https://github.com/CosmosOS/Cosmos/wiki/Plugs). System.Void System.Buffer.__Memmove(System.Byte, System.Byte, System.UInt32). you need to make a plug for the System.Buffer.__Memmove(System.Byte, System.Byte, System.UInt32) method, it's a bit complicated see /wiki/Plugs (as the link above says)

or use the new filesystem included in the devkit version (it's not in the userkit version for the moment)

also you should include the code of the NoobFileSystem.mFS.Root.AddDirectory(string) method