diff --git a/source/Cosmos/Cosmos.Hardware/Old/Screen/Text.cs b/source/Cosmos/Cosmos.Hardware/Old/Screen/Text.cs
index 5db9c2875..ded27a5c2 100644
--- a/source/Cosmos/Cosmos.Hardware/Old/Screen/Text.cs
+++ b/source/Cosmos/Cosmos.Hardware/Old/Screen/Text.cs
@@ -10,7 +10,7 @@ namespace Cosmos.Hardware.Screen {
private static byte Color = 7;
public static unsafe void Clear() {
- for (int i = 0; i < Columns * Lines; i++) {
+ for (int i = 0; i < Columns * (Lines + 1); i++) {
byte* xScreenPtr = (byte*)VideoAddr;
xScreenPtr += i*2;
*xScreenPtr = 0;
diff --git a/source/Cosmos/Cosmos.Kernel/Cosmos.Kernel.csproj b/source/Cosmos/Cosmos.Kernel/Cosmos.Kernel.csproj
index 588f7503a..e1603c803 100644
--- a/source/Cosmos/Cosmos.Kernel/Cosmos.Kernel.csproj
+++ b/source/Cosmos/Cosmos.Kernel/Cosmos.Kernel.csproj
@@ -82,7 +82,7 @@
-
+
diff --git a/source/Cosmos/Cosmos.Kernel/Old/Staging/DefaultStageQueue.cs b/source/Cosmos/Cosmos.Kernel/Old/Staging/DefaultStageQueue.cs
index 1839f6085..94fe93143 100644
--- a/source/Cosmos/Cosmos.Kernel/Old/Staging/DefaultStageQueue.cs
+++ b/source/Cosmos/Cosmos.Kernel/Old/Staging/DefaultStageQueue.cs
@@ -7,7 +7,7 @@ namespace Cosmos.Kernel.Staging {
public class DefaultStageQueue : StageQueue {
public DefaultStageQueue()
: base () {
- Enqueue (new Cosmos.Kernel.Staging.Stages.TestStage ());
+ Enqueue (new Cosmos.Kernel.Staging.Stages.KernelStage ());
}
}
}
diff --git a/source/Cosmos/Cosmos.Kernel/Old/Staging/Stages/KernelStage.cs b/source/Cosmos/Cosmos.Kernel/Old/Staging/Stages/KernelStage.cs
new file mode 100644
index 000000000..1210d247c
--- /dev/null
+++ b/source/Cosmos/Cosmos.Kernel/Old/Staging/Stages/KernelStage.cs
@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Cosmos.Kernel.Staging.Stages {
+ public class KernelStage : StageBase {
+ #region IStage Members
+
+ public override string Name {
+ get {
+ return "Kernel";
+ }
+ }
+
+ public override void Initialize() {
+ System.Console.Clear();
+ System.Console.BackgroundColor = ConsoleColor.Black;
+ System.Console.ForegroundColor = ConsoleColor.Red;
+ System.Console.WriteLine("Cosmos Kernel. Copyright 2007-2008 The Cosmos Project.");
+ System.Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
+ System.Console.ForegroundColor = ConsoleColor.White;
+ }
+
+ public override void Teardown() {
+ }
+
+ #endregion
+ }
+}
diff --git a/source/Cosmos/Cosmos.Kernel/Old/Staging/Stages/TestStage.cs b/source/Cosmos/Cosmos.Kernel/Old/Staging/Stages/TestStage.cs
deleted file mode 100644
index 9e020aa8f..000000000
--- a/source/Cosmos/Cosmos.Kernel/Old/Staging/Stages/TestStage.cs
+++ /dev/null
@@ -1,24 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Cosmos.Kernel.Staging.Stages {
- public class TestStage : StageBase {
- #region IStage Members
-
- public override string Name {
- get {
- return "Tests";
- }
- }
-
- public override void Initialize() {
-
- }
-
- public override void Teardown() {
- }
-
- #endregion
- }
-}
diff --git a/source/Cosmos/Cosmos.Shell.Console/Commands/ExitCommand.cs b/source/Cosmos/Cosmos.Shell.Console/Commands/ExitCommand.cs
index a6ca2573a..3f9883366 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Commands/ExitCommand.cs
+++ b/source/Cosmos/Cosmos.Shell.Console/Commands/ExitCommand.cs
@@ -27,8 +27,7 @@ namespace Cosmos.Shell.Console.Commands
public override void Execute(string param)
{
- //throw new NotSupportedException();
- //_exit();
+ _exit();
}
public override void Help()
diff --git a/source/Cosmos/Cosmos.Shell.Console/Commands/FailCommand.cs b/source/Cosmos/Cosmos.Shell.Console/Commands/FailCommand.cs
new file mode 100644
index 000000000..eb935cfbd
--- /dev/null
+++ b/source/Cosmos/Cosmos.Shell.Console/Commands/FailCommand.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace Cosmos.Shell.Console.Commands
+{
+ public class FailCommand : CommandBase
+ {
+ public override string Name
+ {
+ get { return "fail"; }
+ }
+
+ public override string Summary
+ {
+ get { return "Causes a kernel-level exception (RSOD)."; }
+ }
+
+ public override void Execute(string param)
+ {
+ throw new Exception("This is a test.");
+ }
+
+ public override void Help()
+ {
+ System.Console.WriteLine("fail");
+ System.Console.WriteLine(" Causes a kernel-level exception (RSOD).");
+ }
+ }
+}
diff --git a/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj b/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj
index dc21a1a47..f6f22a238 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj
+++ b/source/Cosmos/Cosmos.Shell.Console/Cosmos.Shell.Console.csproj
@@ -49,6 +49,7 @@
+
@@ -70,6 +71,10 @@
{EF1F8912-AE8D-40B3-9857-5A2852986710}
Cosmos.Build.Windows
+
+ {B024FADF-EF04-4602-A0F4-49016D68B2AF}
+ Cosmos.Hardware.PC
+
{CE50FE98-9AC4-4B4D-ADC7-31F6DCD28755}
Cosmos.Hardware
diff --git a/source/Cosmos/Cosmos.Shell.Console/Program.cs b/source/Cosmos/Cosmos.Shell.Console/Program.cs
index e8ebcc501..59d154bf6 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Program.cs
+++ b/source/Cosmos/Cosmos.Shell.Console/Program.cs
@@ -23,21 +23,11 @@ namespace Cosmos.Shell.Console {
Kernel.Staging.DefaultStageQueue stages = new Cosmos.Kernel.Staging.DefaultStageQueue();
stages.Enqueue(new Prompter());
- System.Console.Clear();
- System.Console.BackgroundColor = ConsoleColor.Black;
- System.Console.ForegroundColor = ConsoleColor.Red;
- System.Console.WriteLine("Cosmos Kernel. Copyright 2007-2008 The Cosmos Project.");
- System.Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- System.Console.ForegroundColor = ConsoleColor.Green;
- System.Console.WriteLine("Now Booting...");
-
- System.Console.ForegroundColor = ConsoleColor.White;
- System.Console.WriteLine("Success.");
- System.Console.WriteLine(Kernel.StringFuncs.TimeString());
stages.Run();
- System.Console.WriteLine("Done");
-
stages.Teardown();
+
+ // Halt system.
+ while (true) ;
}
}
}
diff --git a/source/Cosmos/Cosmos.Shell.Console/Prompter.cs b/source/Cosmos/Cosmos.Shell.Console/Prompter.cs
index 7226454f7..aa6482d75 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Prompter.cs
+++ b/source/Cosmos/Cosmos.Shell.Console/Prompter.cs
@@ -27,7 +27,8 @@ namespace Cosmos.Shell.Console {
_commands.Add(new Commands.ClsCommand());
_commands.Add(new Commands.DirCommand());
_commands.Add(new Commands.EchoCommand());
- //_commands.Add(new Commands.ExitCommand(Stop)); // TODO: Fix this.
+ _commands.Add(new Commands.ExitCommand(Stop)); // TODO: Fix this.
+ _commands.Add(new Commands.FailCommand());
_commands.Add(new Commands.GuessCommand());
_commands.Add(new Commands.HelpCommand(_commands));
_commands.Add(new Commands.TestsCommand());
diff --git a/source/Cosmos/Cosmos.Shell.Console/Tests/StringTest.cs b/source/Cosmos/Cosmos.Shell.Console/Tests/StringTest.cs
index 9509a752e..cb285c6e3 100644
--- a/source/Cosmos/Cosmos.Shell.Console/Tests/StringTest.cs
+++ b/source/Cosmos/Cosmos.Shell.Console/Tests/StringTest.cs
@@ -29,6 +29,11 @@ namespace Cosmos.Shell.Console.Tests
Assert("0123456789"[5] == '5', "\"0123456789\"[5] == '5'");
Assert("a" != "b", "\"a\" != \"b\"");
Assert('a'.ToString() == "a", "'a'.ToString() == \"a\"");
+
+ Assert(("a" + "b") == "ab", "\"a\" + \"b\" == \"a\" + \"b\"");
+ StringBuilder builder = new StringBuilder("a");
+ builder.Append("b");
+ Assert(builder.ToString() == "ab", "(stringbuilder)");
}
}
}
diff --git a/source/Indy.IL2CPU.Assembler/Assembler.cs b/source/Indy.IL2CPU.Assembler/Assembler.cs
index 1d46011fd..a687442f9 100644
--- a/source/Indy.IL2CPU.Assembler/Assembler.cs
+++ b/source/Indy.IL2CPU.Assembler/Assembler.cs
@@ -11,37 +11,18 @@ namespace Indy.IL2CPU.Assembler {
//public const string CurrentExceptionDataMember = "__CURRENT_EXCEPTION__";
public static Exception CurrentException;
public static void PrintException() {
- Console.BackgroundColor = ConsoleColor.Blue;
- Console.ForegroundColor = ConsoleColor.White;
- string xClearLine = new String(' ', Console.WindowWidth);
- for (int i = 0; i < Console.WindowHeight; i++) {
- Console.Write(" ");
- }
- //Console.Clear();
- System.Console.WriteLine("Cosmos Kernel. Copyright 2008 The Cosmos Project.");
- System.Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("BSOD's Rule!");
- Console.WriteLine("");
- Console.Write("Unhandled error occurred: ");
- System.Diagnostics.Debugger.Break();
- Console.WriteLine(CurrentException.ToString());
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
- Console.WriteLine("");
+ Console.BackgroundColor = ConsoleColor.DarkRed;
+ Console.ForegroundColor = ConsoleColor.Yellow;
+ Console.Clear();
+
+ Console.WriteLine("Cosmos Kernel. Copyright 2008 The Cosmos Project.");
+ Console.WriteLine("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
Console.WriteLine("");
+ Console.WriteLine("An unhandled kernel exception occurred.");
Console.WriteLine("");
+ Console.WriteLine(CurrentException.ToString());
Console.WriteLine("");
+ Console.WriteLine("The Cosmos Project would appreciate your feedback about this issue.");
}
private static FieldDefinition mCurrentExceptionRef;