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.94k stars 554 forks source link

Error invoking IL2CPU in vs 2015 #778

Closed ansh233432545 closed 7 years ago

ansh233432545 commented 7 years ago

i was rebuilding my os after adding some mouse code and got this error: 1>------ Build started: Project: hardware, Configuration: Debug Any CPU ------ 1> hardware -> C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\hardware\bin\Debug\hardware.dll 2>------ Build started: Project: kernel, Configuration: Debug Any CPU ------ 2>C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\Kernel.cs(37,25,37,26): warning CS0219: The variable 'i' is assigned but its value is never used 2> kernel -> C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\CosmosKernel1.dll 3>------ Build started: Project: CosmosKernel1Boot, Configuration: Debug x86 ------ 3> Invoking il2cpu.exe "DebugEnabled:True" "StackCorruptionDetectionEnabled:False" "DebugMode:Source" "TraceAssemblies:" "DebugCom:1" "UseNAsm:True" "OutputFilename:C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\CosmosKernel1Boot.asm" "EnableLogging:True" "EmitDebugSymbols:True" "IgnoreDebugStubAttribute:False" "References:C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.dll" "References:C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Debug.Kernel.Plugs.dll" "References:C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.System.Plugs.dll" "References:C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\CosmosKernel1.dll" "References:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll" 3>C:\Program Files (x86)\MSBuild\Cosmos\Cosmos.targets(31,5): error : Error occurred while invoking IL2CPU. 3> Executing command line "C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\IL2CPU.exe" "DebugEnabled:True" "StackCorruptionDetectionEnabled:False" "DebugMode:Source" "TraceAssemblies:" "DebugCom:1" "UseNAsm:True" "OutputFilename:C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\CosmosKernel1Boot.asm" "EnableLogging:True" "EmitDebugSymbols:True" "IgnoreDebugStubAttribute:False" "References:C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.dll" "References:C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Debug.Kernel.Plugs.dll" "References:C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.System.Plugs.dll" "References:C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\CosmosKernel1.dll" "References:C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.5\System.Core.dll" 3> Working directory = 'C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\' 3> Loaded : DebugEnabled 3> Loaded : StackCorruptionDetectionEnabled 3> Loaded : DebugMode 3> Loaded : TraceAssemblies 3> Loaded : DebugCom 3> Loaded : UseNAsm 3> Loaded : OutputFilename 3> Loaded : EnableLogging 3> Loaded : EmitDebugSymbols 3> Loaded : IgnoreDebugStubAttribute 3> Loaded : References 3> Executing IL2CPU on assembly 3> Plug found: 'System.RuntimeType' 3> Plug found: 'System.OutOfMemoryException' 3> Plug found: 'System.Double' 3> Plug found: 'System.Delegate' 3> Plug found: 'System.Array' 3> Plug found: 'System.Buffer' 3> Plug found: 'System.Enum' 3> Plug found: 'System.EventHandler' 3> Plug found: 'System.Exception' 3> Plug found: 'System.MulticastDelegate' 3> Plug found: 'System.Runtime.CompilerServices.RuntimeHelpers' 3> Plug found: 'System.Math' 3> Plug found: 'System.String' 3> Plug found: 'System.Diagnostics.Debugger' 3> Plug found: 'System.Byte' 3> Plug found: 'System.Environment' 3> Plug found: 'System.GC' 3> Plug found: 'System.Int16' 3> Plug found: 'System.Int32' 3> Plug found: 'System.Int64' 3> Plug found: 'System.IntPtr' 3> Plug found: 'System.Number' 3> Plug found: 'System.Object' 3> Plug found: 'System.Single' 3> Plug found: 'System.SR' 3> Plug found: 'System.UInt16' 3> Plug found: 'System.UInt32' 3> Plug found: 'System.UInt64' 3> Plug found: 'System.Threading.Interlocked' 3> Plug found: 'System.Runtime.InteropServices.SafeHandle' 3> Plug found: 'System.Resources.ResourceManager' 3> Plug found: 'System.Net.IPAddress' 3> Plug found: 'System.Net.SocketAddress' 3> Plug found: 'System.Globalization.NumberFormatInfo' 3> Plug found: 'System.Drawing.Color' 3> Plug found: 'System.Drawing.SR' 3> Plug found: 'System.Security.CodeAccessSecurityEngine' 3> Plug found: 'System.RuntimeType+RuntimeTypeCache' 3> Plug found: 'System.RuntimeTypeHandle' 3> Plug found: 'System.SByte' 3> Plug found: 'System.UIntPtr' 3> Plug found: 'System.Security.Cryptography.Utils' 3> Plug found: 'System.Globalization.CultureInfo' 3> Plug found: 'Microsoft.Win32.RegistryKey' 3> Plug found: 'Cosmos.Core.CPU' 3> Plug found: 'Cosmos.IL2CPU.GCImplementation' 3> Plug found: 'Cosmos.Core.IOPortBase' 3> Plug found: 'Cosmos.Debug.Kernel.Debugger' 3> Plug found: 'System.Char' 3> Plug found: 'System.Collections.Generic.Dictionary`2[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' 3> Plug found: 'System.Random' 3> Plug found: 'System.Console' 3> Plug found: 'System.Type' 3> Plug found: 'System.Threading.Monitor' 3> Plug found: 'System.Text.DecoderFallback' 3> Plug found: 'System.Text.EncoderFallback' 3> Plug found: 'System.Text.ASCIIEncoding' 3> Plug found: 'System.Text.InternalDecoderBestFitFallbackBuffer' 3> Detecting fields for type 'Cosmos.Debug.Common.FIELD_INFO' 3> Detecting fields for type 'Cosmos.Debug.Common.FIELD_MAPPING' 3> Detecting fields for type 'Cosmos.Debug.Common.MethodIlOp' 3> Creating ATA IOGroup 3> Creating ATA IOGroup 3> Rings: Start check 3> Rings: Assembly 'Cosmos.Core' 3> Rings: Ring = Core 3> Rings: Assembly 'Cosmos.System.Plugs' 3> Rings: Ring = System 3> Rings: Dependency 'Cosmos.System' 3> Rings: Ring = System 3> Rings: Dependency 'Cosmos.HAL' 3> Rings: Ring = HAL 3> Rings: Assembly 'Cosmos.HAL' 3> Rings: Ring = HAL 3> Rings: Dependency 'Cosmos.Core' 3> Rings: Ring = Core 3> Rings: Assembly 'Cosmos.System' 3> Rings: Ring = System 3> Rings: Dependency 'Cosmos.HAL' 3> Rings: Ring = HAL 3> Rings: Assembly 'Cosmos.Core.Plugs' 3> Rings: Ring = Core 3> Rings: Dependency 'Cosmos.Core' 3> Rings: Ring = Core 3> Rings: Assembly 'CosmosKernel1' 3> Rings: Ring = User 3> Rings: Dependency 'Cosmos.System' 3> Rings: Ring = System 3> Rings: Dependency 'hardware' 3> Rings: Ring = System 3> Rings: Dependency 'Cosmos.HAL' 3> Rings: Ring = HAL 3> Detecting fields for type 'Cosmos.Debug.Common.AssemblyFile' 3> Detecting fields for type 'Cosmos.Debug.Common.Document' 3> Detecting fields for type 'Cosmos.Debug.Common.Method' 3> Error: Exception: System.Exception: Assembly 'CosmosKernel1' is in ring User(3). It references assembly 'Cosmos.HAL' which is in ring HAL(1), but this is not allowed! 3> at Cosmos.IL2CPU.AppAssemblerRingsCheck.Execute(ILScanner scanner, Assembly entryAssembly) in c:\Data\Sources\OpenSource\Cosmos\source\Cosmos.IL2CPU\AppAssemblerRingsCheck.cs:line 116 3> at Cosmos.IL2CPU.CompilerEngine.Execute() in c:\Data\Sources\OpenSource\Cosmos\source\Cosmos.IL2CPU\CompilerEngine.cs:line 240 3> Loaded assemblies: 3> C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\IL2CPU.exe 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.IL2CPU.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Build.Common.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Debug.Common.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Assembler.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Core\v4.0_4.0.0.0b77a5c561934e089\System.Core.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System\v4.0_4.0.0.0b77a5c561934e089\System.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.System.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Core.Plugs.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.IL2CPU.Plugs.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Common.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.Debug.Kernel.Plugs.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Kernel\Cosmos.System.Plugs.dll 3> C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\CosmosKernel1.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Mono.Cecil.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\System.Data.SQLite.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Data\v4.0_4.0.0.0b77a5c561934e089\System.Data.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.Transactions\v4.0_4.0.0.0b77a5c561934e089\System.Transactions.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\DapperExtensions.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.Serialization\v4.0_4.0.0.0b77a5c561934e089\System.Runtime.Serialization.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\SQLinq.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Configuration\v4.0_4.0.0.0b03f5f7f11d50a3a\System.Configuration.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Xml\v4.0_4.0.0.0b77a5c561934e089\System.Xml.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_32\System.EnterpriseServices\v4.0_4.0.0.0b03f5f7f11d50a3a\System.EnterpriseServices.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\XSC.exe 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Debug.DebugStub.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\XSharp.Nasm.dll 3> C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Drawing\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Core.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.Debug.Kernel.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.HAL.dll 3> C:\Users\Admin\documents\visual studio 2015\Projects\CosmosKernel1\CosmosKernel1\bin\Debug\hardware.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\corapi.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Mono.Cecil.Pdb.dll 3> C:\Users\Admin\AppData\Roaming\Cosmos User Kit\Build\IL2CPU\Cosmos.TestRunner.TestController.dll 3> Errorred 3> IL2CPU invoked with DebugMode='Source', DebugEnabled='True', TraceAssemblies='{NULL}', IgnoreDebugStub='False' 3> IL2CPU task took 00:00:04.1399403 3>Done building project "CosmosKernel1Boot.Cosmos" -- FAILED. 3> 3>Build FAILED. Build has been canceled.

this has happened even after restarting and cleaning

fanoI commented 7 years ago

This the error is clear: are you trying to use something in HAL form User ring?

3> Error: Exception: System.Exception: Assembly 'CosmosKernel1' is in ring User(3). It references assembly 'Cosmos.HAL' which is in ring HAL(1), but this is not allowed!

Arawn-Davies commented 7 years ago

This isn't a bug, it's a feature of Cosmos which allows the developer to separate the OS into layers, just like @fanol said. Follow this guide to solve your issue https://github.com/CosmosOS/Cosmos/wiki/Rings#guide

Once this is done, you'll want to add your hardware project as a reference to your main OS project and this will allow you to write the code in the HAL ring.

Closed due to not being an issue