diff --git a/source2/Kernel/System/Cosmos.System/Kernel.cs b/source2/Kernel/System/Cosmos.System/Kernel.cs index 06456033c..96dcda1ff 100644 --- a/source2/Kernel/System/Cosmos.System/Kernel.cs +++ b/source2/Kernel/System/Cosmos.System/Kernel.cs @@ -9,8 +9,6 @@ namespace Cosmos.System { public readonly Debug.Kernel.Debugger Dbg = new Debug.Kernel.Debugger("User", ""); public bool ClearScreen = true; - // Set to true to hide messages during boot. - public bool Silent = false; // Set after initial start. Can be started and stopped at same time protected bool mStarted = false; @@ -20,51 +18,33 @@ namespace Cosmos.System { // Start the system up using the properties for configuration. public void Start() { Global.Dbg.Send("Starting kernel"); - if (mStarted) - { + if (mStarted) { Global.Dbg.Send("ERROR: Kernel Already Started"); throw new Exception("Kernel has already been started. A kernel cannot be started twice."); } mStarted = true; - //TODO - Set and document the Console class (and its supporting classes) to default to 80x25 - //Hardware.VGAScreen.SetTextMode(VGAScreen.TextSize.Size80x25); - //TODO: System inits hardware, and hardware inits core Global.Init(); - // Clear before booting - Global.Dbg.Send("Clearing screen"); - Global.Console.Clear(); - WriteLine("Cosmos kernel boot initiated."); - - WriteLine("Cosmos kernel boot completed."); - // Provide the user with a clear scree if they requested it - if (ClearScreen) - { + // Provide the user with a clear screen if they requested it + if (ClearScreen) { Global.Console.Clear(); } BeforeRun(); - while (!mStopped) - { + while (!mStopped) { Run(); } AfterRun(); - while (true) - ; + while (true) { + } } protected virtual void BeforeRun() { } protected abstract void Run(); protected virtual void AfterRun() { } - protected void WriteLine(string aMsg) { - if (!Silent) { - Global.Console.WriteLine(aMsg); - } - } - // Shut down the system and power off public void Stop() { mStopped = true; diff --git a/source2/Kernel/System/Hardware/Core/Cosmos.Core/Global.cs b/source2/Kernel/System/Hardware/Core/Cosmos.Core/Global.cs index acf2e39be..75521cc64 100644 --- a/source2/Kernel/System/Hardware/Core/Cosmos.Core/Global.cs +++ b/source2/Kernel/System/Hardware/Core/Cosmos.Core/Global.cs @@ -24,6 +24,9 @@ namespace Cosmos.Core { //Init Heap first - Hardware loads devices and they need heap // drag in the heap: Heap.Initialize(); + //TODO: Since this is FCL, its "common". Otherwise it should be + // system level and not accessible from Core. Need to think about this + // for the future. Console.WriteLine(" Heap OK"); // After heap init etc diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs b/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs index 77eedbd72..c4397bfb6 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/Global.cs @@ -16,7 +16,9 @@ namespace Cosmos.Hardware { // DANGER! This is before heap? Yet somehow its working currently... // Leaving it for now because Core.Init outputs to Console, but we need // to change this... + // Heap seems to self init on demand? But even before IDT/GDT etc? TextScreen = new TextScreen(); + TextScreen.Clear(); Global.Dbg.Send("Cosmos.Hardware.Global.Init"); Core.PciBus.OnPCIDeviceFound = PCIDeviceFound; diff --git a/source2/Kernel/System/Hardware/Cosmos.Hardware/TextScreen.cs b/source2/Kernel/System/Hardware/Cosmos.Hardware/TextScreen.cs index 8ad5cbff3..2bd8fcd8a 100644 --- a/source2/Kernel/System/Hardware/Cosmos.Hardware/TextScreen.cs +++ b/source2/Kernel/System/Hardware/Cosmos.Hardware/TextScreen.cs @@ -11,14 +11,17 @@ namespace Cosmos.Hardware { protected byte Color = 0x0F; // White protected Core.IOGroup.TextScreen IO = Core.Global.BaseIOGroups.TextScreen; - protected readonly MemoryBlock08 mMemory08; + protected readonly MemoryBlock08 mRAM; public TextScreen() { //Use Changeset 64921 //This gets called before at least one of the initializers. //1) This is a bug. //2) This should throw a null ref, which it does not currently. Although its not null.. so maybe thats the issue. - mMemory08 = IO.Memory.Bytes; + mRAM = IO.Memory.Bytes; + + //TODO - Set and document the Console class (and its supporting classes) to default to 80x25 + //Hardware.VGAScreen.SetTextMode(VGAScreen.TextSize.Size80x25); } public int Rows { get { return 25; } } @@ -26,7 +29,9 @@ namespace Cosmos.Hardware { public void Clear() { // Empty + White + Empty + White - UInt32 xData = 0x000F000F; + //UInt32 xData = 0x000F000F; + // This is just for testing...revert back to the one above... + UInt32 xData = 0x430F430F; IO.Memory.Fill(0, (uint)(Cols * Rows * 2 / 4), xData); } @@ -36,13 +41,13 @@ namespace Cosmos.Hardware { public char this[int aX, int aY] { get { - UInt32 xScreenOffset = (UInt32)((aX + aY * Cols) * 2); - return (char)mMemory08[xScreenOffset]; + var xScreenOffset = (UInt32)((aX + aY * Cols) * 2); + return (char)mRAM[xScreenOffset]; } set { var xScreenOffset = (UInt32)((aX + aY * Cols) * 2); - mMemory08[xScreenOffset] = (byte)value; - mMemory08[xScreenOffset + 1] = Color; + mRAM[xScreenOffset] = (byte)value; + mRAM[xScreenOffset + 1] = Color; } } diff --git a/source2/Users/Kudzu/Breakpoints/Breakpoints.Cosmos b/source2/Users/Kudzu/Breakpoints/Breakpoints.Cosmos index 0ee35ee12..64c9582a4 100644 --- a/source2/Users/Kudzu/Breakpoints/Breakpoints.Cosmos +++ b/source2/Users/Kudzu/Breakpoints/Breakpoints.Cosmos @@ -18,7 +18,7 @@ MicrosoftNET False Source - True + False Workstation