Skip to content
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

My OS is not booting #189

Open
Umplayerbr19 opened this issue Mar 20, 2023 · 1 comment
Open

My OS is not booting #189

Umplayerbr19 opened this issue Mar 20, 2023 · 1 comment

Comments

@Umplayerbr19
Copy link

hello, my OS is not booting, i asked that in the Cosmos Discord server, and Quajak told me that the error is in IL2CPU, and told me to open an issue here, ill post the logs and the code of BeforeRun() (where is the error in, according to the logs) below.

LOGS (its in portuguese, and i removed the \Users<user>\ from the path):

Compilação iniciada...
1>------ Compilação iniciada: Projeto: PlatinumOS, Configuração: Debug Any CPU ------
1>Ignorando analisadores para acelerar a construção. Você pode executar o comando 'Build' ou 'Rebuild' para executar os analisadores.
1>PlatinumOS -> C:\Users\source\repos\PlatinumOS\bin\Debug\net6.0\PlatinumOS.dll
1>Message: Executing IL2CPU on assembly
1>Message: Kernel Base: Cosmos.System.Kernel
1>Message: Checking target assembly: C:\Users\source\repos\PlatinumOS\bin\Debug\net6.0\PlatinumOS.dll
1>Message : warning : Loading plugs from assembly: Cosmos.Core_Asm, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>Message : warning : Loading plugs from assembly: Cosmos.Core_Plugs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>Message : warning : Loading plugs from assembly: Cosmos.Debug.Kernel.Plugs.Asm, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>Message : warning : Loading plugs from assembly: Cosmos.System2_Plugs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=5ae71220097cb983
1>Detecting fields for type 'IL2CPU.Debug.Symbols.FIELD_INFO'
1>Detecting fields for type 'IL2CPU.Debug.Symbols.FIELD_MAPPING'
1>IL2CPU : error : Exception: System.Exception: Error compiling method 'SystemVoidPlatinumOSKernelBeforeRun': System.ArgumentNullException: Value cannot be null. (Parameter 'aType')
1> at Cosmos.IL2CPU.ILOp.SizeOfType(Type aType) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILOp.cs:line 619
1> at Cosmos.IL2CPU.ILOpCode.DoStackAnalysis(Stack1 aStack, UInt32& aStackOffset) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILOpCode.cs:line 356 1> at Cosmos.IL2CPU.MethodAnalysis.ILMethod.Analyse() in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\MethodAnalysis\ILMethod.cs:line 48 1> at Cosmos.IL2CPU.AppAssembler.AnalyseMethodOpCodes(Il2cpuMethodInfo aMethod, List1 aOpCodes) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\AppAssembler.cs:line 493
1> at Cosmos.IL2CPU.AppAssembler.ProcessMethod(Il2cpuMethodInfo aMethod, List1 aOpCodes) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\AppAssembler.cs:line 475 1> ---> System.ArgumentNullException: Value cannot be null. (Parameter 'aType') 1> at Cosmos.IL2CPU.ILOp.SizeOfType(Type aType) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILOp.cs:line 619 1> at Cosmos.IL2CPU.ILOpCode.DoStackAnalysis(Stack1 aStack, UInt32& aStackOffset) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILOpCode.cs:line 356
1> at Cosmos.IL2CPU.MethodAnalysis.ILMethod.Analyse() in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\MethodAnalysis\ILMethod.cs:line 48
1> at Cosmos.IL2CPU.AppAssembler.AnalyseMethodOpCodes(Il2cpuMethodInfo aMethod, List1 aOpCodes) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\AppAssembler.cs:line 493 1> at Cosmos.IL2CPU.AppAssembler.ProcessMethod(Il2cpuMethodInfo aMethod, List1 aOpCodes) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\AppAssembler.cs:line 475
1> --- End of inner exception stack trace ---
1> at Cosmos.IL2CPU.AppAssembler.ProcessMethod(Il2cpuMethodInfo aMethod, List1 aOpCodes) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\AppAssembler.cs:line 483 1> at Cosmos.IL2CPU.ILScanner.Assemble() in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 1044 1> at Cosmos.IL2CPU.ILScanner.Execute(MethodBase aStartMethod, IEnumerable1 plugsAssemblies) in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\ILScanner.cs:line 278
1> at Cosmos.IL2CPU.CompilerEngine.Execute() in C:\Development\CosmosOS\IL2CPU\source\Cosmos.IL2CPU\CompilerEngine.cs:line 223
1>IL2CPU task took 00:00:12.7880164
1>Projeto de compilação pronto "PlatinumOS.csproj" -- FALHA.
========== Compilação: 0 bem-sucedida, 1 com falha, 0 atualizada, 0 ignorada ==========
=========== Decorrido 00:13,445 =========

CODE BeforeRun():
protected override void BeforeRun()
{
Sys.FileSystem.VFS.VFSManager.RegisterVFS(fs);

        var fstype = fs.GetFileSystemType;
        Console.ForegroundColor = ConsoleColor.Green;
        Console.Beep(300, 100);
        Console.WriteLine($"[OK] Initialized File System: {fstype}");
        Thread.Sleep(2000);
        Console.ResetColor();

        if (!Directory.Exists("0:\\System\\"))
        {
            Console.ForegroundColor = ConsoleColor.Green;
            fs.CreateDirectory("0:\\System\\");
            File.Create("0:\\System\\SystemConfig.cfg");
            File.WriteAllText("0:\\System\\SystemConfig.cfg", "SystemFilesCreated");
            fs.CreateDirectory("0:\\Users\\");
            Console.Beep(300, 100);
            Console.WriteLine($"[OK] Created System Configs");
            Console.ResetColor();
        }
        else
        {

        }
        
        if (!Directory.Exists("0:\\Users\\"))
        {
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("[NO] User Found");
            Console.ResetColor();
            Console.Write("New User: ");
            var userName = Console.ReadLine();
            Console.Write("New Password: ");
            var passWord = Console.ReadLine();
            Console.WriteLine($"User {userName} Created");
            File.WriteAllText($"0:\\Users\\passwords.db", passWord);
            File.WriteAllText($"0:\\Users\\users.db", userName);
        }
        else
        {
            Console.ForegroundColor = ConsoleColor.Green;
            Console.Beep(300, 100);
            Console.Write("[OK] User Found");
            Console.ResetColor();
            var username = File.ReadAllText($"0:\\Users\\users.db");
            Console.WriteLine($"Logging in {username}...");
            Thread.Sleep(1500);                
            Console.Beep(50, 200);
            Console.Beep(250, 200);
            Console.Beep(500, 200);
            Console.Beep(750, 200);
            Console.Beep(1000, 200);
            Console.WriteLine("Logged in.");
            Console.WriteLine($"Welcome to PlatinumOS, {username}.");
            Console.Clear();
        }
    }
@ADev531
Copy link

ADev531 commented Oct 26, 2023

I think it's IL2CPU's problem.

or try it on lastest devkit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants