Class CPU
CPU class. Non hardware class, only used by core and hardware drivers for ports etc.
Inheritance
Inherited Members
Namespace: Cosmos.Core
Assembly: Cosmos.Core.dll
Syntax
public static class CPU
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. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown on fatal error, contact support. |
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 MBs.
Declaration
public static uint GetAmountOfRAM()
Returns
Type | Description |
---|---|
System.UInt32 |
GetCPUBrandString()
Get CPU branding name.
Declaration
public static string GetCPUBrandString()
Returns
Type | Description |
---|---|
System.String | CPU's full name |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown on fatal error, contact support. |
System.NotSupportedException | Thrown if can not read CPU ID. |
GetCPUCycleSpeed()
Get CPU cycle speed.
Declaration
public static long GetCPUCycleSpeed()
Returns
Type | Description |
---|---|
System.Int64 | long value. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown on fatal error, contact support. |
System.NotSupportedException | Thrown if can not read CPU ID. |
GetCPUUptime()
Get CPU up time.
Declaration
public static ulong GetCPUUptime()
Returns
Type | Description |
---|---|
System.UInt64 | ulong value. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown on fatal error, contact support. |
GetCPUVendorName()
Get CPU vendor name.
Declaration
public static string GetCPUVendorName()
Returns
Type | Description |
---|---|
System.String | string value. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown on fatal error, contact support. |
System.NotSupportedException | Thrown if can not read CPU vendor name. |
GetEBPValue()
Get position of current EBP register
Declaration
public static uint GetEBPValue()
Returns
Type | Description |
---|---|
System.UInt32 |
GetEndOfKernel()
Get end of the kernel. Plugged.
Declaration
public static uint GetEndOfKernel()
Returns
Type | Description |
---|---|
System.UInt32 |
GetLargestMemoryBlock()
Returns a pointer size of largest continuous block of free ram DOES NOT ALLOCATE ANYTHING so it can be used before Memory Management is initalised
Declaration
public static RawMemoryMapBlock*GetLargestMemoryBlock()
Returns
Type | Description |
---|---|
RawMemoryMapBlock* | The size of the largest block in bytes |
GetMemoryMap()
Get the Memory Map Information from Multiboot
Declaration
public static MemoryMapBlock[] GetMemoryMap()
Returns
Type | Description |
---|---|
MemoryMapBlock[] | Returns an array of MemoryMaps containing the Multiboot Memory Map information. The array may have empty values at the end. |
GetStackStart()
Get the address at which the stack starts
Declaration
public static uint GetStackStart()
Returns
Type | Description |
---|---|
System.UInt32 |
Halt()
Halt the CPU. Plugged.
Declaration
public static void Halt()
InitFloat()
Init float. Plugged.
Declaration
public static void InitFloat()
InitSSE()
Init SSE. Plugged.
Declaration
public static void InitSSE()
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. |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown on fatal error, contact support. |
Reboot()
Reboot the CPU.
Declaration
public static void Reboot()
UpdateIDT(Boolean)
Update IDT. Plugged.
Declaration
public static 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 |