diff --git a/bios-maps/asus/x870-gaming-plus-wifi.gv b/bios-maps/asus/x870-gaming-plus-wifi.gv new file mode 100644 index 0000000..9814129 --- /dev/null +++ b/bios-maps/asus/x870-gaming-plus-wifi.gv @@ -0,0 +1,264 @@ +digraph bios +{ + //compound = true + node [shape = "box"] + style = dashed + color = red + //rankdir = "LR" + + //VALUES ARE DEFAULT VALUES FROM A FRESHLY CLEARED CMOS + //THIS FILE IS NOT TO BE MODIFIED EXCEPT FOR BREAKING BIOS UPDATES + + subgraph cluster_headers + { + "EZ Mode" + "Main" + "Ai Tweaker" + subgraph cluster_ai_tweaker + { + "Ai Overclock Tuner" + "DOCP" + "BCLK Frequency" + "Memory Frequency" + "FCLK Frequency" + "Core tunings Configuration for gaming" + "Core Performance Boost" + "CPU Core Ratio" + "CPU Core Ratio (Per CCX)" + "Turbo Game Mode" + "Gaming Adaptive CCD Parker" + "AI Cache Boost" + "DRAM Timing Control" + // "Precision Boost Overdrive" skip over this, not using it + "DIGI + VRM" + subgraph cluster_vrm + { + "DIGI + VRM (Enter subfolder)" + "VRM Initialization Check" + "Voltage training" [option_type = "list" value = "Auto" options = "Auto,Disabled,Enabled" traversal_key = "ArrowDown"] + "CPU Load-line Calibration" [option_type = "list" value = "Auto" options = "Auto,Level 1,Level 2,Level 3,Level 4,Level 5,Level 6,Level 7,Level 8" traversal_key = "ArrowDown"] + "CPU Current Capability" [option_type = "list" value = "Auto" options = "Auto,100%,110%,120%,130%,140%" traversal_key = "ArrowDown"] + "CPU VRM Switching Frequency" + "Fixed CPU VRM Switching Frequency(KHz)" [option_type = "field" value = "600"] + "CPU Power Duty Control" + "CPU Power Phase Control" [option_type = "list" value = "Auto" options = "Auto,Standard,Optimized,Extreme,Manual" traversal_key = "ArrowDown"] + "VDDSOC Current Capability" [option_type = "list" value = "Auto" options = "Auto,100%,110%,120%,130%,140%" traversal_key = "ArrowDown"] + "VDDSOC Switching Frequency" + "Fixed VDDSOC Switching Frequency(KHz)" [option_type = "field" value = "600"] + "VDDSOC Power Duty Control" + "VDDSOC Power Phase Control" [option_type = "list" value = "Auto" options = "Auto,Standard,Optimized,Extreme,Manual" traversal_key = "ArrowDown"] + } + + "Performance Bias" + "Tweaker's Paradise" + "Core Flex" + "AI Features" + "CPU Core Voltage" + "CPU SOC Voltage" + "VDDSOC Voltage Override" [option_type = "field" value = "Auto"] + "CPU VDDIO/MC Voltage" + "Misc Voltage" + "VDDP Voltage" + "High DRAM Voltage Mode" + "DRAM VDD Voltage" + "DRAM VDDQ Voltage" + "VDDG CCD Voltage" + "VDDG IOD Voltage" + "Advanced Memory Voltages" + } + + "Advanced" + subgraph cluster_advanced + { + "Trusted Computing" + // unimportant + // "AMD fTPM Configuration" + // "UEFI Variable Protection" + // "CPU Configuration" + // "PCI Subsystem Settings" + // "USB Configuration" + // "Network Stack Configuration" + // "NVMe Configuration" + // "HDD/SSD SMART Information" + // "SATA Configuration" + // "APM Configuration" + "Onboard Devices Configuration" + "NB Configuration" + subgraph cluster_nb_config + { + "NB Configuration (Enter subfolder)" + "Primary Video Device" + "Integrated Graphics" [option_type = "list" value = "Auto" options = "Auto,Force,Disabled" traversal_key = "ArrowUp"] + "UMA Frame Buffer Size" + } + + "AMD CBS" + subgraph cluster_amd_cbs + { + // why in the name of all that is unholy is this list in reverse?! + // this is probably the only option that matters + "ACPI SRAT L3 Cache As NUMA Domain" [option_type = "list" value = "Auto" options = "Auto,Enabled,Disabled" traversal_key = "ArrowUp"] + } + + "AMD PBS" + "AMD Overclocking" + subgraph cluster_amd_overclocking + { + "AMD Overclocking Subfolder" + "Manual CPU Overclocking" + "DDR and Infinity Fabric Frequency/Timings" + "Precision Boost Overdrive" + subgraph cluster_pbo + { + "Precision Boost Overdrive (Enter subfolder)" + "Precision Boost Overdrive (Setting)" + "PBO Limits" [option_type = "list" value = "Auto" options = "Auto,Disable,Motherboard,Manual" traversal_key = "ArrowDown"] + "Precision Boost Overdrive Scalar Ctrl" + "Precision Boost Overdrive Scalar" [option_type = "list" value = "1X" options = "1X,2X,3X,4X,5X,6X,7X,8X,9X,10X" traversal_key = "ArrowDown"] + "CPU Boost Clock Override" + "Max CPU Boost Clock Override(+)" [option_type = "field" value = "25"] + "Platform Thermal Throttle Ctrl" + "GFX Curve Optimizer" + "Curve Optimizer" + "Curve Shaper" + } + } + } + + "Monitor" + "Boot" + "Tool" + subgraph cluster_tool + { + // nothing else here matters + "Download & Install ASUS DriverHub app" [option_type = "list" value = "Enabled" options = "Enabled,Disabled" traversal_key = "ArrowUp"] + } + + "Exit" + } + + + + + + + + + "Monitor" + "Boot" + "Exit" + "Save Changes and Exit" + + "EZ Mode" -> "Main" [keypath = "F7"] + "Main" -> "Ai Tweaker" [keypath = "ArrowRight"] + "Ai Tweaker" -> "Advanced" [keypath = "ArrowRight"] + "Advanced" -> "Tool" [keypath = "ArrowRight"] + "Tool" -> "Monitor" [keypath = "ArrowRight"] + "Monitor" -> "Boot" [keypath = "ArrowRight"] + "Boot" -> "Exit" [keypath = "ArrowRight"] + + "Exit" -> "Boot" [keypath = "ArrowLeft"] + "Boot" -> "Monitor" [keypath = "ArrowLeft"] + "Monitor" -> "Tool" [keypath = "ArrowLeft"] + "Tool" -> "Advanced" [keypath = "ArrowLeft"] + "Advanced" -> "Ai Tweaker" [keypath = "ArrowLeft"] + + "Ai Tweaker" -> "Ai Overclock Tuner" [keypath = "Home" initial_keypath = "Home,Enter,ArrowDown,ArrowDown,ArrowDown,ArrowDown,Enter" visited = "false"] + "Ai Overclock Tuner" -> "DOCP" [keypath = "ArrowDown"] + "DOCP" -> "BCLK Frequency" [keypath = "ArrowDown"] + "BCLK Frequency" -> "Memory Frequency" [keypath = "ArrowDown"] + "Memory Frequency" -> "FCLK Frequency" [keypath = "ArrowDown"] + "FCLK Frequency" -> "Core tunings Configuration for gaming" [keypath = "ArrowDown"] + "Core tunings Configuration for gaming" -> "Core Performance Boost" [keypath = "ArrowDown"] + "Core Performance Boost" -> "CPU Core Ratio" [keypath = "ArrowDown"] + "CPU Core Ratio" -> "CPU Core Ratio (Per CCX)" [keypath = "ArrowDown"] + "CPU Core Ratio (Per CCX)" -> "Turbo Game Mode" [keypath = "ArrowDown"] + "Turbo Game Mode" -> "Gaming Adaptive CCD Parker" [keypath = "ArrowDown"] + "Gaming Adaptive CCD Parker" -> "AI Cache Boost" [keypath = "ArrowDown"] + "AI Cache Boost" -> "DRAM Timing Control" [keypath = "ArrowDown"] + // skip over PBO menu here, it's bad + "DRAM Timing Control" -> "DIGI + VRM" [keypath = "ArrowDown,ArrowDown"] + + "DIGI + VRM" -> "DIGI + VRM (Enter subfolder)" [keypath = "Enter,Home"] + "DIGI + VRM (Enter subfolder)" -> "VRM Initialization Check" [keypath = "ArrowDown"] + "VRM Initialization Check" -> "Voltage training" [keypath = "ArrowDown"] + "Voltage training" -> "CPU Load-line Calibration" [keypath = "ArrowDown"] + "CPU Load-line Calibration" -> "CPU Current Capability" [keypath = "ArrowDown"] + "CPU Current Capability" -> "CPU VRM Switching Frequency" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "CPU VRM Switching Frequency" -> "Fixed CPU VRM Switching Frequency(KHz)" [keypath = "ArrowDown"] + "Fixed CPU VRM Switching Frequency(KHz)" -> "CPU Power Duty Control" [keypath = "ArrowDown"] + "CPU Power Duty Control" -> "CPU Power Phase Control" [keypath = "ArrowDown"] + "CPU Power Phase Control" -> "VDDSOC Current Capability" [keypath = "ArrowDown"] + "VDDSOC Current Capability" -> "VDDSOC Switching Frequency" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "VDDSOC Switching Frequency" -> "Fixed VDDSOC Switching Frequency(KHz)" [keypath = "ArrowDown"] + "Fixed VDDSOC Switching Frequency(KHz)" -> "VDDSOC Power Duty Control" [keypath = "ArrowDown"] + "VDDSOC Power Duty Control" -> "VDDSOC Power Phase Control" [keypath = "ArrowDown"] + + "DIGI + VRM (Enter subfolder)", "VRM Initialization Check", "Voltage training", "CPU Load-line Calibration", "CPU Current Capability", "CPU VRM Switching Frequency", "CPU Power Duty Control", "CPU Power Phase Control", "VDDSOC Current Capability", "VDDSOC Switching Frequency", "VDDSOC Power Duty Control", "VDDSOC Power Phase Control" -> "DIGI + VRM" [keypath = "Escape"] + + "DIGI + VRM" -> "Performance Bias" [keypath = "ArrowDown"] + "Performance Bias" -> "Tweaker's Paradise" [keypath = "ArrowDown"] + "Tweaker's Paradise" -> "Core Flex" [keypath = "ArrowDown"] + "Core Flex" -> "AI Features" [keypath = "ArrowDown"] + "AI Features" -> "CPU Core Voltage" [keypath = "ArrowDown"] + "CPU Core Voltage" -> "CPU SOC Voltage" [keypath = "ArrowDown", initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "CPU SOC Voltage" -> "VDDSOC Voltage Override" [keypath = "ArrowDown"] + "VDDSOC Voltage Override" -> "CPU VDDIO/MC Voltage" [keypath = "ArrowDown"] + "CPU VDDIO/MC Voltage" -> "Misc Voltage" [keypath = "ArrowDown"] + "Misc Voltage" -> "VDDP Voltage" [keypath = "ArrowDown"] + "VDDP Voltage" -> "High DRAM Voltage Mode" [keypath = "ArrowDown"] + "High DRAM Voltage Mode" -> "DRAM VDD Voltage" [keypath = "ArrowDown"] + "DRAM VDD Voltage" -> "DRAM VDDQ Voltage" [keypath = "ArrowDown"] + "DRAM VDDQ Voltage" -> "VDDG CCD Voltage" [keypath = "ArrowDown"] + "VDDG CCD Voltage" -> "VDDG IOD Voltage" [keypath = "ArrowDown"] + "VDDG IOD Voltage" -> "Advanced Memory Voltages" [keypath = "ArrowDown"] + + "Ai Overclock Tuner", "DOCP", "BCLK Frequency", "Memory Frequency", "FCLK Frequency", "Core tunings Configuration for gaming", "Core Performance Boost", "CPU Core Ratio", "CPU Core Ratio (Per CCX)", "Turbo Game Mode", "Gaming Adaptive CCD Parker", "AI Cache Boost", "DRAM Timing Control", "DIGI + VRM", "Performance Bias", "Tweaker's Paradise", "Core Flex", "AI Features", "CPU Core Voltage", "CPU SOC Voltage", "CPU VDDIO/MC Voltage", "Misc Voltage", "VDDP Voltage", "High DRAM Voltage Mode", "DRAM VDD Voltage", "DRAM VDDQ Voltage", "VDDG CCD Voltage", "VDDG IOD Voltage", "Advanced Memory Voltages" -> "Ai Tweaker" [keypath = "Home"] + + "Advanced" -> "Trusted Computing" [keypath = "Home"] + "Trusted Computing" -> "Onboard Devices Configuration" [keypath = "ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown"] + "Onboard Devices Configuration" -> "NB Configuration" [keypath = "ArrowDown"] + + "NB Configuration" -> "NB Configuration (Enter subfolder)" [keypath = "Enter,Home"] + "NB Configuration (Enter subfolder)" -> "Primary Video Device" [keypath = "ArrowDown"] + "Primary Video Device" -> "Integrated Graphics" [keypath = "ArrowDown"] + "Integrated Graphics" -> "UMA Frame Buffer Size" [keypath = "ArrowDown"] + + "NB Configuration (Enter subfolder)", "Primary Video Device", "Integrated Graphics", "UMA Frame Buffer Size" -> "NB Configuration" [keypath = "Escape"] + + "NB Configuration" -> "AMD CBS" [keypath = "ArrowDown"] + "AMD CBS" -> "AMD PBS" [keypath = "ArrowDown"] + "AMD PBS" -> "AMD Overclocking" [keypath = "ArrowDown"] + + "Onboard Devices Configuration", "NB Configuration", "AMD CBS", "AMD PBS", "Trusted Computing" -> "Advanced" [keypath = "Home"] + + "AMD CBS" -> "ACPI SRAT L3 Cache As NUMA Domain" [keypath = "Enter,Home,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,Enter,Home,ArrowDown,ArrowDown,Enter,Home,ArrowDown"] + "ACPI SRAT L3 Cache As NUMA Domain" -> "AMD CBS" [keypath = "Escape,Escape,Escape"] + + "AMD Overclocking" -> "AMD Overclocking Subfolder" [keypath = "Enter,Home,ArrowDown,Enter,Home"] + "AMD Overclocking Subfolder" -> "Manual CPU Overclocking" [keypath = "ArrowDown"] + "Manual CPU Overclocking" -> "DDR and Infinity Fabric Frequency/Timings" [keypath = "ArrowDown"] + "DDR and Infinity Fabric Frequency/Timings" -> "Precision Boost Overdrive" [keypath = "ArrowDown"] + + "AMD Overclocking Subfolder", "Manual CPU Overclocking", "DDR and Infinity Fabric Frequency/Timings", "Precision Boost Overdrive" -> "AMD PBS" [keypath = "Escape,Escape"] + + "Precision Boost Overdrive" -> "Precision Boost Overdrive (Enter subfolder)" [keypath = "Enter"] + "Precision Boost Overdrive (Enter subfolder)" -> "Precision Boost Overdrive (Setting)" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,ArrowDown,ArrowDown,Enter" visited = "false"] + "Precision Boost Overdrive (Setting)" -> "PBO Limits" [keypath = "ArrowDown"] + "PBO Limits" -> "Precision Boost Overdrive Scalar Ctrl" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "Precision Boost Overdrive Scalar Ctrl" -> "Precision Boost Overdrive Scalar" [keypath = "ArrowDown"] + "Precision Boost Overdrive Scalar" -> "CPU Boost Clock Override" [keypath = "ArrowDown" initial_keypath = "ArrowDown,Enter,ArrowDown,Enter" visited = "false"] + "CPU Boost Clock Override" -> "Max CPU Boost Clock Override(+)" [keypath = "ArrowDown"] + "Max CPU Boost Clock Override(+)" -> "Platform Thermal Throttle Ctrl" [keypath = "ArrowDown"] + "Platform Thermal Throttle Ctrl" -> "GFX Curve Optimizer" [keypath = "ArrowDown"] + "GFX Curve Optimizer" -> "Curve Optimizer" [keypath = "ArrowDown"] + "Curve Optimizer" -> "Curve Shaper" [keypath = "ArrowDown"] + + "Precision Boost Overdrive", "PBO Limits", "Precision Boost Overdrive Scalar Ctrl", "CPU Boost Clock Override", "Platform Thermal Throttle Ctrl" -> "Precision Boost Overdrive (Enter subfolder)" [keypath = "Escape"] + "Precision Boost Overdrive (Enter subfolder)" -> "AMD Overclocking" [keypath = "Escape,Escape"] + + "Tool" -> "Download & Install ASUS DriverHub app" [keypath = "Home,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,ArrowDown,Enter,Home,ArrowDown"] + "Download & Install ASUS DriverHub app" -> "Tool" [keypath = "Escape"] + + "Exit" -> "Save Changes and Exit" [keypath = "Enter,Enter"] +} diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 1953bf7..05c4b8a 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -9,37 +9,40 @@ void loop() {} #include #include #include +#include #include #include #include +USBHID HID; USBHIDAbsoluteMouse Mouse; USBHIDKeyboard Keyboard; HardwareSerial &host_serial = Serial; -HardwareSerial &mobo_serial = Serial1; +// HardwareSerial &mobo_serial = Serial1; JsonDocument mkb_input; -JsonDocument post_codes; +// JsonDocument post_codes; JsonDocument power_status; // put function declarations here: int myFunction(int, int); -const int8_t pwr_button = 3; -const int8_t cmos_button = 46; -const int8_t pwr_detect = 8; +const int8_t pwr_button = 46; +const int8_t cmos_button = 3; +// const int8_t pwr_detect = 8; void setup() { host_serial.begin(115200); - mobo_serial.begin(115200, SERIAL_8N1, 18); + // mobo_serial.begin(115200, SERIAL_8N1, 18); + HID.begin(); Mouse.begin(); Keyboard.begin(); USB.begin(); pinMode(pwr_button, OUTPUT); pinMode(cmos_button, OUTPUT); - pinMode(pwr_detect, INPUT); + // pinMode(pwr_detect, INPUT); } void loop() @@ -51,7 +54,7 @@ void loop() if (cur_loop_timestamp - check_power_status_timestamp >= 100000) { - if (analogRead(pwr_detect) > 1000) + /* if (analogRead(pwr_detect) > 1000) { power_status["pwr"] = true; } @@ -59,6 +62,16 @@ void loop() else { power_status["pwr"] = false; + } */ + + if (HID.ready()) + { + power_status["usb"] = true; + } + + else + { + power_status["usb"] = false; } serializeJson(power_status, host_serial); @@ -66,12 +79,12 @@ void loop() check_power_status_timestamp = esp_timer_get_time(); } - while (mobo_serial.available()) + /* while (mobo_serial.available()) { post_codes["post_code"] = mobo_serial.read(); serializeJson(post_codes, host_serial); host_serial.write('\n'); - } + } */ if (host_serial.available()) { diff --git a/my_state_diagram.svg b/my_state_diagram.svg index d4a4808..bd594e2 100644 --- a/my_state_diagram.svg +++ b/my_state_diagram.svg @@ -1,254 +1,268 @@ - - - - -State Machine + + + +State Machine PoweredOff - -PoweredOff + +PoweredOff POST - -POST + +POST PoweredOff->POST - - -power_on + + +power_on - + POST->PoweredOff - - -hard_shutdown + + +hard_shutdown EnterBIOS - -EnterBIOS + +EnterBIOS - + POST->EnterBIOS - - -enter_bios + + +enter_bios + + + +IdleWaitingForInput + + +IdleWaitingForInput + + + +POST->IdleWaitingForInput + + +go_idle - + WaitingForOS - -WaitingForOS + +WaitingForOS - + POST->WaitingForOS - - -enter_os + + +wait_os - + BootLoop - -BootLoop + +BootLoop - + POST->BootLoop - - -unsuccessful_post + + +unsuccessful_post BIOSSetup - -BIOSSetup + +BIOSSetup EnterBIOS->BIOSSetup - - -start_bios_setup + + +start_bios_setup + + + +EnterBIOS->IdleWaitingForInput + + +go_idle - + BIOSSetup->PoweredOff - - -hard_shutdown + + +hard_shutdown - -BIOSSetup->POST - - -finished_bios_setup - - -WaitingForOS->PoweredOff - - -hard_shutdown - - - -WaitingForHWInfo - -WaitingForHWInfo - - - -WaitingForOS->WaitingForHWInfo - - -os_booted - - - -OCTypeDecision - -OCTypeDecision - - - -WaitingForHWInfo->OCTypeDecision - - -hwinfo_available - - - -RoughMulticoreUndervolt - -RoughMulticoreUndervolt - - - -OCTypeDecision->RoughMulticoreUndervolt - - -rough_multicore_undervolt - - - -PreciseMulticoreUndervolt - -PreciseMulticoreUndervolt - - - -OCTypeDecision->PreciseMulticoreUndervolt - - -precise_multicore_undervolt - - - -SingleCoreTuning - -SingleCoreTuning - - - -OCTypeDecision->SingleCoreTuning - - -single_core_tuning - - - -RoughMulticoreUndervolt->PoweredOff - - -hard_shutdown - - - -RoughMulticoreUndervolt->POST - - -reboot - - - -PreciseMulticoreUndervolt->PoweredOff - - -hard_shutdown - - - -PreciseMulticoreUndervolt->POST - - -reboot - - - -SingleCoreTuning->PoweredOff - - -hard_shutdown - - - -SingleCoreTuning->POST - - -reboot - - - -BootLoop->PoweredOff - - -trigger_cmos_reset | hard_shutdown - - - -IdleWaitingForInput - - -IdleWaitingForInput +BIOSSetup->POST + + +finished_bios_setup - + IdleWaitingForInput->PoweredOff - - -hard_shutdown | soft_shutdown + + +hard_shutdown | soft_shutdown - + IdleWaitingForInput->POST - - -power_on | reboot + + +reboot + + + +WaitingForHWInfo + +WaitingForHWInfo - + IdleWaitingForInput->WaitingForHWInfo - - -begin_automation + + +begin_automation + + + +WaitingForOS->PoweredOff + + +hard_shutdown + + + +WaitingForOS->WaitingForHWInfo + + +os_booted + + + +OCTypeDecision + +OCTypeDecision + + + +WaitingForHWInfo->OCTypeDecision + + +hwinfo_available + + + +RoughMulticoreUndervolt + +RoughMulticoreUndervolt + + + +OCTypeDecision->RoughMulticoreUndervolt + + +rough_multicore_undervolt + + + +PreciseMulticoreUndervolt + +PreciseMulticoreUndervolt + + + +OCTypeDecision->PreciseMulticoreUndervolt + + +precise_multicore_undervolt + + + +SingleCoreTuning + +SingleCoreTuning + + + +OCTypeDecision->SingleCoreTuning + + +single_core_tuning + + + +RoughMulticoreUndervolt->PoweredOff + + +hard_shutdown + + + +RoughMulticoreUndervolt->POST + + +reboot + + + +PreciseMulticoreUndervolt->PoweredOff + + +hard_shutdown + + + +PreciseMulticoreUndervolt->POST + + +reboot + + + +SingleCoreTuning->PoweredOff + + +hard_shutdown + + + +SingleCoreTuning->POST + + +reboot + + + +BootLoop->PoweredOff + + +trigger_cmos_reset diff --git a/profiles/default.toml b/profiles/default.toml index 465c70b..b9ba39e 100644 --- a/profiles/default.toml +++ b/profiles/default.toml @@ -8,21 +8,31 @@ resolution = "1920x1080" fps = "60.000" [client] -hostname = "10.20.30.48" +hostname = "10.20.30.90" hwinfo_port = "60000" # Unless you've changed it! +# MAKE SURE YOU USE SINGLE QUOTES, THIS HAS TO BE A LITERAL +ryzen_smu_cli_path = 'C:\Users\rawhide\Downloads\win-x64\ryzen-smu-cli.exe' +ycruncher_path = 'C:\Users\rawhide\Downloads\y-cruncher v0.8.6.9545b\y-cruncher v0.8.6.9545\y-cruncher.exe' +bios_map_path = 'bios-maps/asus/x870-gaming-plus-wifi.gv' [client.overclocking.common] # Just some ideas of how the settings may work for your system -# "ACPI SRAT L3 Cache As NUMA Domain" = "Enabled" -# "Spread Spectrum" = "Disabled" -# "PBO Limits" = "Motherboard" -# "Precision Boost Overdrive Scalar" = "10X" -# "Max CPU Boost Clock Override(+)" = "200" -# "Auto Driver Installer" = "Disabled" -# "dGPU Only Mode" = "Enabled" +"ACPI SRAT L3 Cache As NUMA Domain" = "Enabled" +"PBO Limits" = "Motherboard" +"Precision Boost Overdrive Scalar" = "10X" +"Max CPU Boost Clock Override(+)" = "200" +"Integrated Graphics" = "Disabled" +"Voltage training" = "Enabled" +"CPU Load-line Calibration" = "Level 8" +"CPU Current Capability" = "140%" +"Fixed CPU VRM Switching Frequency(KHz)" = "700" +"CPU Power Phase Control" = "Extreme" +"VDDSOC Current Capability" = "140%" +"Fixed VDDSOC Switching Frequency(KHz)" = "700" +"VDDSOC Power Phase Control" = "Extreme" [client.overclocking.cpu] [client.overclocking.memory] # "DRAM Profile Setting" = "XMP1-6000" # "DRAM Performance Mode" = "Aggressive" -# "SOC/Uncore OC Voltage (VDD_SOC)" = "1.1" \ No newline at end of file +"VDDSOC Voltage Override" = "1.2" \ No newline at end of file diff --git a/webui/ipkvm/__init__.py b/webui/ipkvm/__init__.py index 155057f..33f68bf 100644 --- a/webui/ipkvm/__init__.py +++ b/webui/ipkvm/__init__.py @@ -1,3 +1,4 @@ -from ipkvm import routes +from ipkvm import routes, states +from ipkvm.states import events -__all__ = ["routes"] +__all__ = ["routes", "states", "events"] diff --git a/webui/ipkvm/states/__init__.py b/webui/ipkvm/states/__init__.py index e69de29..dc28854 100644 --- a/webui/ipkvm/states/__init__.py +++ b/webui/ipkvm/states/__init__.py @@ -0,0 +1,6 @@ +from . import states + +model = states.Overclocking() +machine = states.MyMachine(model, states=states.State, initial=model.state) + +machine.get_graph().draw('my_state_diagram.svg', prog='dot') \ No newline at end of file diff --git a/webui/ipkvm/states/events.py b/webui/ipkvm/states/events.py index e3805ae..cea103c 100644 --- a/webui/ipkvm/states/events.py +++ b/webui/ipkvm/states/events.py @@ -1,23 +1,29 @@ from ipkvm.app import ui +from . import model + +from ipkvm.util.mkb import esp32_serial +from ipkvm.util.mkb.mkb import GPIO +import time @ui.on("power_on") def handle_poweron(): - states.model.power_on() + model.power_on() @ui.on("soft_power_off") def handle_soft_poweroff(): - states.model.soft_shutdown() + model.soft_shutdown() @ui.on("hard_power_off") def handle_hard_poweroff(): - states.model.hard_shutdown() + model.hard_shutdown() @ui.on("reboot_into_bios") def handle_reboot_bios(): - states.model.reboot_into_bios() + model.reboot_into_bios() @ui.on("clear_cmos") def handle_clear_cmos(): + print("clear cmos and restart") msg = { "cmos": GPIO.HIGH.value } @@ -28,11 +34,14 @@ def handle_clear_cmos(): } esp32_serial.mkb_queue.put(msg) - time.sleep(1) + time.sleep(5) - power_switch(0.2) - spam_delete_until_bios() - -@ui.on("test_route") -def handle_test_route(): - graphs.test_route() \ No newline at end of file + msg = { + "pwr": GPIO.HIGH.value + } + esp32_serial.mkb_queue.put(msg) + time.sleep(0.2) + msg = { + "pwr": GPIO.LOW.value + } + esp32_serial.mkb_queue.put(msg) diff --git a/webui/ipkvm/states/states.py b/webui/ipkvm/states/states.py index 52aa3c4..452d98c 100644 --- a/webui/ipkvm/states/states.py +++ b/webui/ipkvm/states/states.py @@ -2,10 +2,13 @@ from enum import Enum import time from transitions.experimental.utils import with_model_definitions, add_transitions, transition from transitions.extensions import GraphMachine -from ipkvm.util import esp32_serial -from ipkvm.util.mkb import GPIO, HIDKeyCode +from ipkvm.util.mkb import esp32_serial +from ipkvm.util.mkb.mkb import GPIO +from ipkvm.util.mkb.scancodes import HIDKeyCode from ipkvm.app import logging, ui +logging.basicConfig(level=logging.INFO) + class State(Enum): PoweredOff = "powered off" EnterBIOS = "enter bios" @@ -22,15 +25,24 @@ class State(Enum): class Overclocking: - state: State = State.IdleWaitingForInput + # wait for power status ig + time.sleep(0.5) + if esp32_serial.usb_status: + state: State = State.IdleWaitingForInput + else: + state: State = State.PoweredOff + + _enter_bios_flag = False + _running_automatic = False + + _current_BIOS_location = "EZ Mode" # TRANSITION DEFINITIONS - @add_transitions(transition([State.PoweredOff, State.IdleWaitingForInput], State.POST, after="_power_on", - unless="client_powered")) + @add_transitions(transition(State.PoweredOff, State.POST, unless="client_powered")) def power_on(self): ... @add_transitions(transition(State.POST, State.WaitingForOS)) - def enter_os(self): ... + def wait_os(self): ... @add_transitions(transition(State.WaitingForOS, State.WaitingForHWInfo)) def os_booted(self): ... @@ -38,7 +50,7 @@ class Overclocking: @add_transitions(transition(State.WaitingForHWInfo, State.OCTypeDecision)) def hwinfo_available(self): ... - @add_transitions(transition(State.POST, State.EnterBIOS, after="_enter_bios")) + @add_transitions(transition(State.POST, State.EnterBIOS)) def enter_bios(self): ... @add_transitions(transition(State.EnterBIOS, State.BIOSSetup)) @@ -60,14 +72,13 @@ class Overclocking: State.PreciseMulticoreUndervolt, State.SingleCoreTuning], State.POST)) def reboot(self): ... - @add_transitions(transition([State.BIOSSetup, State.IdleWaitingForInput, State.BootLoop, State.POST, - State.WaitingForOS, State.RoughMulticoreUndervolt, - State.PreciseMulticoreUndervolt, State.SingleCoreTuning], - State.PoweredOff, after="_hard_shutdown", conditions="client_powered")) + @add_transitions(transition([State.BIOSSetup, State.IdleWaitingForInput, State.POST, State.WaitingForOS, + State.RoughMulticoreUndervolt, State.PreciseMulticoreUndervolt, + State.SingleCoreTuning], State.PoweredOff, after="_hard_shutdown")) def hard_shutdown(self): ... @add_transitions(transition(State.IdleWaitingForInput, State.PoweredOff, - after="_soft_shutdown", conditions="client_powered")) + after="_soft_shutdown")) def soft_shutdown(self): ... @add_transitions(transition(State.OCTypeDecision, State.RoughMulticoreUndervolt)) @@ -79,11 +90,91 @@ class Overclocking: @add_transitions(transition(State.OCTypeDecision, State.SingleCoreTuning)) def single_core_tuning(self): ... + @add_transitions(transition([State.POST, State.EnterBIOS], State.IdleWaitingForInput)) + def go_idle(self): ... + # PROPERTIES GO HERE @property def client_powered(self): - return esp32_serial.power_status + return esp32_serial.usb_status + + @property + def current_BIOS_location(self): + return self._current_BIOS_location + + @current_BIOS_location.setter + def current_BIOS_location(self, value: str): + if type(value) == str: + self._current_BIOS_location = value + + else: + raise ValueError("Attempted to set the current BIOS location to a non-string value!") + + # STATE ENTRY FUNCTIONS + def on_enter_POST(self): + post_timer = time.time() + + # If five minutes passes with no USB availability, something has gone terribly wrong... + while time.time() - post_timer <= 300 and not esp32_serial.usb_status: + pass + + if not esp32_serial.usb_status: + self.unsuccessful_post() + + else: + if self._enter_bios_flag: + self.enter_bios() + + elif self._running_automatic: + self.wait_os() + + else: + self.go_idle() + + def on_enter_EnterBIOS(self): + # # Wait until the POST has progressed far enough for USB devices to be loaded and options to be imminent + # esp32_serial.notify_code = "45" + # esp32_serial.active_notification_request.set() + # esp32_serial.post_code_notify.wait() + # esp32_serial.post_code_notify.clear() +# + # # Spam delete until the BIOS is loaded + # esp32_serial.notify_code = "Ab" + # esp32_serial.active_notification_request.set() + # while not esp32_serial.post_code_notify.is_set(): + + spam_timer = time.time() + + # Crushed by my lack of consistent access to BIOS post codes, we simply take our time... + while time.time() - spam_timer <= 10: + msg = { + "key_down": HIDKeyCode.Delete.value + } + esp32_serial.mkb_queue.put(msg) + time.sleep(0.1) + msg = { + "key_up": HIDKeyCode.Delete.value + } + esp32_serial.mkb_queue.put(msg) + time.sleep(0.1) + + # esp32_serial.post_code_notify.clear() + + # Wait a few seconds for the BIOS to become responsive + time.sleep(5) + + self._enter_bios_flag = False + + if self._running_automatic: + self.start_bios_setup() + + else: + self.go_idle() + + # STATE EXIT FUNCTIONS + def on_exit_PoweredOff(self): + self._power_switch(0.2) # UTILITY FUNCTIONS GO HERE def _power_switch(self, delay: float): @@ -98,68 +189,30 @@ class Overclocking: esp32_serial.mkb_queue.put(msg) # FUNCTIONS TRIGGERED BY STATE CHANGES - def _power_on(self): - self._power_switch(0.2) - - # Unknown code definition, but this is the first consistent one indicating POST has started. - while esp32_serial.last_post_code != "FC": - pass - def _hard_shutdown(self): self._power_switch(5) - while self.client_powered: - pass def _soft_shutdown(self): self._power_switch(0.2) - while self.client_powered: + while esp32_serial.usb_status: pass - def _enter_bios(self): - # Wait until the POST has progressed far enough for USB devices to be loaded and options to be imminent - esp32_serial.notify_code = "45" - esp32_serial.active_notification_request.set() - esp32_serial.post_code_notify.wait() - esp32_serial.post_code_notify.clear() - - # Spam delete until the BIOS is loaded - esp32_serial.notify_code = "Ab" - esp32_serial.active_notification_request.set() - while not esp32_serial.post_code_notify.is_set(): - msg = { - "key_down": HIDKeyCode.Delete.value - } - esp32_serial.mkb_queue.put(msg) - time.sleep(0.1) - msg = { - "key_up": HIDKeyCode.Delete.value - } - esp32_serial.mkb_queue.put(msg) - time.sleep(0.1) - - esp32_serial.post_code_notify.clear() - - # Wait a few seconds for the BIOS to become responsive - time.sleep(5) + # Wait a few seconds to REALLY be sure we're powered off... + time.sleep(10) # OTHER FUNCTIONS GO HERE def reboot_into_bios(self): - if self.client_powered: + if esp32_serial.usb_status: if self.state is State.IdleWaitingForInput: self.soft_shutdown() else: self.hard_shutdown() + self._enter_bios_flag = True self.power_on() - self.enter_bios() @with_model_definitions class MyMachine(GraphMachine): pass - -model = Overclocking() -machine = MyMachine(model, states=State, initial=model.state) - -machine.get_graph().draw('my_state_diagram.svg', prog='dot') diff --git a/webui/ipkvm/static/js/mkb_handler.js b/webui/ipkvm/static/js/mkb_handler.js index 10c7634..5c42a45 100644 --- a/webui/ipkvm/static/js/mkb_handler.js +++ b/webui/ipkvm/static/js/mkb_handler.js @@ -14,7 +14,10 @@ function mkbhandler_load() function keydown_handler(event) { - socket.emit('key_down', event.code); + if (event.code != "MetaLeft" && event.code != "MetaRight") + { + socket.emit('key_down', event.code); + } event.preventDefault(); event.stopPropagation(); } diff --git a/webui/ipkvm/static/js/my-codemirror.js b/webui/ipkvm/static/js/my-codemirror.js index 50ce9c8..799bf8f 100644 --- a/webui/ipkvm/static/js/my-codemirror.js +++ b/webui/ipkvm/static/js/my-codemirror.js @@ -1,8 +1,9 @@ let code_mirror; +let code_div; function codemirror_load() { - const code_div = document.getElementById('codemirror'); + code_div = document.getElementById('codemirror'); code_mirror = CodeMirror(code_div, { lineNumbers: true @@ -11,6 +12,19 @@ function codemirror_load() socket.emit("get_current_profile", (data) => { code_mirror.setValue(data) }); + + code_div.addEventListener("mouseleave", disable_input); + code_div.addEventListener("mouseenter", enable_input); +} + +function disable_input() +{ + code_mirror.setOption("readOnly", "nocursor"); +} + +function enable_input() +{ + code_mirror.setOption("readOnly", false); } window.addEventListener("load", codemirror_load); \ No newline at end of file diff --git a/webui/ipkvm/static/js/table.js b/webui/ipkvm/static/js/table.js index 1f7266e..59c8425 100644 --- a/webui/ipkvm/static/js/table.js +++ b/webui/ipkvm/static/js/table.js @@ -12,9 +12,9 @@ function create_table(data) { container.innerText = "" Object.keys(data).forEach((key, index) => { - row_headers.push(key) + col_headers.push(key) Object.keys(data[key]).forEach((value, subIndex) => { - col_headers.push(value) + row_headers.push(value) }); }); @@ -34,7 +34,7 @@ function update_core_info_table(data) { hot.batch(() => { Object.keys(data).forEach((key, index) => { Object.keys(data[key]).forEach((value, subIndex) => { - hot.setDataAtCell(index, subIndex, data[key][value]) + hot.setDataAtCell(subIndex, index, data[key][value]) }); }); }); diff --git a/webui/ipkvm/templates/index.html b/webui/ipkvm/templates/index.html index e3f22b1..0af0a89 100644 --- a/webui/ipkvm/templates/index.html +++ b/webui/ipkvm/templates/index.html @@ -2,9 +2,9 @@ - + - + @@ -46,7 +46,7 @@
-
Waiting for data...
+
@@ -56,12 +56,13 @@ - +
-
+
Waiting for data...
+
diff --git a/webui/ipkvm/util/__init__.py b/webui/ipkvm/util/__init__.py index 6d0bbee..a2df533 100644 --- a/webui/ipkvm/util/__init__.py +++ b/webui/ipkvm/util/__init__.py @@ -1,3 +1,5 @@ from . import hwinfo from .mkb import events from .profiles import events + +__all__ = ["hwinfo", "events"] diff --git a/webui/ipkvm/util/graphs/__init__.py b/webui/ipkvm/util/graphs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/webui/ipkvm/util/graphs/graphs.py b/webui/ipkvm/util/graphs/graphs.py deleted file mode 100644 index e106e6d..0000000 --- a/webui/ipkvm/util/graphs/graphs.py +++ /dev/null @@ -1,70 +0,0 @@ -import networkx as nx -from networkx import Graph -from typing import Any -from ipkvm.util import esp32_serial -from ipkvm.util.mkb import ASCII2JS -import time - -# Type checker lunacy! -type MultiDiGraph = Graph[Any] - -key_delay = 0.1 - -def traverse_path(graph: MultiDiGraph, node_a: str, node_b: str): - path = nx.shortest_path(graph, node_a, node_b) - path_edges = list(zip(path[:-1], path[1:])) - edge_path= [(u, v, graph[u][v]) for u, v in path_edges] - - for step in edge_path: - if "initial_keypath" in step[2][0] and step[2][0]["visited"] == "false": - keys = step[2][0]["initial_keypath"].split(',') - # Type checker is simply wrong! This is the correct usage! - graph.edges[step[0], step[1], 0]["visited"] = "true" # type: ignore - - else: - keys = step[2][0]["keypath"].split(',') - - for key in keys: - time.sleep(key_delay) - esp32_serial.ez_press_key(key) - -def apply_setting(graph: MultiDiGraph, setting_node: str, new_value: str): - if graph.nodes[setting_node]["option_type"] == "list": - possible_values = graph.nodes[setting_node]["options"].split(',') - key = graph.nodes[setting_node]["traversal_key"] - - time.sleep(key_delay) - esp32_serial.ez_press_key("Enter") - - for value in possible_values: - time.sleep(key_delay) - if value == new_value: - esp32_serial.ez_press_key("Enter") - break - - else: - esp32_serial.ez_press_key(key) - - elif graph.nodes[setting_node]["option_type"] == "field": - for key in new_value: - time.sleep(key_delay) - esp32_serial.ez_press_key(ASCII2JS[key]) - time.sleep(key_delay) - esp32_serial.ez_press_key("Enter") - - print(f"Changed {setting_node} from {graph.nodes[setting_node]["value"]} to {new_value}!") - graph.nodes[setting_node]["value"] = new_value - - - -def test_route(settings: dict[Any, Any]): - graph: MultiDiGraph = nx.nx_agraph.read_dot("bios-maps/asrock/b650e-riptide-wifi.gv") - - current_node = "Main" - - for category in settings: - for setting_node in settings[category]: - if graph.nodes[setting_node]["value"] != settings[category][setting_node]: - traverse_path(graph, current_node, setting_node) - current_node = setting_node - apply_setting(graph, setting_node, settings[category][setting_node]) diff --git a/webui/ipkvm/util/hwinfo/hwinfo.py b/webui/ipkvm/util/hwinfo/hwinfo.py index 6eea2da..48199bb 100644 --- a/webui/ipkvm/util/hwinfo/hwinfo.py +++ b/webui/ipkvm/util/hwinfo/hwinfo.py @@ -51,7 +51,7 @@ class HWInfoMonitor(threading.Thread): temp_list.append(round(reading["value"], 2)) elif match.group("core_vid"): - vid_list.append(reading["value"]) + vid_list.append(round(reading["value"], 3)) elif match.group("core_mhz"): mhz_list.append(round(reading["value"], 2)) @@ -70,7 +70,8 @@ class HWInfoMonitor(threading.Thread): ui.emit("update_core_info_table", core_dataframe.to_dict("index")) except Exception as e: - print(e) + #print(e) + pass def is_hwinfo_alive(self): request = requests.get(self.request_url, timeout=1) diff --git a/webui/ipkvm/util/mkb/mkb.py b/webui/ipkvm/util/mkb/mkb.py index fae3890..a851bdf 100644 --- a/webui/ipkvm/util/mkb/mkb.py +++ b/webui/ipkvm/util/mkb/mkb.py @@ -1,15 +1,17 @@ from enum import IntEnum from os import name, listdir import serial -from ipkvm.app import logger, ui +from ipkvm.app import logger from ipkvm.util.profiles import profile_manager import threading from queue import Queue import json +import networkx as nx import time from collections.abc import Mapping -from .post_codes import POSTTextDef, POSTHex7Segment -from .scancodes import HIDKeyCode +# from .post_codes import POSTTextDef, POSTHex7Segment +from .scancodes import ASCII2JS, HIDKeyCode +from ipkvm.util.types import MultiDiGraph, OverclockingDict class GPIO(IntEnum): LOW = 0 @@ -18,13 +20,17 @@ class GPIO(IntEnum): class Esp32Serial(threading.Thread): def __init__(self): super().__init__() - self.post_code_queue: Queue[str] = Queue() + # self.post_code_queue: Queue[str] = Queue() self.mkb_queue: Queue[Mapping[str, int | str | Mapping[str, int]]] = Queue() - self._power_status = False - self._last_post_code = "00" - self.notify_code: str - self.active_notification_request = threading.Event() - self.post_code_notify = threading.Event() + # self._power_status = False + self._usb_status = False + self._last_usb_status = False + # self._last_post_code = "00" + # self.notify_code: str + # self.active_notification_request = threading.Event() + # self.post_code_notify = threading.Event() + + self._key_delay = 0.2 self.start() @@ -48,19 +54,29 @@ class Esp32Serial(threading.Thread): try: line = json.loads(ser.readline().decode().strip()) - if "pwr" in line: - self._power_status = line["pwr"] + # self._power_status = line["pwr"] + self._usb_status = line["usb"] - elif "post_code" in line: - self._last_post_code = POSTHex7Segment[line["post_code"]] + if self._usb_status != self._last_usb_status: + if self._usb_status: + logger.info("Client machine cleared POST.") + else: + logger.info("Client machine powered off.") - ui.emit("update_seven_segment", POSTHex7Segment[line["post_code"]]) - ui.emit("update_post_log", f"{POSTTextDef[line["post_code"]]}: {POSTHex7Segment[line["post_code"]]}") + self._last_usb_status = self._usb_status - if self.active_notification_request.is_set(): - if self._last_post_code == self.notify_code: - self.post_code_notify.set() - self.active_notification_request.clear() + # elif "post_code" in line: + # self._last_post_code = POSTHex7Segment[line["post_code"]] +# + # ui.emit("update_seven_segment", POSTHex7Segment[line["post_code"]]) + # ui.emit("update_post_log", f"{POSTTextDef[line["post_code"]]}: {POSTHex7Segment[line["post_code"]]}") +# + # if self.active_notification_request.is_set(): + # if self._last_post_code == self.notify_code: + # self.post_code_notify.set() + # self.active_notification_request.clear() +# + # print(f"{POSTTextDef[line["post_code"]]}: {POSTHex7Segment[line["post_code"]]}") except json.JSONDecodeError: continue @@ -77,7 +93,7 @@ class Esp32Serial(threading.Thread): bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE) else: - raise RuntimeError("Your OS is unsupported!") + raise RuntimeError("Your OS is unsupported at this time!") def ez_press_key(self, key: str): msg = msg = { @@ -100,11 +116,72 @@ class Esp32Serial(threading.Thread): serial_devices = [] return serial_devices + + def _traverse_path(self, graph: MultiDiGraph, node_a: str, node_b: str): + path = nx.shortest_path(graph, node_a, node_b) + path_edges = list(zip(path[:-1], path[1:])) + edge_path= [(u, v, graph[u][v]) for u, v in path_edges] - @property - def power_status(self): - return self._power_status + for step in edge_path: + if "initial_keypath" in step[2][0] and step[2][0]["visited"] == "false": + keys = step[2][0]["initial_keypath"].split(',') + # Type checker is simply wrong! This is the correct usage! + graph.edges[step[0], step[1], 0]["visited"] = "true" # type: ignore + + else: + keys = step[2][0]["keypath"].split(',') + + for key in keys: + time.sleep(self._key_delay) + self.ez_press_key(key) + + def _apply_setting(self, graph: MultiDiGraph, setting_node: str, new_value: str): + if graph.nodes[setting_node]["option_type"] == "list": + possible_values = graph.nodes[setting_node]["options"].split(',') + key = graph.nodes[setting_node]["traversal_key"] + + time.sleep(self._key_delay) + self.ez_press_key("Enter") + + for value in possible_values: + time.sleep(self._key_delay) + if value == new_value: + self.ez_press_key("Enter") + break + + else: + self.ez_press_key(key) + + elif graph.nodes[setting_node]["option_type"] == "field": + for key in new_value: + time.sleep(self._key_delay) + self.ez_press_key(ASCII2JS[key]) + time.sleep(self._key_delay) + self.ez_press_key("Enter") + + logger.info(f"Changed {setting_node} from {graph.nodes[setting_node]["value"]} to {new_value}!") + graph.nodes[setting_node]["value"] = new_value + + + + def apply_all_settings(self, settings: OverclockingDict, graph: MultiDiGraph, current_node: str): + for category in settings: + for setting_node in settings[category]: + if graph.nodes[setting_node]["value"] != settings[category][setting_node]: + self._traverse_path(graph, current_node, setting_node) + current_node = setting_node + self._apply_setting(graph, setting_node, settings[category][setting_node]) + + return current_node + + # @property + # def power_status(self): + # return self._power_status @property - def last_post_code(self): - return self._last_post_code + def usb_status(self): + return self._usb_status + + # @property + # def last_post_code(self): + # return self._last_post_code diff --git a/webui/ipkvm/util/mkb/post_codes.py b/webui/ipkvm/util/mkb/post_codes.py index 90e171c..2350f4d 100644 --- a/webui/ipkvm/util/mkb/post_codes.py +++ b/webui/ipkvm/util/mkb/post_codes.py @@ -1,532 +1,533 @@ -PoweredUpCodeDef = { - 1: "System is entering S1 sleep state", - 2: "System is entering S2 sleep state", - 3: "System is entering S3 sleep state", - 4: "System is entering S4 sleep state", - 5: "System is entering S5 sleep state", - 16: "System is waking up from the S1 sleep state", - 32: "System is waking up from the S2 sleep state", - 48: "System is waking up from the S3 sleep state", - 64: "System is waking up from the S4 sleep state", - 170: "System has transitioned into ACPI mode. Interrupt controller is in APIC mode", - 172: "System has transitioned into ACPI mode. Interrupt controller is in APIC mode", - 255: "Indicates a failure has occurred" -} - -POSTTextDef = { - 0: "Not used", - 1: "Power on. Reset type detection (soft/hard)", - 2: "AP initialization before microcode loading", - 3: "System Agent initialization before microcode loading", - 4: "PCH initialization before microcode loading", - 5: "OEM initialization before microcode loading", - 6: "Microcode loading", - 7: "AP initialization after microcode loading", - 8: "System Agent initialization after microcode loading", - 9: "PCH initialization after microcode loading", - 10: "OEM initialization after microcode loading", - 11: "Cache initialization", - 12: "Reserved for future AMI SEC error codes", - 13: "Reserved for future AMI SEC error codes", - 14: "Microcode not found", - 15: "Microcode not loaded", - 16: "PEI Core is started", - 17: "Pre-memory CPU initialization is started", - 18: "Pre-memory CPU initialization (CPU module specific)", - 19: "Pre-memory CPU initialization (CPU module specific)", - 20: "Pre-memory CPU initialization (CPU module specific)", - 21: "Pre-memory System Agent initialization is started", - 22: "Pre-Memory System Agent initialization (System Agent module specific)", - 23: "Pre-Memory System Agent initialization (System Agent module specific)", - 24: "Pre-Memory System Agent initialization (System Agent module specific)", - 25: "Pre-memory PCH initialization is started", - 26: "Pre-memory PCH initialization (PCH module specific)", - 27: "Pre-memory PCH initialization (PCH module specific)", - 28: "Pre-memory PCH initialization (PCH module specific)", - 29: "OEM pre-memory initialization codes", - 30: "OEM pre-memory initialization codes", - 31: "OEM pre-memory initialization codes", - 32: "OEM pre-memory initialization codes", - 33: "OEM pre-memory initialization codes", - 34: "OEM pre-memory initialization codes", - 35: "OEM pre-memory initialization codes", - 36: "OEM pre-memory initialization codes", - 37: "OEM pre-memory initialization codes", - 38: "OEM pre-memory initialization codes", - 39: "OEM pre-memory initialization codes", - 40: "OEM pre-memory initialization codes", - 41: "OEM pre-memory initialization codes", - 42: "OEM pre-memory initialization codes", - 43: "Memory initialization. Serial Presence Detect (SPD) data reading", - 44: "Memory initialization. Memory presence detection", - 45: "Memory initialization. Programming memory timing information", - 46: "Memory initialization. Confi guring memory", - 47: "Memory initialization (other)", - 48: "Reserved for ASL", - 49: "Memory Installed", - 50: "CPU post-memory initialization is started", - 51: "CPU post-memory initialization. Cache initialization", - 52: "CPU post-memory initialization. Application Processor(s) (AP) initialization", - 53: "CPU post-memory initialization. Boot Strap Processor (BSP) selection", - 54: "CPU post-memory initialization. System Management Mode (SMM) initialization", - 55: "Post-Memory System Agent initialization is started", - 56: "Post-Memory System Agent initialization (System Agent module specific)", - 57: "Post-Memory System Agent initialization (System Agent module specific)", - 58: "Post-Memory System Agent initialization (System Agent module specific)", - 59: "Post-Memory PCH initialization is started", - 60: "Post-Memory PCH initialization (PCH module specific)", - 61: "Post-Memory PCH initialization (PCH module specific)", - 62: "Post-Memory PCH initialization (PCH module specific)", - 63: "OEM post memory initialization codes", - 64: "OEM post memory initialization codes", - 65: "OEM post memory initialization codes", - 66: "OEM post memory initialization codes", - 67: "OEM post memory initialization codes", - 68: "OEM post memory initialization codes", - 69: "OEM post memory initialization codes", - 70: "OEM post memory initialization codes", - 71: "OEM post memory initialization codes", - 72: "OEM post memory initialization codes", - 73: "OEM post memory initialization codes", - 74: "OEM post memory initialization codes", - 75: "OEM post memory initialization codes", - 76: "OEM post memory initialization codes", - 77: "OEM post memory initialization codes", - 78: "OEM post memory initialization codes", - 79: "DXE IPL is started", - 80: "Memory initialization error. Invalid memory type or incompatible memory speed", - 81: "Memory initialization error. SPD reading has failed", - 82: "Memory initialization error. Invalid memory size or memory modules do not match", - 83: "Memory initialization error. No usable memory detected", - 84: "Unspecified memory initialization error", - 85: "Memory not installed", - 86: "Invalid CPU type or Speed", - 87: "CPU mismatch", - 88: "CPU self test failed or possible CPU cache error", - 89: "CPU micro-code is not found or micro-code update is failed", - 90: "Internal CPU error", - 91: "reset PPI is not available", - 92: "Reserved for future AMI error codes", - 93: "Reserved for future AMI error codes", - 94: "Reserved for future AMI error codes", - 95: "Reserved for future AMI error codes", - 96: "DXE Core is started", - 97: "NVRAM initialization", - 98: "Installation of the PCH Runtime Services", - 99: "CPU DXE initialization is started", - 100: "CPU DXE initialization (CPU module specific)", - 101: "CPU DXE initialization (CPU module specific)", - 102: "CPU DXE initialization (CPU module specific)", - 103: "CPU DXE initialization (CPU module specific)", - 104: "PCI host bridge initialization", - 105: "System Agent DXE initialization is started", - 106: "System Agent DXE SMM initialization is started", - 107: "System Agent DXE initialization (System Agent module specific)", - 108: "System Agent DXE initialization (System Agent module specific)", - 109: "System Agent DXE initialization (System Agent module specific)", - 110: "System Agent DXE initialization (System Agent module specific)", - 111: "System Agent DXE initialization (System Agent module specific)", - 112: "PCH DXE initialization is started", - 113: "PCH DXE SMM initialization is started", - 114: "PCH devices initialization", - 115: "PCH DXE Initialization (PCH module specific)", - 116: "PCH DXE Initialization (PCH module specific)", - 117: "PCH DXE Initialization (PCH module specific)", - 118: "PCH DXE Initialization (PCH module specific)", - 119: "PCH DXE Initialization (PCH module specific)", - 120: "ACPI module initialization", - 121: "CSM initialization", - 122: "Reserved for future AMI DXE codes", - 123: "Reserved for future AMI DXE codes", - 124: "Reserved for future AMI DXE codes", - 125: "Reserved for future AMI DXE codes", - 126: "Reserved for future AMI DXE codes", - 127: "Reserved for future AMI DXE codes", - 128: "OEM DXE initialization codes", - 129: "OEM DXE initialization codes", - 130: "OEM DXE initialization codes", - 131: "OEM DXE initialization codes", - 132: "OEM DXE initialization codes", - 133: "OEM DXE initialization codes", - 134: "OEM DXE initialization codes", - 135: "OEM DXE initialization codes", - 136: "OEM DXE initialization codes", - 137: "OEM DXE initialization codes", - 138: "OEM DXE initialization codes", - 139: "OEM DXE initialization codes", - 140: "OEM DXE initialization codes", - 141: "OEM DXE initialization codes", - 142: "OEM DXE initialization codes", - 143: "OEM DXE initialization codes", - 144: "Boot Device Selection (BDS) phase is started", - 145: "Driver connecting is started", - 146: "PCI Bus initialization is started", - 147: "PCI Bus Hot Plug Controller Initialization", - 148: "PCI Bus Enumeration 32", - 149: "PCI Bus Request Resources", - 150: "PCI Bus Assign Resources", - 151: "Console Output devices connect", - 152: "Console input devices connect", - 153: "Super IO Initialization", - 154: "USB initialization is started", - 155: "USB Reset", - 156: "USB Detect", - 157: "USB Enable", - 158: "Reserved for future AMI codes", - 159: "Reserved for future AMI codes", - 160: "IDE initialization is started", - 161: "IDE Reset", - 162: "IDE Detect", - 163: "IDE Enable", - 164: "SCSI initialization is started", - 165: "SCSI Reset", - 166: "SCSI Detect", - 167: "SCSI Enable", - 168: "Setup Verifying Password", - 169: "Start of Setup", - 170: "Reserved for ASL", - 171: "Setup Input Wait", - 172: "Reserved for ASL", - 173: "Ready To Boot event", - 174: "Legacy Boot event", - 175: "Exit Boot Services event", - 176: "Runtime Set Virtual Address MAP Begin", - 177: "Runtime Set Virtual Address MAP End", - 178: "Legacy Option ROM Initialization", - 179: "System Reset", - 180: "USB hot plug", - 181: "PCI bus hot plug", - 182: "Clean-up of NVRAM", - 183: "Confi guration Reset (reset of NVRAM settings)", - 184: "Reserved for future AMI codes", - 185: "Reserved for future AMI codes", - 186: "Reserved for future AMI codes", - 187: "Reserved for future AMI codes", - 188: "Reserved for future AMI codes", - 189: "Reserved for future AMI codes", - 190: "Reserved for future AMI codes", - 191: "Reserved for future AMI codes", - 192: "OEM BDS initialization codes", - 193: "OEM BDS initialization codes", - 194: "OEM BDS initialization codes", - 195: "OEM BDS initialization codes", - 196: "OEM BDS initialization codes", - 197: "OEM BDS initialization codes", - 198: "OEM BDS initialization codes", - 199: "OEM BDS initialization codes", - 200: "OEM BDS initialization codes", - 201: "OEM BDS initialization codes", - 202: "OEM BDS initialization codes", - 203: "OEM BDS initialization codes", - 204: "OEM BDS initialization codes", - 205: "OEM BDS initialization codes", - 206: "OEM BDS initialization codes", - 207: "OEM BDS initialization codes", - 208: "CPU initialization error", - 209: "System Agent initialization error", - 210: "PCH initialization error", - 211: "Some of the Architectural Protocols are not available", - 212: "PCI resource allocation error. Out of Resources", - 213: "No Space for Legacy Option ROM", - 214: "No Console Output Devices are found", - 215: "No Console Input Devices are found", - 216: "Invalid password", - 217: "Error loading Boot Option (LoadImage returned error)", - 218: "Boot Option is failed (StartImage returned error)", - 219: "Flash update is failed", - 220: "Reset protocol is not available", - 221: "Reserved for future AMI progress codes", - 222: "Reserved for future AMI progress codes", - 223: "Reserved for future AMI progress codes", - 224: "S3 Resume is stared (S3 Resume PPI is called by the DXE IPL)", - 225: "S3 Boot Script execution", - 226: "Video repost", - 227: "OS S3 wake vector call", - 228: "Reserved for future AMI progress codes", - 229: "Reserved for future AMI progress codes", - 230: "Reserved for future AMI progress codes", - 231: "Reserved for future AMI progress codes", - 232: "S3 Resume Failed", - 233: "S3 Resume PPI not Found", - 234: "S3 Resume Boot Script Error", - 235: "S3 OS Wake Error", - 236: "Reserved for future AMI error codes 31", - 237: "Reserved for future AMI error codes 31", - 238: "Reserved for future AMI error codes 31", - 239: "Reserved for future AMI error codes 31", - 240: "Recovery condition triggered by firmware (Auto recovery)", - 241: "Recovery condition triggered by user (Forced recovery)", - 242: "Recovery process started", - 243: "Recovery firmware image is found", - 244: "Recovery firmware image is loaded", - 245: "Reserved for future AMI progress codes", - 246: "Reserved for future AMI progress codes", - 247: "Reserved for future AMI progress codes", - 248: "Recovery PPI is not available", - 249: "Recovery capsule is not found", - 250: "Invalid recovery capsule", - 251: "Reserved for future AMI error codes", - 252: "Reserved for future AMI error codes", - 253: "Reserved for future AMI error codes", - 254: "Reserved for future AMI error codes", - 255: "Indicates a failure has occurred" -} - -POSTHex7Segment = { - 0: "00", - 1: "01", - 2: "02", - 3: "03", - 4: "04", - 5: "05", - 6: "06", - 7: "07", - 8: "08", - 9: "09", - 10: "0A", - 11: "0b", - 12: "0C", - 13: "0d", - 14: "0E", - 15: "0F", - 16: "10", - 17: "11", - 18: "12", - 19: "13", - 20: "14", - 21: "15", - 22: "16", - 23: "17", - 24: "18", - 25: "19", - 26: "1A", - 27: "1b", - 28: "1C", - 29: "1d", - 30: "1E", - 31: "1F", - 32: "20", - 33: "21", - 34: "22", - 35: "23", - 36: "24", - 37: "25", - 38: "26", - 39: "27", - 40: "28", - 41: "29", - 42: "2A", - 43: "2b", - 44: "2C", - 45: "2d", - 46: "2E", - 47: "2F", - 48: "30", - 49: "31", - 50: "32", - 51: "33", - 52: "34", - 53: "35", - 54: "36", - 55: "37", - 56: "38", - 57: "39", - 58: "3A", - 59: "3b", - 60: "3C", - 61: "3d", - 62: "3E", - 63: "3F", - 64: "40", - 65: "41", - 66: "42", - 67: "43", - 68: "44", - 69: "45", - 70: "46", - 71: "47", - 72: "48", - 73: "49", - 74: "4A", - 75: "4b", - 76: "4C", - 77: "4d", - 78: "4E", - 79: "4F", - 80: "50", - 81: "51", - 82: "52", - 83: "53", - 84: "54", - 85: "55", - 86: "56", - 87: "57", - 88: "58", - 89: "59", - 90: "5A", - 91: "5b", - 92: "5C", - 93: "5d", - 94: "5E", - 95: "5F", - 96: "60", - 97: "61", - 98: "62", - 99: "63", - 100: "64", - 101: "65", - 102: "66", - 103: "67", - 104: "68", - 105: "69", - 106: "6A", - 107: "6b", - 108: "6C", - 109: "6d", - 110: "6E", - 111: "6F", - 112: "70", - 113: "71", - 114: "72", - 115: "73", - 116: "74", - 117: "75", - 118: "76", - 119: "77", - 120: "78", - 121: "79", - 122: "7A", - 123: "7b", - 124: "7C", - 125: "7d", - 126: "7E", - 127: "7F", - 128: "80", - 129: "81", - 130: "82", - 131: "83", - 132: "84", - 133: "85", - 134: "86", - 135: "87", - 136: "88", - 137: "89", - 138: "8A", - 139: "8b", - 140: "8C", - 141: "8d", - 142: "8E", - 143: "8F", - 144: "90", - 145: "91", - 146: "92", - 147: "93", - 148: "94", - 149: "95", - 150: "96", - 151: "97", - 152: "98", - 153: "99", - 154: "9A", - 155: "9b", - 156: "9C", - 157: "9d", - 158: "9E", - 159: "9F", - 160: "A0", - 161: "A1", - 162: "A2", - 163: "A3", - 164: "A4", - 165: "A5", - 166: "A6", - 167: "A7", - 168: "A8", - 169: "A9", - 170: "AA", - 171: "Ab", - 172: "AC", - 173: "Ad", - 174: "AE", - 175: "AF", - 176: "b0", - 177: "b1", - 178: "b2", - 179: "b3", - 180: "b4", - 181: "b5", - 182: "b6", - 183: "b7", - 184: "b8", - 185: "b9", - 186: "bA", - 187: "bb", - 188: "bC", - 189: "bd", - 190: "bE", - 191: "bF", - 192: "C0", - 193: "C1", - 194: "C2", - 195: "C3", - 196: "C4", - 197: "C5", - 198: "C6", - 199: "C7", - 200: "C8", - 201: "C9", - 202: "CA", - 203: "Cb", - 204: "CC", - 205: "Cd", - 206: "CE", - 207: "CF", - 208: "d0", - 209: "d1", - 210: "d2", - 211: "d3", - 212: "d4", - 213: "d5", - 214: "d6", - 215: "d7", - 216: "d8", - 217: "d9", - 218: "dA", - 219: "db", - 220: "dC", - 221: "dd", - 222: "dE", - 223: "dF", - 224: "E0", - 225: "E1", - 226: "E2", - 227: "E3", - 228: "E4", - 229: "E5", - 230: "E6", - 231: "E7", - 232: "E8", - 233: "E9", - 234: "EA", - 235: "Eb", - 236: "EC", - 237: "Ed", - 238: "EE", - 239: "EF", - 240: "F0", - 241: "F1", - 242: "F2", - 243: "F3", - 244: "F4", - 245: "F5", - 246: "F6", - 247: "F7", - 248: "F8", - 249: "F9", - 250: "FA", - 251: "Fb", - 252: "FC", - 253: "Fd", - 254: "FE", - 255: "FF" -} +# PoweredUpCodeDef = { +# 1: "System is entering S1 sleep state", +# 2: "System is entering S2 sleep state", +# 3: "System is entering S3 sleep state", +# 4: "System is entering S4 sleep state", +# 5: "System is entering S5 sleep state", +# 16: "System is waking up from the S1 sleep state", +# 32: "System is waking up from the S2 sleep state", +# 48: "System is waking up from the S3 sleep state", +# 64: "System is waking up from the S4 sleep state", +# 170: "System has transitioned into ACPI mode. Interrupt controller is in APIC mode", +# 172: "System has transitioned into ACPI mode. Interrupt controller is in APIC mode", +# 255: "Indicates a failure has occurred" +# } +# +# POSTTextDef = { +# 0: "Not used", +# 1: "Power on. Reset type detection (soft/hard)", +# 2: "AP initialization before microcode loading", +# 3: "System Agent initialization before microcode loading", +# 4: "PCH initialization before microcode loading", +# 5: "OEM initialization before microcode loading", +# 6: "Microcode loading", +# 7: "AP initialization after microcode loading", +# 8: "System Agent initialization after microcode loading", +# 9: "PCH initialization after microcode loading", +# 10: "OEM initialization after microcode loading", +# 11: "Cache initialization", +# 12: "Reserved for future AMI SEC error codes", +# 13: "Reserved for future AMI SEC error codes", +# 14: "Microcode not found", +# 15: "Microcode not loaded", +# 16: "PEI Core is started", +# 17: "Pre-memory CPU initialization is started", +# 18: "Pre-memory CPU initialization (CPU module specific)", +# 19: "Pre-memory CPU initialization (CPU module specific)", +# 20: "Pre-memory CPU initialization (CPU module specific)", +# 21: "Pre-memory System Agent initialization is started", +# 22: "Pre-Memory System Agent initialization (System Agent module specific)", +# 23: "Pre-Memory System Agent initialization (System Agent module specific)", +# 24: "Pre-Memory System Agent initialization (System Agent module specific)", +# 25: "Pre-memory PCH initialization is started", +# 26: "Pre-memory PCH initialization (PCH module specific)", +# 27: "Pre-memory PCH initialization (PCH module specific)", +# 28: "Pre-memory PCH initialization (PCH module specific)", +# 29: "OEM pre-memory initialization codes", +# 30: "OEM pre-memory initialization codes", +# 31: "OEM pre-memory initialization codes", +# 32: "OEM pre-memory initialization codes", +# 33: "OEM pre-memory initialization codes", +# 34: "OEM pre-memory initialization codes", +# 35: "OEM pre-memory initialization codes", +# 36: "OEM pre-memory initialization codes", +# 37: "OEM pre-memory initialization codes", +# 38: "OEM pre-memory initialization codes", +# 39: "OEM pre-memory initialization codes", +# 40: "OEM pre-memory initialization codes", +# 41: "OEM pre-memory initialization codes", +# 42: "OEM pre-memory initialization codes", +# 43: "Memory initialization. Serial Presence Detect (SPD) data reading", +# 44: "Memory initialization. Memory presence detection", +# 45: "Memory initialization. Programming memory timing information", +# 46: "Memory initialization. Confi guring memory", +# 47: "Memory initialization (other)", +# 48: "Reserved for ASL", +# 49: "Memory Installed", +# 50: "CPU post-memory initialization is started", +# 51: "CPU post-memory initialization. Cache initialization", +# 52: "CPU post-memory initialization. Application Processor(s) (AP) initialization", +# 53: "CPU post-memory initialization. Boot Strap Processor (BSP) selection", +# 54: "CPU post-memory initialization. System Management Mode (SMM) initialization", +# 55: "Post-Memory System Agent initialization is started", +# 56: "Post-Memory System Agent initialization (System Agent module specific)", +# 57: "Post-Memory System Agent initialization (System Agent module specific)", +# 58: "Post-Memory System Agent initialization (System Agent module specific)", +# 59: "Post-Memory PCH initialization is started", +# 60: "Post-Memory PCH initialization (PCH module specific)", +# 61: "Post-Memory PCH initialization (PCH module specific)", +# 62: "Post-Memory PCH initialization (PCH module specific)", +# 63: "OEM post memory initialization codes", +# 64: "OEM post memory initialization codes", +# 65: "OEM post memory initialization codes", +# 66: "OEM post memory initialization codes", +# 67: "OEM post memory initialization codes", +# 68: "OEM post memory initialization codes", +# 69: "OEM post memory initialization codes", +# 70: "OEM post memory initialization codes", +# 71: "OEM post memory initialization codes", +# 72: "OEM post memory initialization codes", +# 73: "OEM post memory initialization codes", +# 74: "OEM post memory initialization codes", +# 75: "OEM post memory initialization codes", +# 76: "OEM post memory initialization codes", +# 77: "OEM post memory initialization codes", +# 78: "OEM post memory initialization codes", +# 79: "DXE IPL is started", +# 80: "Memory initialization error. Invalid memory type or incompatible memory speed", +# 81: "Memory initialization error. SPD reading has failed", +# 82: "Memory initialization error. Invalid memory size or memory modules do not match", +# 83: "Memory initialization error. No usable memory detected", +# 84: "Unspecified memory initialization error", +# 85: "Memory not installed", +# 86: "Invalid CPU type or Speed", +# 87: "CPU mismatch", +# 88: "CPU self test failed or possible CPU cache error", +# 89: "CPU micro-code is not found or micro-code update is failed", +# 90: "Internal CPU error", +# 91: "reset PPI is not available", +# 92: "Reserved for future AMI error codes", +# 93: "Reserved for future AMI error codes", +# 94: "Reserved for future AMI error codes", +# 95: "Reserved for future AMI error codes", +# 96: "DXE Core is started", +# 97: "NVRAM initialization", +# 98: "Installation of the PCH Runtime Services", +# 99: "CPU DXE initialization is started", +# 100: "CPU DXE initialization (CPU module specific)", +# 101: "CPU DXE initialization (CPU module specific)", +# 102: "CPU DXE initialization (CPU module specific)", +# 103: "CPU DXE initialization (CPU module specific)", +# 104: "PCI host bridge initialization", +# 105: "System Agent DXE initialization is started", +# 106: "System Agent DXE SMM initialization is started", +# 107: "System Agent DXE initialization (System Agent module specific)", +# 108: "System Agent DXE initialization (System Agent module specific)", +# 109: "System Agent DXE initialization (System Agent module specific)", +# 110: "System Agent DXE initialization (System Agent module specific)", +# 111: "System Agent DXE initialization (System Agent module specific)", +# 112: "PCH DXE initialization is started", +# 113: "PCH DXE SMM initialization is started", +# 114: "PCH devices initialization", +# 115: "PCH DXE Initialization (PCH module specific)", +# 116: "PCH DXE Initialization (PCH module specific)", +# 117: "PCH DXE Initialization (PCH module specific)", +# 118: "PCH DXE Initialization (PCH module specific)", +# 119: "PCH DXE Initialization (PCH module specific)", +# 120: "ACPI module initialization", +# 121: "CSM initialization", +# 122: "Reserved for future AMI DXE codes", +# 123: "Reserved for future AMI DXE codes", +# 124: "Reserved for future AMI DXE codes", +# 125: "Reserved for future AMI DXE codes", +# 126: "Reserved for future AMI DXE codes", +# 127: "Reserved for future AMI DXE codes", +# 128: "OEM DXE initialization codes", +# 129: "OEM DXE initialization codes", +# 130: "OEM DXE initialization codes", +# 131: "OEM DXE initialization codes", +# 132: "OEM DXE initialization codes", +# 133: "OEM DXE initialization codes", +# 134: "OEM DXE initialization codes", +# 135: "OEM DXE initialization codes", +# 136: "OEM DXE initialization codes", +# 137: "OEM DXE initialization codes", +# 138: "OEM DXE initialization codes", +# 139: "OEM DXE initialization codes", +# 140: "OEM DXE initialization codes", +# 141: "OEM DXE initialization codes", +# 142: "OEM DXE initialization codes", +# 143: "OEM DXE initialization codes", +# 144: "Boot Device Selection (BDS) phase is started", +# 145: "Driver connecting is started", +# 146: "PCI Bus initialization is started", +# 147: "PCI Bus Hot Plug Controller Initialization", +# 148: "PCI Bus Enumeration 32", +# 149: "PCI Bus Request Resources", +# 150: "PCI Bus Assign Resources", +# 151: "Console Output devices connect", +# 152: "Console input devices connect", +# 153: "Super IO Initialization", +# 154: "USB initialization is started", +# 155: "USB Reset", +# 156: "USB Detect", +# 157: "USB Enable", +# 158: "Reserved for future AMI codes", +# 159: "Reserved for future AMI codes", +# 160: "IDE initialization is started", +# 161: "IDE Reset", +# 162: "IDE Detect", +# 163: "IDE Enable", +# 164: "SCSI initialization is started", +# 165: "SCSI Reset", +# 166: "SCSI Detect", +# 167: "SCSI Enable", +# 168: "Setup Verifying Password", +# 169: "Start of Setup", +# 170: "Reserved for ASL", +# 171: "Setup Input Wait", +# 172: "Reserved for ASL", +# 173: "Ready To Boot event", +# 174: "Legacy Boot event", +# 175: "Exit Boot Services event", +# 176: "Runtime Set Virtual Address MAP Begin", +# 177: "Runtime Set Virtual Address MAP End", +# 178: "Legacy Option ROM Initialization", +# 179: "System Reset", +# 180: "USB hot plug", +# 181: "PCI bus hot plug", +# 182: "Clean-up of NVRAM", +# 183: "Confi guration Reset (reset of NVRAM settings)", +# 184: "Reserved for future AMI codes", +# 185: "Reserved for future AMI codes", +# 186: "Reserved for future AMI codes", +# 187: "Reserved for future AMI codes", +# 188: "Reserved for future AMI codes", +# 189: "Reserved for future AMI codes", +# 190: "Reserved for future AMI codes", +# 191: "Reserved for future AMI codes", +# 192: "OEM BDS initialization codes", +# 193: "OEM BDS initialization codes", +# 194: "OEM BDS initialization codes", +# 195: "OEM BDS initialization codes", +# 196: "OEM BDS initialization codes", +# 197: "OEM BDS initialization codes", +# 198: "OEM BDS initialization codes", +# 199: "OEM BDS initialization codes", +# 200: "OEM BDS initialization codes", +# 201: "OEM BDS initialization codes", +# 202: "OEM BDS initialization codes", +# 203: "OEM BDS initialization codes", +# 204: "OEM BDS initialization codes", +# 205: "OEM BDS initialization codes", +# 206: "OEM BDS initialization codes", +# 207: "OEM BDS initialization codes", +# 208: "CPU initialization error", +# 209: "System Agent initialization error", +# 210: "PCH initialization error", +# 211: "Some of the Architectural Protocols are not available", +# 212: "PCI resource allocation error. Out of Resources", +# 213: "No Space for Legacy Option ROM", +# 214: "No Console Output Devices are found", +# 215: "No Console Input Devices are found", +# 216: "Invalid password", +# 217: "Error loading Boot Option (LoadImage returned error)", +# 218: "Boot Option is failed (StartImage returned error)", +# 219: "Flash update is failed", +# 220: "Reset protocol is not available", +# 221: "Reserved for future AMI progress codes", +# 222: "Reserved for future AMI progress codes", +# 223: "Reserved for future AMI progress codes", +# 224: "S3 Resume is stared (S3 Resume PPI is called by the DXE IPL)", +# 225: "S3 Boot Script execution", +# 226: "Video repost", +# 227: "OS S3 wake vector call", +# 228: "Reserved for future AMI progress codes", +# 229: "Reserved for future AMI progress codes", +# 230: "Reserved for future AMI progress codes", +# 231: "Reserved for future AMI progress codes", +# 232: "S3 Resume Failed", +# 233: "S3 Resume PPI not Found", +# 234: "S3 Resume Boot Script Error", +# 235: "S3 OS Wake Error", +# 236: "Reserved for future AMI error codes 31", +# 237: "Reserved for future AMI error codes 31", +# 238: "Reserved for future AMI error codes 31", +# 239: "Reserved for future AMI error codes 31", +# 240: "Recovery condition triggered by firmware (Auto recovery)", +# 241: "Recovery condition triggered by user (Forced recovery)", +# 242: "Recovery process started", +# 243: "Recovery firmware image is found", +# 244: "Recovery firmware image is loaded", +# 245: "Reserved for future AMI progress codes", +# 246: "Reserved for future AMI progress codes", +# 247: "Reserved for future AMI progress codes", +# 248: "Recovery PPI is not available", +# 249: "Recovery capsule is not found", +# 250: "Invalid recovery capsule", +# 251: "Reserved for future AMI error codes", +# 252: "Reserved for future AMI error codes", +# 253: "Reserved for future AMI error codes", +# 254: "Reserved for future AMI error codes", +# 255: "Indicates a failure has occurred" +# } +# +# POSTHex7Segment = { +# 0: "00", +# 1: "01", +# 2: "02", +# 3: "03", +# 4: "04", +# 5: "05", +# 6: "06", +# 7: "07", +# 8: "08", +# 9: "09", +# 10: "0A", +# 11: "0b", +# 12: "0C", +# 13: "0d", +# 14: "0E", +# 15: "0F", +# 16: "10", +# 17: "11", +# 18: "12", +# 19: "13", +# 20: "14", +# 21: "15", +# 22: "16", +# 23: "17", +# 24: "18", +# 25: "19", +# 26: "1A", +# 27: "1b", +# 28: "1C", +# 29: "1d", +# 30: "1E", +# 31: "1F", +# 32: "20", +# 33: "21", +# 34: "22", +# 35: "23", +# 36: "24", +# 37: "25", +# 38: "26", +# 39: "27", +# 40: "28", +# 41: "29", +# 42: "2A", +# 43: "2b", +# 44: "2C", +# 45: "2d", +# 46: "2E", +# 47: "2F", +# 48: "30", +# 49: "31", +# 50: "32", +# 51: "33", +# 52: "34", +# 53: "35", +# 54: "36", +# 55: "37", +# 56: "38", +# 57: "39", +# 58: "3A", +# 59: "3b", +# 60: "3C", +# 61: "3d", +# 62: "3E", +# 63: "3F", +# 64: "40", +# 65: "41", +# 66: "42", +# 67: "43", +# 68: "44", +# 69: "45", +# 70: "46", +# 71: "47", +# 72: "48", +# 73: "49", +# 74: "4A", +# 75: "4b", +# 76: "4C", +# 77: "4d", +# 78: "4E", +# 79: "4F", +# 80: "50", +# 81: "51", +# 82: "52", +# 83: "53", +# 84: "54", +# 85: "55", +# 86: "56", +# 87: "57", +# 88: "58", +# 89: "59", +# 90: "5A", +# 91: "5b", +# 92: "5C", +# 93: "5d", +# 94: "5E", +# 95: "5F", +# 96: "60", +# 97: "61", +# 98: "62", +# 99: "63", +# 100: "64", +# 101: "65", +# 102: "66", +# 103: "67", +# 104: "68", +# 105: "69", +# 106: "6A", +# 107: "6b", +# 108: "6C", +# 109: "6d", +# 110: "6E", +# 111: "6F", +# 112: "70", +# 113: "71", +# 114: "72", +# 115: "73", +# 116: "74", +# 117: "75", +# 118: "76", +# 119: "77", +# 120: "78", +# 121: "79", +# 122: "7A", +# 123: "7b", +# 124: "7C", +# 125: "7d", +# 126: "7E", +# 127: "7F", +# 128: "80", +# 129: "81", +# 130: "82", +# 131: "83", +# 132: "84", +# 133: "85", +# 134: "86", +# 135: "87", +# 136: "88", +# 137: "89", +# 138: "8A", +# 139: "8b", +# 140: "8C", +# 141: "8d", +# 142: "8E", +# 143: "8F", +# 144: "90", +# 145: "91", +# 146: "92", +# 147: "93", +# 148: "94", +# 149: "95", +# 150: "96", +# 151: "97", +# 152: "98", +# 153: "99", +# 154: "9A", +# 155: "9b", +# 156: "9C", +# 157: "9d", +# 158: "9E", +# 159: "9F", +# 160: "A0", +# 161: "A1", +# 162: "A2", +# 163: "A3", +# 164: "A4", +# 165: "A5", +# 166: "A6", +# 167: "A7", +# 168: "A8", +# 169: "A9", +# 170: "AA", +# 171: "Ab", +# 172: "AC", +# 173: "Ad", +# 174: "AE", +# 175: "AF", +# 176: "b0", +# 177: "b1", +# 178: "b2", +# 179: "b3", +# 180: "b4", +# 181: "b5", +# 182: "b6", +# 183: "b7", +# 184: "b8", +# 185: "b9", +# 186: "bA", +# 187: "bb", +# 188: "bC", +# 189: "bd", +# 190: "bE", +# 191: "bF", +# 192: "C0", +# 193: "C1", +# 194: "C2", +# 195: "C3", +# 196: "C4", +# 197: "C5", +# 198: "C6", +# 199: "C7", +# 200: "C8", +# 201: "C9", +# 202: "CA", +# 203: "Cb", +# 204: "CC", +# 205: "Cd", +# 206: "CE", +# 207: "CF", +# 208: "d0", +# 209: "d1", +# 210: "d2", +# 211: "d3", +# 212: "d4", +# 213: "d5", +# 214: "d6", +# 215: "d7", +# 216: "d8", +# 217: "d9", +# 218: "dA", +# 219: "db", +# 220: "dC", +# 221: "dd", +# 222: "dE", +# 223: "dF", +# 224: "E0", +# 225: "E1", +# 226: "E2", +# 227: "E3", +# 228: "E4", +# 229: "E5", +# 230: "E6", +# 231: "E7", +# 232: "E8", +# 233: "E9", +# 234: "EA", +# 235: "Eb", +# 236: "EC", +# 237: "Ed", +# 238: "EE", +# 239: "EF", +# 240: "F0", +# 241: "F1", +# 242: "F2", +# 243: "F3", +# 244: "F4", +# 245: "F5", +# 246: "F6", +# 247: "F7", +# 248: "F8", +# 249: "F9", +# 250: "FA", +# 251: "Fb", +# 252: "FC", +# 253: "Fd", +# 254: "FE", +# 255: "FF" +# } +# \ No newline at end of file diff --git a/webui/ipkvm/util/profiles/events.py b/webui/ipkvm/util/profiles/events.py index 3bf4dd2..c6aad35 100644 --- a/webui/ipkvm/util/profiles/events.py +++ b/webui/ipkvm/util/profiles/events.py @@ -1,6 +1,8 @@ import tomlkit from ipkvm.app import ui from . import profile_manager +from ipkvm.util.mkb import esp32_serial +from ipkvm.states import model @ui.on("get_current_profile") def handle_current_profile(): @@ -12,4 +14,9 @@ def handle_save_profile(data: str): @ui.on("save_profile_as") def handle_save_profile_as(data: str, name: str): - profile_manager.save_profile(tomlkit.parse(data), name) # type: ignore \ No newline at end of file + profile_manager.save_profile(tomlkit.parse(data), name) # type: ignore + +@ui.on("apply_current_bios_settings") +def handle_bios_settings(): + model.current_BIOS_location = esp32_serial.apply_all_settings(profile_manager.profile["client"]["overclocking"], + profile_manager.bios_map, model.current_BIOS_location) \ No newline at end of file diff --git a/webui/ipkvm/util/profiles/profiles.py b/webui/ipkvm/util/profiles/profiles.py index c13d4ad..94e1101 100644 --- a/webui/ipkvm/util/profiles/profiles.py +++ b/webui/ipkvm/util/profiles/profiles.py @@ -1,26 +1,10 @@ +from networkx import nx_agraph from os import listdir +from os.path import exists import threading import tomlkit -from ipkvm.app import logger, ui -from typing import TypedDict - -class VideoDict(TypedDict): - friendly_name: str - resolution: str - fps: str - -class ServerDict(TypedDict): - esp32_serial: str - video_device: VideoDict - -class ClientDict(TypedDict): - hostname: str - hwinfo_port: str - overclocking: dict[str, dict[str, str]] - -class ProfileDict(TypedDict): - server: ServerDict - client: ClientDict +from ipkvm.app import logger +from ipkvm.util.types import MultiDiGraph, ProfileDict class ProfileManager(): def __init__(self): @@ -29,6 +13,7 @@ class ProfileManager(): self.restart_hwinfo = threading.Event() self._cur_profile_name: str = "" self._profiles = listdir("profiles") + self._bios_map: MultiDiGraph if len(self._profiles) == 0: logger.info("No profiles found, loading default profile.") @@ -50,6 +35,9 @@ class ProfileManager(): with open(f"profiles/{name}", 'r') as file: self._cur_profile_name = name self._profile = tomlkit.parse(file.read()) # type: ignore + if exists(self._profile["client"]["bios_map_path"]): + self._bios_map = nx_agraph.read_dot(self._profile["client"]["bios_map_path"]) + self.notify_all() def save_profile(self, new_profile: ProfileDict, name: str = ""): @@ -94,3 +82,7 @@ class ProfileManager(): @property def profile(self): return self._profile + + @property + def bios_map(self): + return self._bios_map diff --git a/webui/ipkvm/util/types/__init__.py b/webui/ipkvm/util/types/__init__.py new file mode 100644 index 0000000..c7bef7f --- /dev/null +++ b/webui/ipkvm/util/types/__init__.py @@ -0,0 +1,31 @@ +from networkx import Graph +from typing import Any, TypedDict + +# Type checker lunacy! +type MultiDiGraph = Graph[Any] + +class VideoDict(TypedDict): + friendly_name: str + resolution: str + fps: str + +class ServerDict(TypedDict): + esp32_serial: str + video_device: VideoDict + +class OverclockingDict(TypedDict): + common: dict[str, str] + cpu: dict[str, str] + memory: dict[str, str] + +class ClientDict(TypedDict): + hostname: str + hwinfo_port: str + ryzen_smu_cli_path: str + ycruncher_path: str + bios_map_path: str + overclocking: OverclockingDict + +class ProfileDict(TypedDict): + server: ServerDict + client: ClientDict