Cosmos/source2/Users/Kudzu/HelloWorld/Program.cs
kudzu_cp f80975fb22
2009-07-26 03:11:38 +00:00

38 lines
No EOL
1.3 KiB
C#

using System;
using System.Reflection;
using Cosmos.IL2CPU;
using Cosmos.IL2CPU.X86;
using S = Cosmos.Hardware.TextScreen;
namespace HelloWorld {
class Program {
#region Cosmos Builder logic
// Most users wont touch this. This will call the Cosmos Build tool
[STAThread]
static void Main(string[] args) {
//Indy.IL2CPU.Engine.Execute()
//TODO: Move new build logic into new sort.
// Build stuff is all UI, launching QEMU, making ISO etc.
// IL2CPU should only contain scanning and assembling of binary files
var xScanner = new ILScanner(typeof(ILOpX86));
var xEntryPoint = typeof(Program).GetMethod("Init", BindingFlags.Public | BindingFlags.Static);
xScanner.Execute(xEntryPoint);
}
#endregion
// Main entry point of the kernel
public static void Init() {
var xBoot = new Cosmos.Sys.Boot();
xBoot.Execute();
Console.BackgroundColor = ConsoleColor.Green;
//TODO: What is this next line for?
S.ReallyClearScreen();
Console.WriteLine("Congratulations! You just booted C# code.");
Console.WriteLine("Edit Program.cs to create your own Operating System.");
Console.WriteLine("Press a key to shutdown...");
Console.Read();
Cosmos.Sys.Deboot.ShutDown();
}
}
}