From aa67985e249a2ebffb3de73db873b8d9b7e0f7a3 Mon Sep 17 00:00:00 2001 From: Kudzu Date: Sun, 30 Jul 2017 14:29:02 -0400 Subject: [PATCH] g3 --- source/Kernel-X86/00-CPU/Cosmos.CPU/Bootstrap.cs | 8 ++++---- source/Kernel-X86/00-CPU/Cosmos.CPU/Global.cs | 6 +++--- .../Kernel-X86/00-CPU/Cosmos.CPU/GlobalSystemInfo.cs | 4 ++-- source/Kernel-X86/00-CPU/Cosmos.CPU/INTs.cs | 2 +- .../00-CPU/Cosmos.CPU/Memory/Old/GlobalSystemInfo.cs | 4 ++-- .../00-CPU/Cosmos.CPU/Memory/Old/Old_Heap.cs | 10 +++++----- source/Kernel-X86/00-CPU/Cosmos.CPU/PIC.cs | 6 +++--- .../00-CPU/Cosmos.CPU/{CPU.cs => Processor.cs} | 4 ++-- source/Kernel-X86/00-CPU/Cosmos.CPU_Asm/CPUImpl.cs | 10 +++++----- 9 files changed, 27 insertions(+), 27 deletions(-) rename source/Kernel-X86/00-CPU/Cosmos.CPU/{CPU.cs => Processor.cs} (96%) diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/Bootstrap.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/Bootstrap.cs index 9cd6b7c22..0e18a8875 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/Bootstrap.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/Bootstrap.cs @@ -5,7 +5,7 @@ // we eventually eliminate them static public PIC PIC; // Has to be static for now, ZeroFill gets called before the Init. - static public readonly CPU CPU = new CPU(); + static public readonly Processor Processor = new Processor(); // Bootstrap is a class designed only to get the essentials done. // ie the stuff needed to "pre boot". Do only the very minimal here. @@ -16,10 +16,10 @@ Cosmos.Core.INTs.Dummy(); PIC = new PIC(); - CPU.UpdateIDT(true); + Processor.UpdateIDT(true); /* TODO check using CPUID that SSE2 is supported */ - CPU.InitSSE(); + Processor.InitSSE(); /* * We liked to use SSE for all floating point operation and end to mix SSE / x87 in Cosmos code @@ -27,7 +27,7 @@ * for long to double) so - in some rare cases - x87 continue to be used. I hope passing to the x32 or x64 IA will solve * definively this problem. */ - CPU.InitFloat(); + Processor.InitFloat(); // Managed_Memory_System.ManagedMemory.Initialize(); // Managed_Memory_System.ManagedMemory.SetUpMemoryArea(); diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/Global.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/Global.cs index 6fe6cf66f..888a0c696 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/Global.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/Global.cs @@ -3,7 +3,7 @@ using Cosmos.Debug.Kernel; namespace Cosmos.CPU { public static class Global { - public static readonly Debugger mDebugger = new Debugger("CPU", "Global"); + public static readonly Debugger mDebugger = new Debugger("Processor", "Global"); public static BaseIOGroups BaseIOGroups = new BaseIOGroups(); @@ -16,9 +16,9 @@ namespace Cosmos.CPU { } } - static public CPU CPU { + static public Processor Processor { get { - return Bootstrap.CPU; + return Bootstrap.Processor; } } diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/GlobalSystemInfo.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/GlobalSystemInfo.cs index dda5b397f..40cd127ed 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/GlobalSystemInfo.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/GlobalSystemInfo.cs @@ -14,9 +14,9 @@ namespace Cosmos.CPU { internal static unsafe void EnsureInitialized() { //if (mGlobalInformationTable == null) { - //var xEndOfKernel = CPU.GetEndOfKernel(); + //var xEndOfKernel = Processor.GetEndOfKernel(); //xEndOfKernel = xEndOfKernel + (1024 * 1024); // for now, skip 1 MB - //CPU.ZeroFill(xEndOfKernel, (uint)(sizeof(GlobalInformationTable) + TotalDataLookupTableSize) * 4); + //Processor.ZeroFill(xEndOfKernel, (uint)(sizeof(GlobalInformationTable) + TotalDataLookupTableSize) * 4); //mGlobalInformationTable = (GlobalInformationTable*)xEndOfKernel; //uint xFirstDataLookupLocation = (uint)(xEndOfKernel + sizeof(GlobalInformationTable)); //mGlobalInformationTable->FirstDataLookupTable = (DataLookupTable*)xFirstDataLookupLocation; diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/INTs.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/INTs.cs index 3a286b7ff..bb41d6237 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/INTs.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/INTs.cs @@ -313,7 +313,7 @@ namespace Cosmos.Core { #endregion - #region CPU Exceptions + #region Processor Exceptions public static IRQDelegate GeneralProtectionFault; diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/GlobalSystemInfo.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/GlobalSystemInfo.cs index d1eabc6d2..05ae493ac 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/GlobalSystemInfo.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/GlobalSystemInfo.cs @@ -16,9 +16,9 @@ namespace Cosmos.CPU.Memory.Old { if (mGlobalInformationTable == null) { // todo: should we align this structure somehow? - var xEndOfKernel = CPU.GetEndOfKernel(); + var xEndOfKernel = Processor.GetEndOfKernel(); xEndOfKernel = xEndOfKernel + (1024 * 1024); // for now, skip 1 MB - CPU.ZeroFill(xEndOfKernel, (uint)(sizeof(GlobalInformationTable) + TotalDataLookupTableSize) * 4); + Processor.ZeroFill(xEndOfKernel, (uint)(sizeof(GlobalInformationTable) + TotalDataLookupTableSize) * 4); mGlobalInformationTable = (GlobalInformationTable*)xEndOfKernel; uint xFirstDataLookupLocation = (uint)(xEndOfKernel + sizeof(GlobalInformationTable)); //Debugger.DoSend("Setting FirstDataLookupTable to "); diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/Old_Heap.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/Old_Heap.cs index 6719a8bf3..32625cd96 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/Old_Heap.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/Memory/Old/Old_Heap.cs @@ -33,7 +33,7 @@ namespace Cosmos.CPU.Memory.Old if (!mInitialized) { mInitialized = true; - DoInitialize((CPU.GetAmountOfRAM() - 1) * 1024 * 1024); + DoInitialize((Processor.GetAmountOfRAM() - 1) * 1024 * 1024); //DoInitialize(4 * 1024 * 1024, 16 * 1024 * 1024); } } @@ -41,7 +41,7 @@ namespace Cosmos.CPU.Memory.Old private static void ClearMemory(void* aStartAddress, uint aLength) { //TODO: Move to memory. Internal access only... - CPU.ZeroFill((uint)aStartAddress, aLength); + Processor.ZeroFill((uint)aStartAddress, aLength); } public static uint MemAlloc(uint aLength) @@ -53,7 +53,7 @@ namespace Cosmos.CPU.Memory.Old { } } - var xInterruptsWereEnabled = CPU.DisableInterrupts(); + var xInterruptsWereEnabled = Processor.DisableInterrupts(); try { EnsureIsInitialized(); @@ -68,7 +68,7 @@ namespace Cosmos.CPU.Memory.Old //mDebugger.Trace($"At address {(uint)xCurrentTable}"); if (ScanDataLookupTable(xCurrentTableIdx, xCurrentTable, aLength, out xResult)) { - if (xResult < CPU.GetEndOfKernel()) + if (xResult < Processor.GetEndOfKernel()) { mDebugger.Send("Wrong handle returned!"); while (true) @@ -118,7 +118,7 @@ namespace Cosmos.CPU.Memory.Old { if (xInterruptsWereEnabled) { - CPU.EnableInterrupts(); + Processor.EnableInterrupts(); } else { diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/PIC.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/PIC.cs index 194d6f8cb..b1fc1ec03 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/PIC.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/PIC.cs @@ -1,7 +1,7 @@ using Cosmos.Core; namespace Cosmos.CPU { - // PIC is not in hardware becuase its a special core piece like CPU that is not interacted with by anything except Core. + // PIC is not in hardware becuase its a special core piece like Processor that is not interacted with by anything except Core. // // Remaps the IRQ's to INT20-INT2F public class PIC { @@ -94,7 +94,7 @@ namespace Cosmos.CPU { } protected void Init(IOGroup.PIC aPIC, byte aBase, byte aIDunno, byte aMask) { - // We need to remap the PIC interrupt lines to the CPU. The BIOS sets + // We need to remap the PIC interrupt lines to the Processor. The BIOS sets // them in a way compatible for 16 bit mode, but in a way that causes problems // for 32 bit mode. // The only way to remap them however is to completely reinitialize the PICs. @@ -117,7 +117,7 @@ namespace Cosmos.CPU { Master.Data.Byte = aIDunno; IOPort.Wait(); - //#define ICW4_AUTO 0x02 /C:\Data\Cosmos\source2\Kernel\System\Hardware\Core\Cosmos.Core\CPU.cs* Auto (normal) EOI */ + //#define ICW4_AUTO 0x02 /C:\Data\Cosmos\source2\Kernel\System\Hardware\Core\Cosmos.Core\Processor.cs* Auto (normal) EOI */ //#define ICW4_BUF_SLAVE 0x08 /* Buffered mode/slave */ //#define ICW4_BUF_MASTER 0x0C /* Buffered mode/master */ //#define ICW4_SFNM 0x10 /* Special fully nested (not) */ diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU/CPU.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU/Processor.cs similarity index 96% rename from source/Kernel-X86/00-CPU/Cosmos.CPU/CPU.cs rename to source/Kernel-X86/00-CPU/Cosmos.CPU/Processor.cs index 5cb2cce94..5200f81c3 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU/CPU.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU/Processor.cs @@ -3,7 +3,7 @@ using Cosmos.IL2CPU.API; namespace Cosmos.CPU { // Non hardware class, only used by core and hardware drivers for ports etc. - public class CPU + public class Processor { // Amount of RAM in MB's. // needs to be static, as Heap needs it before we can instantiate objects @@ -60,7 +60,7 @@ namespace Cosmos.CPU { { } myPort.Byte = 0xFE; - Halt(); // If it didn't work, Halt the CPU + Halt(); // If it didn't work, Halt the Processor } private static void DoEnableInterrupts() diff --git a/source/Kernel-X86/00-CPU/Cosmos.CPU_Asm/CPUImpl.cs b/source/Kernel-X86/00-CPU/Cosmos.CPU_Asm/CPUImpl.cs index 1c31a0146..9caa9d54c 100644 --- a/source/Kernel-X86/00-CPU/Cosmos.CPU_Asm/CPUImpl.cs +++ b/source/Kernel-X86/00-CPU/Cosmos.CPU_Asm/CPUImpl.cs @@ -1,10 +1,10 @@ using Cosmos.IL2CPU.API; namespace Cosmos.CPU_Asm { - [Plug(Target = typeof(Cosmos.CPU.CPU))] + [Plug(Target = typeof(Cosmos.CPU.Processor))] public class CPUImpl { [PlugMethod(Assembler = typeof(CPUUpdateIDTAsm))] - public static void UpdateIDT(Cosmos.CPU.CPU aThis, bool aEnableInterruptsImmediately) { + public static void UpdateIDT(Cosmos.CPU.Processor aThis, bool aEnableInterruptsImmediately) { } [PlugMethod(Assembler = typeof(CPUGetAmountOfRAMAsm))] @@ -23,15 +23,15 @@ namespace Cosmos.CPU_Asm { } [PlugMethod(Assembler = typeof(CPUInitFloatAsm))] - public static void InitFloat(Cosmos.CPU.CPU aThis) { + public static void InitFloat(Cosmos.CPU.Processor aThis) { } [PlugMethod(Assembler = typeof(CPUInitSSEAsm))] - public static void InitSSE(Cosmos.CPU.CPU aThis) { + public static void InitSSE(Cosmos.CPU.Processor aThis) { } [PlugMethod(Assembler = typeof(CPUHaltAsm))] - public static void Halt(Cosmos.CPU.CPU aThis) { + public static void Halt(Cosmos.CPU.Processor aThis) { } [PlugMethod(Assembler = typeof(CPUDisableINTsAsm))]