Hi, I'm new to this forum and would like to ask a question relating to C#. I am trying to make my custom OS, and shutting it down, but I am encountering a problem. Here is what I have so far:
using System;
using Cosmos.Compiler.Builder;
namespace CosmosBoot1
{
class Program
{
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args)
{
BuildUI.Run();
}
#endregion
// Main entry point of the kernel
public static void Init()
{
var xBoot = new Cosmos.Sys.Boot();
xBoot.Execute();
Console.WriteLine("XCube V0.01");
Console.WriteLine("Type help for help");
while (true)
{
string command = Console.ReadLine();
switch (command)
{
case "shutdown":
{
goto shutdown;
break;
}
case "help":
{
Console.WriteLine("shutdown---Shuts down XCube");
Console.WriteLine("manual---Displays XCube manual");
Console.WriteLine("help---Displays help");
Console.WriteLine("reboot---Reboots XCube");
break;
}
case "manual":
{
Console.WriteLine("Note: In Virtual Machines, the shutdown command simply hangs the machine, and does not close the window.");
break;
}
case "reboot":
{
Cosmos.Sys.Deboot.Reboot();
break;
}
default:
{
Console.WriteLine("No such command");
command = null;
break;
}
}
}
}
}
}
When I type in "shutdown", nothing happens and I can continue using other commands. When I type in "reboot" however, the input method freezes and I can no longer input any command, but my Virtual Machine does not reboot and instead shows a blinking cursor where I left off. I think this would be in the right forum, I'm not sure. Anyone HELP!!! Thanks in advance.