NAsm error with c# and Cosmos
-
18-03-2022 - |
Frage
I am trying to build a small operating system using c# and Cosmos
At fisrt this went pretty good only from one moment to the other it stoped working and gave me the following error:
Error occurred while invoking NAsm.
OSBoot.asm Line: 241424 Code: push dword System_Void__System_IO_Stream_Dispose__
OSBoot.asm Line: 242633 Code: push dword System_Void__System_IO_Stream_Dispose__ t OSBoot.asm Line: 247640 Code: push dword System_Void__System_IO_Stream_Dispose__
OSBoot.asm Line: 248618 Code: push dword System_Void__System_Collections_Generic_List_1_Enumerator__Commands_ICommand_ICommandBase_Dispose_
I even installed a new installation of Microsoft Visual studio with cosmos on a new system and started over from scratch, at first it worked but asgain withoud any chage it stopped working
using System;
using Commands;
using Sys = Cosmos.System;
namespace OS
{
public class Kernel : Sys.Kernel
{
private Env SysEnv { get; set; }
private InputHandeler InputHandler { get; set; }
protected override void BeforeRun()
{
Console.WriteLine("Creating Enviriment...");
SysEnv = new Env();
InputHandler = new InputHandeler(new CommandLister());
Console.WriteLine("Enviriment build");
Console.Clear();
Console.WriteLine("Os booted successfully.");
}
protected override void Run()
{
Console.Write(SysEnv.ConsolCommandPrefix);
var input = Console.ReadLine();
try
{
InputHandler.ExecuteInput(input);
} catch(Exception)
{
//TODO good exeption and the use of it
}
}
}
}
Env class
namespace OS
{
public class Env
{
public string CurrentUser { get; set; }
public string CurrnetDir { get; set; }
private string prefix;
public string ConsolCommandPrefix
{
get { return CurrentUser + "@" + CurrnetDir + prefix; }
set { prefix = value; }
}
public Env()
{
ConsolCommandPrefix = "> ";
CurrentUser = "Admin";
CurrnetDir = "/";
}
}
}
CommandLister class
using System;
using System.Collections.Generic;
using Commands.Command;
using Commands.Command.SystemCommands;
using Commands.ICommand;
namespace Commands
{
public class CommandLister
{
private List<ICommandBase> KnownCommands { get; set; }
private Unkown UnkownCommand { get; set; }
public CommandLister()
{
KnownCommands = new List<ICommandBase>();
addCommand(new Help());
UnkownCommand = new Unkown();
}
public void addCommand(ICommandBase command)
{
KnownCommands.Add(command);
}
public ICommandBase getCommand(String input)
{
foreach (var command in KnownCommands)
{
if(true)
{
return command;
}
}
return UnkownCommand;
}
}
}
The other classes only contain some text and only print something to the Console
I have two questions: - What is causing this - How can i solve this problem
Edit: i tried it again ron an other OS (i used vista the first time), this time i used Windows 7. The same thing happend at first it worked (i started from scratch again..) but after a few builds and runs it somehow broke again. even when undoing the changes i made. it wont build anymore.
Kind regards,
Edo Post
Keine korrekte Lösung