TSCSync - TimeStampCounter (TSC) synchronizer, analyze System Timer characteristics
Explore timer characteristics on current UEFI Personal Computer (PC) hardware.
Analyse usability and accuracy of 64Bit TSC (time stamp counter) as a time base in UEFI BIOS POST and UEFI SHELL Applications.
Provide program sequence, synchronisation method and basic knowledge on how to deal with the fastes, and most precise timer on x86-Microprocessors.
Create an UEFI Shell Tool TSCSync that makes it easy to select, modify and scale data processing, logging, representation for this particular laboratory application.
Just watch the video: https://www.youtube.com/watch?v=I92emFEyTDI
NOTE: /AUTORUN mode usually runs a predefined and saved configuration. This mode was made available to enable repeated .NSH/batch controlled TSCSync invocation with modified settings, like
- calibration /METHOD
- TIANO, original tianocore
InternalAcpiDelay()
- ACPI, native TSCSYNC ACPI counter
- PIT, native TSCSYNC PIT i8254 counter
- TIANO, original tianocore
- output filename /OUT
- modified reference synchronisation time /SYNCTIME 1..1000
- modified reference synchronisation device /SYNCREF
- RTC
- ACPI
Just watch the video: https://www.youtube.com/watch?v=hjeykqZqekc&t=27s
- distinguish RTC and ACPI based frequency detection
- NOTE: ACPI frequency lacks precision as long term time base
- RTC usually uses a separate 32.768kHz crystal with low drift (e.g. 2ppm)
- CPU/SoC (ACPI) OSC is usually driven by a MHz-oscillator (e.g. 25MHz) that doesn't have high precision and low drift requirements as the REAL TIME CLOCK
- NOTE: ACPI frequency lacks precision as long term time base
- add AMI APTIO V UEFI timestamp protocol calibration drift demonstration:
- add feature:
- FILE->SoftOFF/S5, set platform to SoftOFF/S5
- add 10000kHz digit rounding, e.g.
- 1995379567 is rounded to 1995380000
- 1995371234 is rounded to 1995370000
- fixed: fix rounding issue for X.YZ9999999GHz values
- provide .EFI executable TSCSync.EFI
- internal: update submodules
- internal: cleanup main.cpp
- add TSC clock speed rounding (experimental), get identical result like CPUID leaf 0x15-enabled platforms
- simplify command line parameters -> remove selection of SYNCREF (synchronization reference device), SYNCTIME (synchronization time)
- force SYNCREF ACPI timer, force SYNCTIME 5 seconds
- add version + build enumeration (experimental)
- add retrieval of Time Stamp Counter and Core Crystal Clock Information Leaf
- NOTE: On platforms with available CPUID leaf 0x15 (Intel CPU 2017 and later) it demonstrates, that ACPI reference synchronisation is very accurate (about 0.1ppm)
- add retrieval of MSR_PLATFORM_INFO TSC Speed detection
- add reference spreadsheet taken on RAPTOR LAKE platform NOTE: Improvements below apply only to recent INTEL(tm) platforms only. The particular CPUID leaf 0x15 and MSR MSR_PLATFORM_INFO are not available on AMD systems.
- add retrieval, examination and comparison of original UEFI
EFI_TIMESTAMP_PROTOCOL
NOTE:EFI_TIMESTAMP_PROTOCOL
provides inaccurate results on most systems.
- add error correction menu
CONF\Error Correction
and command line (/ERRCODIS
) selectable- NOTE: Error correction N/A for original TIANOCORE (TIANO) measurement method
Only available for TSCSYNC ACPI and PIT.
- NOTE: Error correction N/A for original TIANOCORE (TIANO) measurement method
- add calibration method menu
CONF\Calibration Method TIANO/PIT/ACPI
and command line (/METHOD
) selectable - add number of measurement command line (
/NUM:0/1/2/3
) selectable - update to TORO C Library 20231118
- improvement, BETA RELEASE
- add Calibration Method for PIT(i8254) and original tianocore to CONFig menu
NOTE: the third method "ACPI" (that is my own calibration based on ACPI timer) can be selected via command line only
- improvement, BETA RELEASE
- add /METHOD:TIANO/ACPI/PIT to select ACPI/PIT(i8254) or original tianocore calibration method
- CONFIG Menu shows true timing values, instead of ACPI clock numbers
- initial revision, ALPHA RELEASE