public bool Reset() { var acpi = DeviceService.GetFirstDevice <IACPI>(DeviceStatus.Online).DeviceDriver as IACPI; if (acpi == null) { return(false); } BaseIOPortWrite address = acpi.ResetAddress; byte value = acpi.ResetValue; if (address != null) { address.Write8(value); // Map memory Pointer ptr = HAL.GetPhysicalMemory((Pointer)(uint)address.Address, 1).Address; BaseIOPortWrite mappedResetReg = HAL.GetWriteIOPort((ushort)ptr); mappedResetReg.Write8(value); // Write to PCI Configuration Space (we're actually writing on the host bridge controller) // TODO: Fix /*var controller = DeviceService.GetFirstDevice<IHostBridgeController>(DeviceStatus.Online).DeviceDriver as IHostBridgeController; * * controller.SetCPUResetInformation((byte)address.Address, value); * controller.CPUReset();*/ return(true); } return(false); }
/// <summary> /// Gets the memory. /// </summary> /// <param name="region">The region.</param> /// <returns></returns> public Memory GetMemory(byte region) { return(HAL.GetPhysicalMemory(memoryRegions[region].BaseAddress, memoryRegions[region].Size)); }
/// <summary> /// Gets the memory. /// </summary> /// <param name="address">The address.</param> /// <param name="size">The size.</param> /// <returns></returns> public Memory GetMemory(uint address, uint size) { return(HAL.GetPhysicalMemory(address, size)); }
/// <summary> /// Gets the memory. /// </summary> /// <param name="region">The region.</param> /// <returns></returns> public ConstrainedPointer GetMemory(byte region) { return(HAL.GetPhysicalMemory(addressRegions[region].Address, addressRegions[region].Size)); }