• Home
  • Cosmos Website
  • Articles
  • API Documentation
Show / Hide Table of Contents
  • Cosmos.Build.Tasks
    • CreateMbr
    • CreateSyslinuxConfig
    • ExtractMapFromElfFile
    • IL2CPU
    • Launch
    • Ld
    • MakeIso
    • Nasm
    • ReadNasmMapToDebugInfo
    • TheRingMaster
  • Cosmos.Common
    • BinaryHelper
    • BinaryHelper.BitPos
    • ByteToString
    • NumberHelper
    • StringHelper
  • Cosmos.Common.Extensions
    • ByteConverter
    • ToHexString
  • Cosmos.Core
    • ACPI
    • ACPI.RSDPtr
    • BaseIOGroups
    • Bootstrap
    • CosmosRuntimeType
    • CPU
    • GCImplementation
    • Global
    • INTs
    • INTs.EFlagsEnum
    • INTs.ExceptionInterruptDelegate
    • INTs.IRQContext
    • INTs.IRQDelegate
    • INTs.MMXContext
    • INTs.TSS
    • IOPort
    • IOPortBase
    • IOPortRead
    • IOPortWrite
    • ManagedMemoryBlock
    • MemoryBlock
    • MemoryBlock08
    • MemoryBlock16
    • MemoryBlock32
    • MemoryMap
    • MemoryOperations
    • Multiboot
    • Multiboot.Header
    • PIC
    • PIC.Cmd
    • RawMemoryMap
    • VBE
    • VBE.ControllerInfo
    • VBE.ModeInfo
  • Cosmos.Core.IOGroup
    • ATA
    • COM
    • IOGroup
    • Keyboard
    • Mouse
    • PCI
    • PCSpeaker
    • PIC
    • PIT
    • PS2Controller
    • RTC
    • TextScreen
    • VBEIOGroup
    • VGA
  • Cosmos.Core.IOGroup.Network
    • AMDPCNetIIIOGroup
  • Cosmos.Core.Memory
    • Heap
    • HeapLarge
    • HeapMedium
    • HeapSmall
    • RAT
    • RAT.PageType
  • Cosmos.Core.Memory.Old
    • Heap
  • Cosmos.Core.MemoryGroup
    • AHCI
  • Cosmos.Core_Asm
    • ArrayGetLengthAsm
    • ArrayImpl
    • ArrayInternalCopyAsm
    • BufferBlockCopyAsm
    • BufferImpl
    • CPUCanReadCPUIDAsm
    • CPUDisableINTsAsm
    • CPUEnableINTsAsm
    • CPUGetAmountOfRAMAsm
    • CPUGetEndOfKernelAsm
    • CPUHaltAsm
    • CPUImpl
    • CPUInitFloatAsm
    • CPUInitSSEAsm
    • CPUReadCPUIDAsm
    • CPUReadModelSpecificRegisterAsm
    • CPUReadTimestampCounterAsm
    • CPUUpdateIDTAsm
    • CPUZeroFillAsm
    • DelegateCtorAsm
    • DelegateGetMulticastInvokeAsm
    • DelegateImpl
    • DelegateInvokeAsm
    • IOPortImpl
    • MultibootAsm
    • MultibootImpl
    • MultibootImplAsm
    • RuntimeHelpersImpl
  • Cosmos.Core_Asm.MemoryOperations
    • MemoryOperationsCopy128BlocksAsm
    • MemoryOperationsCopy128BytesAsm
    • MemoryOperationsCopy16BytesAsm
    • MemoryOperationsCopy32BytesAsm
    • MemoryOperationsCopy64BytesAsm
    • MemoryOperationsFill16BlocksAsm
  • Cosmos.Core_Plugs
    • GCImplementionImpl
    • RuntimeFieldHandleImpl
  • Cosmos.Core_Plugs.MemoryOperations
    • MemoryOperationsImpl
  • Cosmos.Core_Plugs.System
    • ArrayImpl
    • BufferImpl
    • CharUnicodeInfoImpl
    • DelegateImpl
    • DelegateImplInherit
    • EnvironmentImpl
    • EventHandlerImpl
    • ExceptionImpl
    • GCImpl
    • InternalEnvironmentImpl
    • MulticastDelegateImpl
    • ObjectImpl
    • OutOfMemoryExceptionImpl
    • RuntimeType
    • RuntimeType_RuntimeTypeCache
    • RuntimeTypeHandleImpl
    • SRImpl
    • StringImpl
    • TypeImpl
  • Cosmos.Core_Plugs.System.Collections.Generic
    • ByteComparer
    • ByteEqualityComparer
    • CharComparer
    • CharEqualityComparer
    • ComparerHelpersImpl
    • GuidComparer
    • GuidEqualityComparer
    • Int16Comparer
    • Int16EqualityComparer
    • Int32Comparer
    • Int32EqualityComparer
    • Int64Comparer
    • Int64EqualityComparer
    • ObjectComparer
    • ObjectEqualityComparer
    • SByteComparer
    • SByteEqualityComparer
    • StringComparer
    • StringEqualityComparer
    • UInt16Comparer
    • UInt16EqualityComparer
    • UInt32Comparer
    • UInt32EqualityComparer
    • UInt64Comparer
    • UInt64EqualityComparer
  • Cosmos.Core_Plugs.System.Diagnostics
    • DebuggerImpl
    • StopwatchImpl
  • Cosmos.Core_Plugs.System.Globalization
    • CultureInfoImpl
    • NumberFormatInfoImpl
  • Cosmos.Core_Plugs.System.Resources
    • ResourceManagerImpl
  • Cosmos.Core_Plugs.System.Runtime.CompilerServices
    • RuntimeHelpersImpl
  • Cosmos.Core_Plugs.System.Runtime.InteropServices
    • MarshalImpl
    • SafeHandleImpl
  • Cosmos.Core_Plugs.System.Text
    • DecoderFallbackImpl
    • EncoderFallbackImpl
    • InternalDecoderBestFitFallbackBufferImpl
    • InternalEncoderBestFitFallbackImpl
  • Cosmos.Core_Plugs.System.Threading
    • InterlockedImpl
    • MonitorImpl
    • TaskImpl
    • ThreadImpl
  • Cosmos.Debug.Common
    • DictionaryHelper
    • PipeClient
    • PipeServer
  • Cosmos.Debug.DebugConnectors
    • Consts
    • CoreDump
    • DebugConnector
    • DebugConnector.Incoming
    • DebugConnector.Outgoing
    • DebugConnectorEdison
    • DebugConnectorPipeClient
    • DebugConnectorPipeServer
    • DebugConnectorSerial
    • DebugConnectorStreamWithoutTimeouts
    • DebugConnectorStreamWithTimeouts
    • DebugConnectorTCPServer
    • DebugConnectorTestPipeServer
    • Debugger2Windows
    • Ds2Vs
    • Pipes
    • Vs2Ds
    • Windows2Debugger
  • Cosmos.Debug.GDB
    • AsmFile
    • AsmLine
    • BreakpointUC
    • FormBreakpoints
    • FormCallStack
    • FormCallStack.CallStack
    • FormHistory
    • FormLog
    • FormMain
    • FormMain.GdbAsmLine
    • FormRegisters
    • FormRegisters.CPUReg
    • FormSettings
    • FormWatches
    • GDB
    • GDB.Response
    • Global
    • RegNames
    • Settings
    • SettingsDS
    • SettingsDS.BreakpointDataTable
    • SettingsDS.BreakpointRow
    • SettingsDS.BreakpointRowChangeEvent
    • SettingsDS.BreakpointRowChangeEventHandler
    • SettingsDS.GeneralDataTable
    • SettingsDS.GeneralRow
    • SettingsDS.GeneralRowChangeEvent
    • SettingsDS.GeneralRowChangeEventHandler
    • SettingsDS.WatchDataTable
    • SettingsDS.WatchRow
    • SettingsDS.WatchRowChangeEvent
    • SettingsDS.WatchRowChangeEventHandler
    • SettingsDS.WindowDataTable
    • SettingsDS.WindowRow
    • SettingsDS.WindowRowChangeEvent
    • SettingsDS.WindowRowChangeEventHandler
    • WatchUC
    • Windows
  • Cosmos.Debug.Hosts
    • Bochs
    • Host
    • HyperV
    • IntelEdison
    • Qemu
    • Slave
    • VMware
  • Cosmos.Debug.Kernel
    • Debugger
    • DebuggerFactory
  • Cosmos.Debug.Kernel.Plugs.Asm
    • DebugBreak
    • DebugDoSend
    • DebugDoSendComplexLongNumber
    • DebugDoSendComplexNumber
    • DebugDoSendLongNumber
    • DebugDoSendNumber
    • DebuggerAsm
    • DebugSendChannelCommand
    • DebugSendChannelCommandNoData
    • DebugSendMessageBox
    • DebugSendPtr
    • DebugTraceOff
    • DebugTraceOn
    • DoBochsBreak
    • DoRealHalt
  • Cosmos.Deploy.Pixie
    • App
    • DHCP
    • DhcpPacket
    • DhcpPacket.MsgType
    • DhcpPacket.OpType
    • MainWindow
    • TrivialFTP
    • TrivialFTP.OpType
  • Cosmos.Deploy.USB
    • App
    • MainWindow
  • Cosmos.HAL
    • Bootstrap
    • CardType
    • ClassID
    • DataReceivedHandler
    • DebugTextScreen
    • Device
    • DeviceID
    • Global
    • KeyboardBase
    • KeyboardBase.KeyPressedEventHandler
    • MouseBase
    • MouseBase.MouseChangedEventHandler
    • NetworkDevice
    • PCI
    • PCIBaseAddressBar
    • PCIDevice
    • PCIDevice.Config
    • PCIDevice.DeviceClass
    • PCIDevice.PCIBist
    • PCIDevice.PCICommand
    • PCIDevice.PCIHeaderType
    • PCIDevice.PCIInterruptPIN
    • PCIDeviceBridge
    • PCIDeviceCardbus
    • PCIDeviceNormal
    • PCSpeaker
    • PIT
    • PIT.PITTimer
    • PIT.PITTimer.dOnTrigger
    • Power
    • ProgramIF
    • PS2Controller
    • PS2Keyboard
    • PS2Mouse
    • RTC
    • SpeakerExtensions
    • SubclassID
    • TextScreen
    • TextScreenBase
    • TextScreenHelpers
    • VendorID
    • VGADriver
    • VGADriver.ColorDepth
    • VGADriver.ScreenSize
    • VGADriver.TextSize
  • Cosmos.HAL.BlockDevice
    • AHCI
    • Ata
    • Ata.BusPositionEnum
    • Ata.ControllerIdEnum
    • AtaPio
    • AtaPio.Cmd
    • AtaPio.Ident
    • AtaPio.SpecLevel
    • AtaPio.Status
    • BlockDevice
    • EBR
    • EBR.PartInfo
    • GPT
    • GPT.GPartInfo
    • IDE
    • MBR
    • MBR.PartInfo
    • Partition
  • Cosmos.HAL.BlockDevice.Ports
    • SATA
    • SATAPI
    • StoragePort
  • Cosmos.HAL.BlockDevice.Registers
    • AHCISignature
    • ATACommands
    • ATADeviceStatus
    • Base
    • Bases
    • CommandAndStatus
    • CurrentInterfaceSpeedStatus
    • DeviceDetectionStatus
    • FISRegisterD2H
    • FISRegisterH2D
    • FISSize
    • FISType
    • GenericRegisters
    • HBACommandHeader
    • HBACommandTable
    • HBAPRDTEntry
    • InterfacePowerManagementStatus
    • InterruptEnable
    • InterruptStatus
    • PortRegisters
    • PortType
  • Cosmos.HAL.Drivers
    • VBEDriver
  • Cosmos.HAL.Drivers.PCI.Audio
    • PCMStream
  • Cosmos.HAL.Drivers.PCI.Network
    • AMDPCNetII
  • Cosmos.HAL.Drivers.PCI.Video
    • VMWareSVGAII
    • VMWareSVGAII.FIFO
    • VMWareSVGAII.Register
  • Cosmos.HAL.Drivers.USB
    • USBHost
  • Cosmos.HAL.Network
    • MACAddress
    • NetworkInit
  • Cosmos.System
    • Console
    • ConsoleKeyEx
    • ConsoleKeyExExtensions
    • Durations
    • Global
    • Kernel
    • KeyboardManager
    • KeyEvent
    • KeyEvent.KeyEventType
    • KeyMapping
    • MathEx
    • MouseManager
    • MouseState
    • Notes
    • PCSExtensions
    • PCSpeaker
    • Power
    • ScanMapBase
  • Cosmos.System.ExtendedASCII
    • CosmosEncodingProvider
  • Cosmos.System.FileSystem
    • CosmosVFS
    • DiskManager
    • FatFileSystemFactory
    • FileSystem
    • FileSystemFactory
    • FileSystemType
  • Cosmos.System.FileSystem.FAT.Listing
    • FatDirectoryEntryAttributeConsts
    • FatDirectoryEntryMetadata
    • FatDirectoryEntryMetadata.LongFilenameEntryMetadata
  • Cosmos.System.FileSystem.Listing
    • DirectoryEntry
    • DirectoryEntryTypeEnum
  • Cosmos.System.FileSystem.VFS
    • VFSBase
    • VFSManager
  • Cosmos.System.Graphics
    • Bitmap
    • Canvas
    • ColorDepth
    • ColorOrder
    • FullScreenCanvas
    • Image
    • ImageFormat
    • Mode
    • Pen
    • Point
    • SVGAIICanvas
    • VBECanvas
    • VGACanvas
    • VGAScreen
  • Cosmos.System.Graphics.Fonts
    • Font
    • PCScreenFont
    • UnicodeMapping
  • Cosmos.System.Network
    • EthernetPacket
    • NetworkStack
  • Cosmos.System.Network.ARP
    • ARPPacket
  • Cosmos.System.Network.Config
    • DNSConfig
    • IPConfig
    • NetworkConfig
  • Cosmos.System.Network.IPv4
    • Address
    • EndPoint
    • ICMPClient
    • ICMPPacket
    • IPPacket
  • Cosmos.System.Network.IPv4.UDP
    • UdpClient
    • UDPPacket
  • Cosmos.System.Network.IPv4.UDP.DHCP
    • DHCPClient
    • DHCPOption
    • DHCPPacket
  • Cosmos.System.Network.IPv4.UDP.DNS
    • DNSAnswer
    • DnsClient
    • DNSPacket
    • DNSPacketAnswer
    • DNSPacketAsk
    • DNSQuery
    • ReplyCode
  • Cosmos.System.ScanMaps
    • DE_Standard
    • FR_Standard
    • TR_StandardQ
    • US_Standard
  • Cosmos.System_Plugs.System
    • ByteImpl
    • ConsoleImpl
    • ConvertImpl
    • DateTimeImpl
    • DecimalImpl
    • DoubleImpl
    • EnumImpl
    • GuidImpl
    • Int16Impl
    • Int32Impl
    • Int64Impl
    • IntPtrImpl
    • MathImpl
    • RandomImpl
    • SByteImpl
    • SingleImpl
    • TimeSpanImpl
    • UInt16Impl
    • UInt32Impl
    • UInt64Impl
    • UIntPtrImpl
    • ValueTypeImpl
  • Cosmos.System_Plugs.System.Globalization
    • CompareInfoImpl
    • EncodingTableImpl
  • Cosmos.System_Plugs.System.IO
    • CosmosFileSystem
    • CosmosFileSystemInfo
    • DirectoryImpl
    • DirectoryInfoImpl
    • DriveInfoImpl
    • FileImpl
    • FileInfoImpl
    • FileLoadExceptionImpl
    • FileNotFoundExceptionImpl
    • FileStreamImpl
    • PathImpl
    • PathInternalImpl
    • TextWriterImpl
  • Cosmos.System_Plugs.System.Runtime
    • RuntimeHelpersImpl
  • Cosmos.System_Plugs.System.Text
    • DecoderExceptionFallbackBufferImpl
    • EncodingImpl
  • Cosmos.System_Plugs.System.Threading
    • SpinWaitImpl
    • ThreadImpl
  • Cosmos.TestRunner
    • Assert
    • TestChannelCommandEnum
    • TestController
  • Cosmos.VS.DebugEngine
    • AD7Util
    • AsmSource
    • CmdIDList
  • Cosmos.VS.DebugEngine.AD7.Definitions
    • AD7_HRESULT
  • Cosmos.VS.DebugEngine.AD7.Impl
    • AD7BoundBreakpoint
    • AD7BreakpointResolution
    • AD7DocumentContext
    • AD7Engine
    • AD7Expression
    • AD7MemoryAddress
    • AD7Module
    • AD7PendingBreakpoint
    • AD7Port
    • AD7PortSupplier
    • AD7Process
    • AD7ProgramProvider
    • AD7StackFrame
    • AD7Thread
    • DebugLocalInfo
  • Cosmos.VS.DebugEngine.Commands
    • BaseDebugCommand
    • DebugCommandExecute
    • DebugCommandHandler
    • DebugExecCommand
    • DebugLaunchCommand
    • DebugLogCommand
  • Cosmos.VS.DebugEngine.Engine.Impl
    • BreakpointManager
    • EngineCallback
    • EngineUtils
    • Operation
    • WorkerThread
  • Cosmos.VS.DebugEngine.Utilities
    • Extensions
  • Cosmos.VS.ProjectSystem
    • IBootableProperties
  • Cosmos.VS.Windows
    • AsmCode
    • AsmComment
    • AsmLabel
    • AsmLine
    • AssemblyUC
    • ConsoleConsts
    • ConsoleTW
    • ConsoleUC
    • CosmosWindowsPackage
    • DataBytesUC
    • DebuggerChannelUC
    • DebuggerUC
    • Global
    • InternalTW
    • InternalUC
    • MemoryViewUC
    • RegistersControl
    • StackTW
    • StackUC
    • StateStorer
    • ToolWindowPane2
    • ToolWindowPaneChannel
  • NASM
    • Program
  • TheRingMaster
    • Program

Class CPU

CPU class. Non hardware class, only used by core and hardware drivers for ports etc.

Inheritance
System.Object
CPU
Namespace: Cosmos.Core
Assembly: Cosmos.Core.dll
Syntax
public class CPU : object

Fields

| Improve this Doc View Source

mInterruptsEnabled

Check if interrupts enabled.

Declaration
public static bool mInterruptsEnabled
Field Value
Type Description
System.Boolean

Methods

| Improve this Doc View Source

CanReadCPUID()

Check if can read CPU ID. Plugged.

Declaration
public static int CanReadCPUID()
Returns
Type Description
System.Int32

non-zero if can read.

| Improve this Doc View Source

DisableInterrupts()

Returns if the interrupts were actually enabled.

Declaration
public static bool DisableInterrupts()
Returns
Type Description
System.Boolean

bool value.

| Improve this Doc View Source

EnableInterrupts()

Enable interrupts.

Declaration
public static void EnableInterrupts()
| Improve this Doc View Source

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
| Improve this Doc View Source

GetAmountOfRAM()

Get amount of RAM in MB's. Plugged.

Declaration
public static uint GetAmountOfRAM()
Returns
Type Description
System.UInt32
| Improve this Doc View Source

GetCPUBrandString()

Get CPU cycle speed.

Declaration
public static string GetCPUBrandString()
Returns
Type Description
System.String

long value.

| Improve this Doc View Source

GetCPUCycleSpeed()

Get CPU cycle speed.

Declaration
public static long GetCPUCycleSpeed()
Returns
Type Description
System.Int64

long value.

| Improve this Doc View Source

GetCPUUptime()

Get CPU up time.

Declaration
public static ulong GetCPUUptime()
Returns
Type Description
System.UInt64

ulong value.

| Improve this Doc View Source

GetCPUVendorName()

Get CPU vendor name.

Declaration
public static string GetCPUVendorName()
Returns
Type Description
System.String

string value.

| Improve this Doc View Source

GetEndOfKernel()

Get end of the kernel. Plugged.

Declaration
public static uint GetEndOfKernel()
Returns
Type Description
System.UInt32
| Improve this Doc View Source

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.

| Improve this Doc View Source

Halt()

Halt the CPU. Plugged.

Declaration
public void Halt()
| Improve this Doc View Source

InitFloat()

Init float. Plugged.

Declaration
public void InitFloat()
| Improve this Doc View Source

InitSSE()

Init SSE. Plugged.

Declaration
public void InitSSE()
| Improve this Doc View Source

MemoryMapExists()

Checks if Multiboot returned a memory map

Declaration
public static bool MemoryMapExists()
Returns
Type Description
System.Boolean
| Improve this Doc View Source

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.

| Improve this Doc View Source

Reboot()

Reboot the CPU.

Declaration
public void Reboot()
| Improve this Doc View Source

UpdateIDT(Boolean)

Update IDT. Plugged.

Declaration
public void UpdateIDT(bool aEnableInterruptsImmediately)
Parameters
Type Name Description
System.Boolean aEnableInterruptsImmediately
| Improve this Doc View Source

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
  • Improve this Doc
  • View Source
In This Article
Back to top