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

Cosmos won't boot successfully. #786

Closed piixx closed 7 years ago

piixx commented 7 years ago

Just installed the DevKit over the UserKit. When I had the userkit installed, everything was booting and working smoothly. Realized I needed the DevKit in order to power on and off using ACPI and installed the DevKit successfully. Now, I can write code and all the dependencies are fine, but the VM just gets stuck on "Kernel Class Created" and does not continue. This is all using the default code:

using System;
using System.Collections.Generic;
using System.Text;
using Sys = Cosmos.System;

namespace CosIX
{
    public class Kernel: Sys.Kernel
    {
        protected override void BeforeRun()
        {
            Console.WriteLine("Cosmos booted successfully. Type a line of text to get it echoed back.");
        }

        protected override void Run()
        {
            Console.Write("Input: ");
            var input = Console.ReadLine();
            Console.Write("Text typed: ");
            Console.WriteLine(input);
        }
    }
}

Screenshot: image

segg21 commented 7 years ago

Same

piixx commented 7 years ago

Still no solution...

Arawn-Davies commented 7 years ago

Is there anything being displayed in the Visual Studio Output window? I can see for sure there's definitely nothing wrong with your Kernel.cs so that's alright. Was it a fresh install (removed the Userkit first then installed devkit) or was it just an upgrade?

You can try cleaning the solution as that sometimes helps, and if it's just ACPI you're wanting to use for your OS in the time being, there's an external ACPI class that isn't part of the userkit which is where the devkit's ACPI class is actually from, you can find it at https://github.com/Arawn-Davies/Medli/blob/master/Medli.Hardware/Power.cs (I didn't make it, it's just a copy from that original code). Just remember to add it in a project that's in the HAL ring, and rename Medli to your choosing.

I'm not really sure what's going on here, kinda a noob just giving a bit of help, hope its alright :)

piixx commented 7 years ago

@Arawn-Davies

  1. There is nothing (special) being displayed in the VS Output Window.
  2. It was not a fresh install, as I do not know how to uninstall the Userkit.
  3. I have tried making new projects and running them w/o modification to no avail. I'm not sure if cleaning will do anything, but I'll attempt
  4. I might try the ACPI class, thank you.
piixx commented 7 years ago

@Arawn-Davies

OK, Uninstalled the Userkit using unins000. Made a new project and tried to run, got this error:

An error occurred: System.TypeInitializationException: The type initializer for 'Microsoft.Data.Sqlite.SqliteConnection' threw an exception. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.DllNotFoundException: Unable to load DLL 'e_sqlite3': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
   at SQLitePCL.SQLite3Provider_e_sqlite3.NativeMethods.sqlite3_libversion_number()
   at SQLitePCL.SQLite3Provider_e_sqlite3.SQLitePCL.ISQLite3Provider.sqlite3_libversion_number()
   at SQLitePCL.raw.SetProvider(ISQLite3Provider imp)
   at SQLitePCL.Batteries_V2.Init()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
   at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at Microsoft.Data.Sqlite.Utilities.BundleInitializer.Initialize()
   at Microsoft.Data.Sqlite.SqliteConnection..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Data.Sqlite.SqliteConnection..ctor(String connectionString)
   at Cosmos.Debug.Symbols.DebugInfo..ctor(String aPathname, Boolean aCreate, Boolean aCreateIndexes)
   at Cosmos.Debug.Symbols.ObjDump.ExtractMapSymbolsForElfFile(String debugFile, String mapFile)
   at Cosmos.Build.MSBuild.ExtractMapFromElfFile.Execute()  CosIXBoot   C:\Users\REDACTED\AppData\Roaming\Cosmos User Kit\Build\VSIP\Cosmos.targets 75  

Same as #773

piixx commented 7 years ago

NEWS!!!!

Looks like all the commands actually ARE running, but the text itself isn't showing itself.

Arawn-Davies commented 7 years ago

The devkit has had some issues regarding SQLite as NET Core 2.0 I don't think includes the latest SQLite package which has the fix, I also don't know if this is caused by commit https://github.com/CosmosOS/Cosmos/commit/85cdb0f2c8ded9ae6ea0f24602b71da21fff42d1 so maybe try using the Userkit, doesn't have ACPI included and still uses Gen3 but is stable

Arawn-Davies commented 7 years ago

also, how are you able to tell that the instructions are running? Are you using the debugger alongside the Console methods?

piixx commented 7 years ago

Changing the foreground color changes the cursor color, clear() clears the screen still, writing a line makes a new empty line. Nothing shows, though.

segg21 commented 7 years ago

@piixx you never showed enough of the stacktrace.

~Please install https://www.nuget.org/packages/Microsoft.Data.Sqlite/~

jp2masa commented 7 years ago

That package is pulled by Cosmos.Build.MSBuild, but the fix for the e_sqlite3.dll wasn't released in the latest package. It seems to me that the fix was supposed to be merged to the release branch in the Microsoft.Data.Sqlite repo, but it wasn't.

segg21 commented 7 years ago

@jp2masa sorry, vs fooled me. What is said is wrong, my build still failed.

Gonna try rebuilding again :/

piixx commented 7 years ago

@LegitSoulja I have showed all of my stacktrace.

jp2masa commented 7 years ago

@LegitSoulja you're getting the sqlite error?

segg21 commented 7 years ago

@jp2masa I didn't uninstall after installing the new release. I have SQLite in Cosmos\Cosmos\packages.

segg21 commented 7 years ago

@jp2masa at first I wasn't, I created a new project to reproduce the issue, and now I have this error.

I had the kernel issue. Nothing wasn't outputting in console. Just says "Kernel Class Created"

piixx commented 7 years ago

@LegitSoulja @jp2masa If you build https://github.com/aspnet/Microsoft.Data.Sqlite/releases/tag/rel%2F2.0.0 and restart Visual Studio, you should be good. This worked for me.

jp2masa commented 7 years ago

@LegitSoulja I'll push a possible fix to a branch in a few minutes, you can test it?

segg21 commented 7 years ago

@piixx If nuget wont work, this wouldn't neither. @jp2masa sure.

piixx commented 7 years ago

@jp2masa Does this also fix the not showing text issue?

segg21 commented 7 years ago

@piixx I assumed the sql was the issue it wasn't. But idk. I was going to look into that, but this came up.

jp2masa commented 7 years ago

@piixx That issue may be caused by a PR that was recently merged. It changed some things in the console implementation.

piixx commented 7 years ago

@LegitSoulja yeah, same, but doing what i've said worked :/ i haven't had that issue in a while. Just the no-show issue.

piixx commented 7 years ago

@jp2masa was it the ascii extension thing? I checked that out

segg21 commented 7 years ago

@jp2masa i'll check the recent passed PR's

segg21 commented 7 years ago

@piixx interesting.

segg21 commented 7 years ago

I looked at it, and isn't the ascii char codes wrong? @jp2masa @zarlo

I'll rewrite (We'll im going too), but these are wrong.

Edit: Nvm, it's my debugger that's not printing them correctly.

jp2masa commented 7 years ago

@LegitSoulja try the change in this branch: https://github.com/CosmosOS/IL2CPU/tree/sqlite-issue

segg21 commented 7 years ago

@jp2masa ok

piixx commented 7 years ago

@jp2masa does this also fix no-show?

jp2masa commented 7 years ago

No, I don't know what may be causing it. Did you try installing a Dev Kit without the console changes?

piixx commented 7 years ago

@jp2masa ...what console changes

segg21 commented 7 years ago

@jp2masa do I re-install devkit after re-pulling?

jp2masa commented 7 years ago

Yes.

jp2masa commented 7 years ago

@piixx https://github.com/CosmosOS/Cosmos/archive/9a76f82018b83d5c90cf7e190931c228a454f986.zip

segg21 commented 7 years ago

@jp2masa No I don't. It's fixed.

segg21 commented 7 years ago

@jp2masa edit: VMWare got an error saying the configuration couldn't be loaded. Tried to re-build, Error occurred while invoking IL2CPU.

Fine. I'll just re-install. Give me about 10-20 minutes

jp2masa commented 7 years ago

This is a weird issue. The error only happens sometimes. I think that I'll just add an MSBuild hack for now.

segg21 commented 7 years ago

@jp2masa I think it's fixed now. I'll confirm after re-install the dev kit (As that may be an issue).

Then @piixx i'll look into the console issue.

segg21 commented 7 years ago

@jp2masa yea, Error occurred while invoking IL2CPU now.

piixx commented 7 years ago

Can confirm @LegitSoulja that i'm getting error while invoking IL2CPU now.

zarlo commented 7 years ago

@piixx can you send us the build log

piixx commented 7 years ago

@zarlo I will later today if @LegitSoulja doesn't send it first. I have school to do :/

segg21 commented 7 years ago

@zarlo I have no build log files, except for stacktrace in the console.

zarlo commented 7 years ago

that will work

Remco123 commented 7 years ago

For me the no-show issue was solved by replacing the Write function in Cosmos.System2.Console.cs with this:

public void Write(string aText) { if (aText == null) { return; } for (int i = 0; i < aText.Length; i++) { if (aText[i] == '\n') { NewLine(); } else if (aText[i] == '\r') { mX = 0; UpdateCursor(); } else if (aText[i] == '\t') { //Write(" "); InternalWriteChar(' '); InternalWriteChar(' '); InternalWriteChar(' '); InternalWriteChar(' '); } //This fixes the issue else { InternalWriteChar(aText[i]); } }
UpdateCursor(); }

Remco123 commented 7 years ago

But now the █ Char displays a ê

segg21 commented 7 years ago

I like how an index of aText will equal \n or \r, or even \t. lol

segg21 commented 7 years ago

@Remco123 But thanks for pointing that out. I was actually re-writing the entire Console, but I can't make further progress because I'm having other issues with Cosmos.

Arawn-Davies commented 7 years ago

@jp2masa I think this possibly confirms it was caused by the extended ASCII PR merge, @legitsoulja how's progress on the rewrite?