Class CPU
CPU class. Non hardware class, only used by core and hardware drivers for ports etc.
Inheritance
Namespace: Cosmos.Core
Assembly: Cosmos.Core.dll
Syntax
public class CPU : object
Fields
| Improve this Doc View SourcemInterruptsEnabled
Check if interrupts enabled.
Declaration
public static bool mInterruptsEnabled
Field Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceCanReadCPUID()
Check if can read CPU ID. Plugged.
Declaration
public static int CanReadCPUID()
Returns
Type | Description |
---|---|
System.Int32 | non-zero if can read. |
DisableInterrupts()
Returns if the interrupts were actually enabled.
Declaration
public static bool DisableInterrupts()
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
EnableInterrupts()
Enable interrupts.
Declaration
public static void EnableInterrupts()
EstimateCPUSpeedFromName(String)
This is only public for testing purposes
Declaration
public static long EstimateCPUSpeedFromName(string s)
Parameters
Type | Name | Description |
---|---|---|
System.String | s |
Returns
Type | Description |
---|---|
System.Int64 |
GetAmountOfRAM()
Get amount of RAM in MB's. Plugged.
Declaration
public static uint GetAmountOfRAM()
Returns
Type | Description |
---|---|
System.UInt32 |
GetCPUBrandString()
Get CPU cycle speed.
Declaration
public static string GetCPUBrandString()
Returns
Type | Description |
---|---|
System.String | long value. |
GetCPUCycleSpeed()
Get CPU cycle speed.
Declaration
public static long GetCPUCycleSpeed()
Returns
Type | Description |
---|---|
System.Int64 | long value. |
GetCPUUptime()
Get CPU up time.
Declaration
public static ulong GetCPUUptime()
Returns
Type | Description |
---|---|
System.UInt64 | ulong value. |
GetCPUVendorName()
Get CPU vendor name.
Declaration
public static string GetCPUVendorName()
Returns
Type | Description |
---|---|
System.String | string value. |
GetEndOfKernel()
Get end of the kernel. Plugged.
Declaration
public static uint GetEndOfKernel()
Returns
Type | Description |
---|---|
System.UInt32 |
GetMemoryMap()
Get the Memory Map Information from Multiboot
Declaration
public static MemoryMap[] GetMemoryMap()
Returns
Type | Description |
---|---|
MemoryMap[] | Returns an array of MemoryMaps containing the Multiboot Memory Map information. The array may have empty values at the end. |
Halt()
Halt the CPU. Plugged.
Declaration
public void Halt()
InitFloat()
Init float. Plugged.
Declaration
public void InitFloat()
InitSSE()
Init SSE. Plugged.
Declaration
public void InitSSE()
MemoryMapExists()
Checks if Multiboot returned a memory map
Declaration
public static bool MemoryMapExists()
Returns
Type | Description |
---|---|
System.Boolean |
ReadCPUID(UInt32, ref Int32, ref Int32, ref Int32, ref Int32)
Read CPU ID. Plugged.
Declaration
public static void ReadCPUID(uint type, ref int eax, ref int ebx, ref int ecx, ref int edx)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | type | type. |
System.Int32 | eax | eax. |
System.Int32 | ebx | ebx. |
System.Int32 | ecx | ecx. |
System.Int32 | edx | edx. |
Reboot()
Reboot the CPU.
Declaration
public void Reboot()
UpdateIDT(Boolean)
Update IDT. Plugged.
Declaration
public void UpdateIDT(bool aEnableInterruptsImmediately)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | aEnableInterruptsImmediately |
ZeroFill(UInt32, UInt32)
Zero fill. Plugged.
Declaration
public static void ZeroFill(uint aStartAddress, uint aLength)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | aStartAddress | |
System.UInt32 | aLength |