diff --git a/Build.sln b/Build.sln
index abf3afb7d..2c3cc0f32 100644
--- a/Build.sln
+++ b/Build.sln
@@ -103,6 +103,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test Runner", "Test Runner"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.TestRunner.TestController", "Tests\Cosmos.TestRunner.TestController\Cosmos.TestRunner.TestController.csproj", "{2EEC1BF8-758F-4D9D-B063-8CF005468B24}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.System3_Plugs", "source\Kernel\Cosmos.System3_Plugs\Cosmos.System3_Plugs.csproj", "{0E642B40-333B-4F4D-AD32-A83350E7938F}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -237,6 +239,10 @@ Global
{2EEC1BF8-758F-4D9D-B063-8CF005468B24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2EEC1BF8-758F-4D9D-B063-8CF005468B24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2EEC1BF8-758F-4D9D-B063-8CF005468B24}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0E642B40-333B-4F4D-AD32-A83350E7938F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0E642B40-333B-4F4D-AD32-A83350E7938F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0E642B40-333B-4F4D-AD32-A83350E7938F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0E642B40-333B-4F4D-AD32-A83350E7938F}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Demos/GuessG3/Boot.cs b/Demos/GuessG3/Boot.cs
index cf50a7bae..55a59ccf1 100644
--- a/Demos/GuessG3/Boot.cs
+++ b/Demos/GuessG3/Boot.cs
@@ -7,7 +7,6 @@ namespace KernelGen3 {
public class Boot : Sys.Boot {
protected override void Run() {
- //Console.WriteLine("Booted Kernel Gen3!");
Cosmos.CPU.Temp.ShowText();
while (true) {
diff --git a/Demos/GuessG3/BootGen3.Cosmos b/Demos/GuessG3/GuessBootGen3.Cosmos
similarity index 100%
rename from Demos/GuessG3/BootGen3.Cosmos
rename to Demos/GuessG3/GuessBootGen3.Cosmos
diff --git a/Demos/GuessG3/KernelGen3.csproj b/Demos/GuessG3/GuessKernelGen3.csproj
similarity index 100%
rename from Demos/GuessG3/KernelGen3.csproj
rename to Demos/GuessG3/GuessKernelGen3.csproj
diff --git a/Kernel.sln b/Kernel.sln
index cd0f09525..3eb40c06a 100644
--- a/Kernel.sln
+++ b/Kernel.sln
@@ -72,9 +72,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "90 Application", "90 Applic
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "99 Shared", "99 Shared", "{EFB323E2-300A-4BC8-9A61-9E1D0E0C1FCD}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KernelGen3", "Demos\GuessG3\KernelGen3.csproj", "{9E58E949-7B71-45ED-9610-11DA287EE933}"
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GuessKernelGen3", "Demos\GuessG3\GuessKernelGen3.csproj", "{9E58E949-7B71-45ED-9610-11DA287EE933}"
EndProject
-Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "BootGen3", "Demos\GuessG3\BootGen3.Cosmos", "{A262FBF6-211A-45D5-A201-F7DA2B135007}"
+Project("{471EC4BB-E47E-4229-A789-D1F5F83B52D4}") = "GuessBootGen3", "Demos\GuessG3\GuessBootGen3.Cosmos", "{A262FBF6-211A-45D5-A201-F7DA2B135007}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Assembler", "source\Cosmos.Assembler\Cosmos.Assembler.csproj", "{F0860B7D-3FF7-4E2A-AC10-18E87ADD62A3}"
EndProject
@@ -88,6 +88,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Build.Common", "sour
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Debug.Symbols", "source\Cosmos.Debug.Symbols\Cosmos.Debug.Symbols.csproj", "{4E9B8F31-AEA0-402D-9B3A-223100F2156D}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.System3_Plugs", "source\Kernel\Cosmos.System3_Plugs\Cosmos.System3_Plugs.csproj", "{BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -319,6 +321,14 @@ Global
{4E9B8F31-AEA0-402D-9B3A-223100F2156D}.Release|Any CPU.Build.0 = Release|Any CPU
{4E9B8F31-AEA0-402D-9B3A-223100F2156D}.Release|x86.ActiveCfg = Release|Any CPU
{4E9B8F31-AEA0-402D-9B3A-223100F2156D}.Release|x86.Build.0 = Release|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Debug|x86.Build.0 = Debug|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Release|x86.ActiveCfg = Release|Any CPU
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -361,5 +371,6 @@ Global
{47F9D446-ACD4-489A-AD6D-A46A19247E2F} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78}
{67FD9912-CE63-4EB2-880C-F4F0D9AED7CA} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78}
{4E9B8F31-AEA0-402D-9B3A-223100F2156D} = {3CD3D9A5-9BC5-4FEB-8D63-4D535C0ABB78}
+ {BEEDA0BE-0105-40BF-BD8D-7F6A2BC3B05C} = {2E1A72C6-5DD4-4AB9-92A1-6BB44D9B1009}
EndGlobalSection
EndGlobal
diff --git a/source/Cosmos.Build.Builder/CosmosTask.cs b/source/Cosmos.Build.Builder/CosmosTask.cs
index 339613891..389a31708 100644
--- a/source/Cosmos.Build.Builder/CosmosTask.cs
+++ b/source/Cosmos.Build.Builder/CosmosTask.cs
@@ -274,8 +274,8 @@ namespace Cosmos.Build.Builder {
}
private void CompileCosmos() {
- string xVSIPDir = Path.Combine(mCosmosPath, "Build", "VSIP");
- string xPackagesDir = Path.Combine(xVSIPDir, "KernelPackages");
+ string xVsipDir = Path.Combine(mCosmosPath, "Build", "VSIP");
+ string xNugetPkgDir = Path.Combine(xVsipDir, "KernelPackages");
string xVersion = "1.0.2";
if (!App.IsUserKit) {
@@ -297,28 +297,29 @@ namespace Cosmos.Build.Builder {
MSBuild(Path.Combine(mCosmosPath, @"Build.sln"), "Debug");
Section("Publish Tools");
- Publish(Path.Combine(mSourcePath, "Cosmos.Build.MSBuild"), Path.Combine(xVSIPDir, "MSBuild"));
- Publish(Path.Combine(mSourcePath, "IL2CPU"), Path.Combine(xVSIPDir, "IL2CPU"));
- Publish(Path.Combine(mSourcePath, "XSharp.Compiler"), Path.Combine(xVSIPDir, "XSharp"));
- Publish(Path.Combine(mCosmosPath, "Tools", "NASM"), Path.Combine(xVSIPDir, "NASM"));
+ Publish(Path.Combine(mSourcePath, "Cosmos.Build.MSBuild"), Path.Combine(xVsipDir, "MSBuild"));
+ Publish(Path.Combine(mSourcePath, "IL2CPU"), Path.Combine(xVsipDir, "IL2CPU"));
+ Publish(Path.Combine(mSourcePath, "XSharp.Compiler"), Path.Combine(xVsipDir, "XSharp"));
+ Publish(Path.Combine(mCosmosPath, "Tools", "NASM"), Path.Combine(xVsipDir, "NASM"));
Section("Pack Kernel");
//
- Pack(Path.Combine(mSourcePath, "Cosmos.Common"), xPackagesDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.Common"), xNugetPkgDir, xVersion);
//
- Pack(Path.Combine(mSourcePath, "Cosmos.Core"), xPackagesDir, xVersion);
- Pack(Path.Combine(mSourcePath, "Cosmos.Core_Plugs"), xPackagesDir, xVersion);
- Pack(Path.Combine(mSourcePath, "Cosmos.Core_Asm"), xPackagesDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.Core"), xNugetPkgDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.Core_Plugs"), xNugetPkgDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.Core_Asm"), xNugetPkgDir, xVersion);
//
- Pack(Path.Combine(mSourcePath, "Cosmos.HAL"), xPackagesDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.HAL"), xNugetPkgDir, xVersion);
//
- Pack(Path.Combine(mSourcePath, "Cosmos.System"), xPackagesDir, xVersion);
- Pack(Path.Combine(mSourcePath, "Cosmos.System_Plugs"), xPackagesDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.System"), xNugetPkgDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.System_Plugs"), xNugetPkgDir, xVersion);
+ //Pack(Path.Combine(Path.Combine(mSourcePath, "Kernel"), "Cosmos.System3_Plugs"), xNugetPkgDir, xVersion);
//
- Pack(Path.Combine(mSourcePath, "Cosmos.Debug.Kernel"), xPackagesDir, xVersion);
- Pack(Path.Combine(mSourcePath, "Cosmos.Debug.Kernel.Plugs.Asm"), xPackagesDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.Debug.Kernel"), xNugetPkgDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.Debug.Kernel.Plugs.Asm"), xNugetPkgDir, xVersion);
//
- Pack(Path.Combine(mSourcePath, "Cosmos.IL2CPU.API"), xPackagesDir, xVersion);
+ Pack(Path.Combine(mSourcePath, "Cosmos.IL2CPU.API"), xNugetPkgDir, xVersion);
}
private void CopyTemplates() {
diff --git a/source/Cosmos.Build.MSBuild/Cosmos.targets b/source/Cosmos.Build.MSBuild/Cosmos.targets
index f8d7d59b5..8ce984d2d 100644
--- a/source/Cosmos.Build.MSBuild/Cosmos.targets
+++ b/source/Cosmos.Build.MSBuild/Cosmos.targets
@@ -27,6 +27,7 @@
+
diff --git a/source/Kernel/Cosmos.System/Boot.cs b/source/Kernel/Cosmos.System/Boot.cs
index 3a05f59a8..2f81018c4 100644
--- a/source/Kernel/Cosmos.System/Boot.cs
+++ b/source/Kernel/Cosmos.System/Boot.cs
@@ -5,6 +5,7 @@ using System.Text;
namespace Cosmos.System {
public abstract class Boot {
+ // IL2CPU finds this by name and this is where Cosmos takes the hand off from the bootloader.
public void EntryPoint() {
Run();
}
diff --git a/source/Kernel/Cosmos.System3_Plugs/ConsoleImpl.cs b/source/Kernel/Cosmos.System3_Plugs/ConsoleImpl.cs
new file mode 100644
index 000000000..32b6fba14
--- /dev/null
+++ b/source/Kernel/Cosmos.System3_Plugs/ConsoleImpl.cs
@@ -0,0 +1,815 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Cosmos.IL2CPU.API;
+
+namespace Cosmos.System_Plugs.System
+{
+ [Plug(Target = typeof (global::System.Console))]
+ public static class ConsoleImpl
+ {
+ //private static ConsoleColor mForeground = ConsoleColor.White;
+ //private static ConsoleColor mBackground = ConsoleColor.Black;
+
+ //private static Cosmos.System.Console GetConsole()
+ //{
+ // return mFallbackConsole;
+ //}
+
+ //public static ConsoleColor get_BackgroundColor()
+ //{
+ // return mBackground;
+ //}
+
+ //public static void set_BackgroundColor(ConsoleColor value)
+ //{
+ // mBackground = value;
+ // //Cosmos.HAL.Global.TextScreen.SetColors(mForeground, mBackground);
+ // if (GetConsole() != null) GetConsole().Background = value;
+ //}
+
+ //public static int get_BufferHeight()
+ //{
+ // WriteLine("Not implemented: get_BufferHeight");
+ // return -1;
+ //}
+
+ //public static void set_BufferHeight(int aHeight)
+ //{
+ // WriteLine("Not implemented: set_BufferHeight");
+ //}
+
+ //public static int get_BufferWidth()
+ //{
+ // WriteLine("Not implemented: get_BufferWidth");
+ // return -1;
+ //}
+
+ //public static void set_BufferWidth(int aWidth)
+ //{
+ // WriteLine("Not implemented: set_BufferWidth");
+ //}
+
+ //public static bool get_CapsLock()
+ //{
+ // return Global.CapsLock;
+ //}
+
+ //public static int get_CursorLeft()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return 0;
+ // }
+ // return GetConsole().X;
+ //}
+
+ //public static void set_CursorLeft(int x)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+
+ // if (x < get_WindowWidth())
+ // {
+ // xConsole.X = x;
+ // }
+ // else
+ // {
+ // WriteLine("x must be lower than the console width!");
+ // }
+ //}
+
+ //public static int get_CursorSize()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return 0;
+ // }
+ // return xConsole.CursorSize;
+ //}
+
+ //public static void set_CursorSize(int aSize)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // xConsole.CursorSize = aSize;
+ //}
+
+ //public static int get_CursorTop()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return 0;
+ // }
+ // return GetConsole().Y;
+ //}
+
+ //public static void set_CursorTop(int y)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+
+ // if (y < get_WindowHeight())
+ // {
+ // xConsole.Y = y;
+ // }
+ // else
+ // {
+ // WriteLine("y must be lower than the console height!");
+ // }
+ //}
+
+ //public static bool get_CursorVisible()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // return false;
+ // }
+ // return GetConsole().CursorVisible;
+ //}
+
+ //public static void set_CursorVisible(bool value)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // xConsole.CursorVisible = value;
+ //}
+
+
+ ////public static TextWriter get_Error() {
+ //// WriteLine("Not implemented: get_Error");
+ //// return null;
+ ////}
+
+ //public static ConsoleColor get_ForegroundColor()
+ //{
+ // return mForeground;
+ //}
+
+ //public static void set_ForegroundColor(ConsoleColor value)
+ //{
+ // mForeground = value;
+ // //Cosmos.HAL.Global.TextScreen.SetColors(mForeground, mBackground);
+ // if (GetConsole() != null) GetConsole().Foreground = value;
+ //}
+
+ ////public static TextReader get_In()
+ ////{
+ //// WriteLine("Not implemented: get_In");
+ //// return null;
+ ////}
+
+ //public static Encoding get_InputEncoding()
+ //{
+ // WriteLine("Not implemented: get_InputEncoding");
+ // return null;
+ //}
+
+ //public static void set_InputEncoding(Encoding value)
+ //{
+ // WriteLine("Not implemented: set_InputEncoding");
+ //}
+
+ //public static bool get_KeyAvailable()
+ //{
+ // WriteLine("Not implemented: get_KeyAvailable");
+ // return false;
+ //}
+
+ //public static int get_LargestWindowHeight()
+ //{
+ // WriteLine("Not implemented: get_LargestWindowHeight");
+ // return -1;
+ //}
+
+ //public static int get_LargestWindowWidth()
+ //{
+ // WriteLine("Not implemented: get_LargestWindowWidth");
+ // return -1;
+ //}
+
+ //public static bool get_NumberLock()
+ //{
+ // return Global.NumLock;
+ //}
+
+ ////public static TextWriter get_Out() {
+ //// WriteLine("Not implemented: get_Out");
+ //// return null;
+ ////}
+
+ //public static Encoding get_OutputEncoding()
+ //{
+ // WriteLine("Not implemented: get_OutputEncoding");
+ // return null;
+ //}
+
+ //public static void set_OutputEncoding(Encoding value)
+ //{
+ // WriteLine("Not implemented: set_OutputEncoding");
+ //}
+
+ //public static string get_Title()
+ //{
+ // WriteLine("Not implemented: get_Title");
+ // return string.Empty;
+ //}
+
+ //public static void set_Title(string value)
+ //{
+ // WriteLine("Not implemented: set_Title");
+ //}
+
+ //public static bool get_TreatControlCAsInput()
+ //{
+ // WriteLine("Not implemented: get_TreatControlCAsInput");
+ // return false;
+ //}
+
+ //public static void set_TreatControlCAsInput(bool value)
+ //{
+ // WriteLine("Not implemented: set_TreatControlCAsInput");
+ //}
+
+ //public static int get_WindowHeight()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return 25;
+ // }
+ // return GetConsole().Rows;
+ //}
+
+ //public static void set_WindowHeight(int value)
+ //{
+ // WriteLine("Not implemented: set_WindowHeight");
+ //}
+
+ //public static int get_WindowLeft()
+ //{
+ // WriteLine("Not implemented: get_WindowLeft");
+ // return -1;
+ //}
+
+ //public static void set_WindowLeft(int value)
+ //{
+ // WriteLine("Not implemented: set_WindowLeft");
+ //}
+
+ //public static int get_WindowTop()
+ //{
+ // WriteLine("Not implemented: get_WindowTop");
+ // return -1;
+ //}
+
+ //public static void set_WindowTop(int value)
+ //{
+ // WriteLine("Not implemented: set_WindowTop");
+ //}
+
+ //public static int get_WindowWidth()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return 85;
+ // }
+ // return GetConsole().Cols;
+ //}
+
+ //public static void set_WindowWidth(int value)
+ //{
+ // WriteLine("Not implemented: set_WindowWidth");
+ //}
+
+ //// Beep() is pure CIL
+
+ //public static void Beep(int aFrequency, int aDuration)
+ //{
+ // if (aFrequency < 37 || aFrequency > 32767)
+ // {
+ // throw new ArgumentOutOfRangeException("Frequency must be between 37 and 32767Hz");
+ // }
+
+ // if (aDuration <= 0)
+ // {
+ // throw new ArgumentOutOfRangeException("Duration must be more than 0");
+ // }
+
+ // WriteLine("Not implemented: Beep");
+
+ // //var xPIT = Hardware.Global.PIT;
+ // //xPIT.EnableSound();
+ // //xPIT.T2Frequency = (uint)aFrequency;
+ // //xPIT.Wait((uint)aDuration);
+ // //xPIT.DisableSound();
+ //}
+
+ ////TODO: Console uses TextWriter - intercept and plug it instead
+ //public static void Clear()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // GetConsole().Clear();
+ //}
+
+ //// MoveBufferArea(int, int, int, int, int, int) is pure CIL
+
+ //public static void MoveBufferArea(int sourceLeft, int sourceTop, int sourceWidth, int sourceHeight,
+ // int targetLeft, int targetTop, Char sourceChar, ConsoleColor sourceForeColor, ConsoleColor sourceBackColor)
+ //{
+ // WriteLine("Not implemented: MoveBufferArea");
+ //}
+
+ ////public static Stream OpenStandardError() {
+ //// WriteLine("Not implemented: OpenStandardError");
+ ////}
+
+ ////public static Stream OpenStandardError(int bufferSize) {
+ //// WriteLine("Not implemented: OpenStandardError");
+ ////}
+
+ ////public static Stream OpenStandardInput(int bufferSize) {
+ //// WriteLine("Not implemented: OpenStandardInput");
+ ////}
+
+ ////public static Stream OpenStandardInput() {
+ //// WriteLine("Not implemented: OpenStandardInput");
+ ////}
+
+ ////public static Stream OpenStandardOutput(int bufferSize) {
+ //// WriteLine("Not implemented: OpenStandardOutput");
+ ////}
+
+ ////public static Stream OpenStandardOutput() {
+ //// WriteLine("Not implemented: OpenStandardOutput");
+ ////}
+
+ //public static int Read()
+ //{
+ // // TODO special cases, if needed, that returns -1
+ // KeyEvent xResult;
+
+ // if (KeyboardManager.TryReadKey(out xResult))
+ // {
+ // return xResult.KeyChar;
+ // }
+ // else
+ // {
+ // return -1;
+ // }
+ //}
+
+ //public static String ReadLine()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return null;
+ // }
+ // List chars = new List(32);
+ // KeyEvent current;
+ // int currentCount = 0;
+
+ // while ((current = KeyboardManager.ReadKey()).Key != ConsoleKeyEx.Enter)
+ // {
+ // if (current.Key == ConsoleKeyEx.NumEnter) break;
+ // //Check for "special" keys
+ // if (current.Key == ConsoleKeyEx.Backspace) // Backspace
+ // {
+ // if (currentCount > 0)
+ // {
+ // int curCharTemp = GetConsole().X;
+ // chars.RemoveAt(currentCount - 1);
+ // GetConsole().X = GetConsole().X - 1;
+
+ // //Move characters to the left
+ // for (int x = currentCount - 1; x < chars.Count; x++)
+ // {
+ // Write(chars[x]);
+ // }
+
+ // Write(' ');
+
+ // GetConsole().X = curCharTemp - 1;
+
+ // currentCount--;
+ // }
+ // continue;
+ // }
+ // else if (current.Key == ConsoleKeyEx.LeftArrow)
+ // {
+ // if (currentCount > 0)
+ // {
+ // GetConsole().X = GetConsole().X - 1;
+ // currentCount--;
+ // }
+ // continue;
+ // }
+ // else if (current.Key == ConsoleKeyEx.RightArrow)
+ // {
+ // if (currentCount < chars.Count)
+ // {
+ // GetConsole().X = GetConsole().X + 1;
+ // currentCount++;
+ // }
+ // continue;
+ // }
+
+ // if (current.KeyChar == '\0') continue;
+
+ // //Write the character to the screen
+ // if (currentCount == chars.Count)
+ // {
+ // chars.Add(current.KeyChar);
+ // Write(current.KeyChar);
+ // currentCount++;
+ // }
+ // else
+ // {
+ // //Insert the new character in the correct location
+ // //For some reason, List.Insert() doesn't work properly
+ // //so the character has to be inserted manually
+ // List temp = new List();
+
+ // for (int x = 0; x < chars.Count; x++)
+ // {
+ // if (x == currentCount)
+ // {
+ // temp.Add(current.KeyChar);
+ // }
+
+ // temp.Add(chars[x]);
+ // }
+
+ // chars = temp;
+
+ // //Shift the characters to the right
+ // for (int x = currentCount; x < chars.Count; x++)
+ // {
+ // Write(chars[x]);
+ // }
+
+ // GetConsole().X -= (chars.Count - currentCount) - 1;
+ // currentCount++;
+ // }
+ // }
+ // WriteLine();
+
+ // char[] final = chars.ToArray();
+ // return new string(final);
+ //}
+
+ //public static void ResetColor()
+ //{
+ // set_BackgroundColor(ConsoleColor.Black);
+ // set_ForegroundColor(ConsoleColor.White);
+ //}
+
+ //public static void SetBufferSize(int width, int height)
+ //{
+ // WriteLine("Not implemented: SetBufferSize");
+ //}
+
+ //public static void SetCursorPosition(int left, int top)
+ //{
+ // set_CursorLeft(left);
+ // set_CursorTop(top);
+ //}
+
+ ////public static void SetError(TextWriter newError) {
+ //// WriteLine("Not implemented: SetError");
+ ////}
+
+ ////public static void SetIn(TextReader newIn) {
+ //// WriteLine("Not implemented: SetIn");
+ ////}
+
+ ////public static void SetOut(TextWriter newOut) {
+ //// WriteLine("Not implemented: SetOut");
+ ////}
+
+ //public static void SetWindowPosition(int left, int top)
+ //{
+ // WriteLine("Not implemented: SetWindowPosition");
+ //}
+
+ //public static void SetWindowSize(int width, int height)
+ //{
+ // WriteLine("Not implemented: SetWindowSize");
+ //}
+
+ //#region Write
+
+ //public static void Write(bool aBool)
+ //{
+ // Write(aBool.ToString());
+ //}
+
+ //public static void Write(char aChar)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // GetConsole().WriteChar(aChar);
+ //}
+
+ //public static void Write(char[] aBuffer)
+ //{
+ // Write(aBuffer, 0, aBuffer.Length);
+ //}
+
+ ////public static void Write(decimal aBuffer) {
+ //// Write("No Decimal.ToString()");
+ ////}
+
+ //public static void Write(double aDouble)
+ //{
+ // Write(aDouble.ToString());
+ //}
+
+ //public static void Write(float aFloat)
+ //{
+ // Write(aFloat.ToString());
+ //}
+
+ //public static void Write(int aInt)
+ //{
+ // Write(aInt.ToString());
+ //}
+
+ //public static void Write(long aLong)
+ //{
+ // Write(aLong.ToString());
+ //}
+
+ //public static void Write(object value)
+ //{
+ // if (value != null)
+ // {
+ // Write(value.ToString());
+ // }
+ //}
+
+ //public static void Write(string aText)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // GetConsole().Write(aText);
+ //}
+
+ //public static void Write(uint aInt)
+ //{
+ // Write(aInt.ToString());
+ //}
+
+ //public static void Write(ulong aLong)
+ //{
+ // Write(aLong.ToString());
+ //}
+
+ //public static void Write(string format, object arg0)
+ //{
+ // WriteLine("Not implemented: Write");
+ //}
+
+ //public static void Write(string format, params object[] arg)
+ //{
+ // WriteLine("Not implemented: Write");
+ //}
+
+ //public static void Write(char[] aBuffer, int aIndex, int aCount)
+ //{
+ // if (aBuffer == null)
+ // {
+ // throw new ArgumentNullException("aBuffer");
+ // }
+ // if (aIndex < 0)
+ // {
+ // throw new ArgumentOutOfRangeException("aIndex");
+ // }
+ // if (aCount < 0)
+ // {
+ // throw new ArgumentOutOfRangeException("aCount");
+ // }
+ // if ((aBuffer.Length - aIndex) < aCount)
+ // {
+ // throw new ArgumentException();
+ // }
+ // for (int i = 0; i < aCount; i++)
+ // {
+ // Write(aBuffer[aIndex + i]);
+ // }
+ //}
+
+ //public static void Write(string format, object arg0, object arg1)
+ //{
+ // WriteLine("Not implemented: Write");
+ //}
+
+ //public static void Write(string format, object arg0, object arg1, object arg2)
+ //{
+ // WriteLine("Not implemented: Write");
+ //}
+
+ //public static void Write(string format, object arg0, object arg1, object arg2, object arg3)
+ //{
+ // WriteLine("Not implemented: Write");
+ //}
+
+ ////You'd expect this to be on System.Console wouldn't you? Well, it ain't so we just rely on Write(object value)
+ ////public static void Write(byte aByte) {
+ //// Write(aByte.ToString());
+ ////}
+
+ //#endregion
+
+ //public static void WriteLine()
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(bool aBool)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // Write(aBool.ToString());
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(char aChar)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // Write(aChar);
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(char[] aBuffer)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // Write(aBuffer, 0, aBuffer.Length);
+ // GetConsole().NewLine();
+ //}
+
+ ////public static void WriteLine(decimal aDecimal) {
+ //// Write(aDecimal);
+ //// Global.Console.NewLine();
+ ////}
+
+ //public static void WriteLine(double aDouble)
+ //{
+ // Write(aDouble.ToString());
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(float aFloat)
+ //{
+ // Write(aFloat.ToString());
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(int aInt)
+ //{
+ // Write(aInt.ToString());
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(long aLong)
+ //{
+ // Write(aLong.ToString());
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(object value)
+ //{
+ // if (value != null)
+ // {
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // Write(value.ToString());
+ // xConsole.NewLine();
+ // }
+ //}
+
+ public static void WriteLine(string aText) {
+ }
+
+ //public static void WriteLine(uint aInt)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // Write(aInt.ToString());
+ // xConsole.NewLine();
+ //}
+
+ //public static void WriteLine(ulong aLong)
+ //{
+ // var xConsole = GetConsole();
+ // if (xConsole == null)
+ // {
+ // // for now:
+ // return;
+ // }
+ // Write(aLong.ToString());
+ // xConsole.NewLine();
+ //}
+
+ //public static void WriteLine(string format, object arg0)
+ //{
+ // WriteLine("Not implemented: WriteLine");
+ //}
+
+ //public static void WriteLine(string format, params object[] arg)
+ //{
+ // WriteLine("Not implemented: WriteLine");
+ //}
+
+ //public static void WriteLine(char[] aBuffer, int aIndex, int aCount)
+ //{
+ // Write(aBuffer, aIndex, aCount);
+ // GetConsole().NewLine();
+ //}
+
+ //public static void WriteLine(string format, object arg0, object arg1)
+ //{
+ // WriteLine("Not implemented: WriteLine");
+ //}
+
+ //public static void WriteLine(string format, object arg0, object arg1, object arg2)
+ //{
+ // WriteLine("Not implemented: WriteLine");
+ //}
+
+ //public static void WriteLine(string format, object arg0, object arg1, object arg2, object arg3)
+ //{
+ // WriteLine("Not implemented: WriteLine");
+ //}
+
+ }
+}
diff --git a/source/Kernel/Cosmos.System3_Plugs/Cosmos.System3_Plugs.csproj b/source/Kernel/Cosmos.System3_Plugs/Cosmos.System3_Plugs.csproj
new file mode 100644
index 000000000..2baa283b2
--- /dev/null
+++ b/source/Kernel/Cosmos.System3_Plugs/Cosmos.System3_Plugs.csproj
@@ -0,0 +1,19 @@
+
+
+
+ netstandard1.5
+ True
+ Cosmos.snk
+ Cosmos
+ Cosmos
+
+
+
+
+
+
+
+
+
+
+
diff --git a/source/Kernel/Cosmos.System3_Plugs/Cosmos.snk b/source/Kernel/Cosmos.System3_Plugs/Cosmos.snk
new file mode 100644
index 000000000..68808d392
Binary files /dev/null and b/source/Kernel/Cosmos.System3_Plugs/Cosmos.snk differ