DilupaH
DilupaH

Reputation: 11

Cosmos basic example does not run

I am trying to get started with Cosmos using C#. I installed Visual studio 2017, and Cosmos user kit. On many tutorials on youtube, I have seen that the VMWare player starts whenever they press the "run" button.

However, in my case, I get the following error: "A project with an Output type of class library cannot be started directly."

Error screenshot

My code is really simple, and it is the basic example given in the documentation. Please help me to solve this issue.

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);
        }
    }
}

Upvotes: 0

Views: 1495

Answers (1)

fstam
fstam

Reputation: 699

Cosmos is a kernel. You can't "run a kernel on windows". If you want to run your cosmos kernel straight out of Visual Studio you need a virtual machine.

Cosmos uses Vmware out of the box. Make sure you have it installed. Alternatively you can use VirtualBox, I personally got it to run on that too.

You can also run it on an actual machine with a bootloader, like Grub. You can dual boot into windows or your own kernel that way.

Cosmos has instructions here: https://github.com/CosmosOS/Cosmos/wiki/Deployment

Set the boot that cosmos generates as startup project to run it.

Upvotes: 2

Related Questions