Hello community,
I am pretty new to c# and i have decided to use COSMOS to build a basic operating system,
However, all my code compiles correctly but there is one problem, when i type shutdown, the system hangs, it does not shutdown and the white cursor continues flashing but i cannot type anything. ideally i would like it so that the system automatically powers down after the shutdown command is issued. My code 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("BAILEYTEK OS 2012 BETA");
Console.Beep(1000, 1000);
// Start of session
Console.WriteLine("SESSION START");
// read command
command:
Console.Write("-->");
while (true)
{
string command = Console.ReadLine();
switch (command)
// Base commands
{
case "about":
{
Console.WriteLine("BAILEYTEK operating system 2012 beta developed by cyberdan123");
Console.WriteLine("Support email: cyberdan1234@live.co.uk");
goto command;
}
case "clear":
{
Console.Clear();
Console.WriteLine("BAILEYTEK OS 2012 BETA");
goto command;
}
case "shutdown":
{
Cosmos.Sys.Deboot.ShutDown();
break;
}
// help
case "help":
{
Console.Clear();
Console.WriteLine("BAILEYTEK OS 2012 BETA");
Console.WriteLine("User Guide");
Console.WriteLine("================================================================================");
Console.WriteLine("ABOUT : Display information about system.");
Console.WriteLine("CLEAR : Clear user interface.");
Console.WriteLine("HELP : Display list of commands.");
Console.WriteLine("START : Load main program");
Console.WriteLine("SHUTDOWN : End current session and power off machine");
Console.WriteLine("");
Console.WriteLine("================================================================================");
goto command;
}
//main program
case "start":
{
Console.WriteLine("Main program will exist here but i haven't planned it yet.");
goto command;
}
//if command is incorrect
default:
{
Console.WriteLine("Command Invalid");
goto command;
}
;
}
}
}
}
}
Could anyone please suggest a way to fix this error,
Thanks in advance
Cyberdan :)