Cosmos基本示例无法运行

时间:2018-10-17 11:40:41

标签: c# visual-studio operating-system cosmos

我正在尝试使用C#入门Cosmos。我安装了Visual Studio 2017和Cosmos用户工具包。 在youtube上的许多教程中,我都看到只要按下“运行”按钮,VMWare播放器就会启动。

但是,在我的情况下,出现以下错误: “具有Output类库类的项目无法直接启动。”

Error screenshot

我的代码非常简单,这是文档中给出的基本示例。请帮我解决这个问题。

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

namespace CosmosKernel2
{
    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);
        }
    }
}

1 个答案:

答案 0 :(得分:0)

Cosmos是一个内核。您不能“在Windows上运行内核”。如果要直接在Visual Studio中运行cosmos内核,则需要一个虚拟机。

Cosmos开箱即用使用Vmware。确保已安装。 另外,您也可以使用VirtualBox,我个人也可以在VirtualBox上运行它。

您也可以在带有引导加载程序的实际计算机上运行它,例如Grub。您可以通过这种方式双重引导到Windows或自己的内核中。

Cosmos在此处提供了说明:https://github.com/CosmosOS/Cosmos/wiki/Deployment

设置cosmos作为启动项目生成的启动来运行它。