Page 3 of 3
#31 RE: What exactly is the hal timer problem? by YuriyCN 25.04.2020 09:50

Zitat von Mov AX, 0xDEAD im Beitrag #30
Zitat von YuriyCN im Beitrag #28

Возможно, проблема в криво написанном GS_CABer, но не факт что найдутся и другие подобные "кривые" программы


подробнее про эту проблему, но на инглише чтобы все могли прочитать:

- WinXP SP2+ uses acpi timer for getting incremental counter (acpi spec declare this counter as part of specification)
- WinXP detect existing this timer by checking special bit USE_PLATFORM_CLOCK in FACP ACPI table, this bit controlled by BIOS
- Skylake+ bioses by default disable this timer at hardware level (register "ACPI Timer Control (ACPI_TMR_CTL)" in southbridge, see PDF)
- Skylake+ bioses stiil set USE_PLATFORM_CLOCK=1 in acpi, i think purspose is to inform Win7+ about existing HPET timer (not acpi timer!)
- If WinXP uses broken acpi timer, counter value is negative, so many progs become "crazy"
- HAL_timer_fix cheat WinXP to read USE_PLATFORM_CLOCK always =0, so this onebyte patch force to not use disabled acpi timer (exactly it avoid overwrite offsets to 3 functions)
- 74/75->eb and mov xxx,yyyy->ret are equalent patches, first is preffered, don't need both
- WinAPI declare 8 bytes to store value of counter, so values 2500+MHZ is not problem for properly maked programs (my cpu 3600Mhz fit in 6 bytes i think)
- To solve issue with bad progs like gs_caber, counter need to devide to much lesser value, win7 just divide it to 1024, so timer frequency on 3600Ghz cpu is only 3.5xx Mhz, this is what "hal tsc timer frequency divider" do in my early post on this page

p.s. Hal version can also include DMA32 PAE fix, so theres can be many diff bytes. I do not share files on public, please do not ask, make patches yourself if it possible



Thanks for answer. In the file "hal.dll" (version 5.1.2600.5687), replacing the byte at offset 07B3C, to put byte 0xC3 instead of byte 0xC7 -- fix PM_Timer. Correction of the timer leads to an increase in the performance of the SATA AHCI driver up to 30%. I measure the speed of the SSD drive by copying a file of few gigabytes in size using Total Commander.

On Windows 7, the speed reaches 450 MB/s, but on Windows XP it is much lower - 180 MB/s. The speed limit is due to the SATA AHCI driver, because the SSD drive itself is much more productive. Replacing hal.dll with the patched one, I got a speed increase up to 260-265 MB/s. The byte at offset 07B3C has an effect. Fixing the remaining bytes does not affect performance, although I have 16 GB of RAM and use the PAE mode, maybe the "DMA32 PAE fix" on my processor and motherboard is not required.

You wrote a lot of technical information, but I'm not a hacker - I don’t understand what to do about it. Can you make a ready-made solution - to patch the file https://www.upload.ee/files/11521284/hal.zip.html and to fix PM_Timer, taking into account the normal operation of the PAE mode and the GS_Caber program, which stops starting when the patched file "hal.dll" is used. Or indicate which bytes at which offset are needed to fix, so that I can do it myself. Thanks in advance.

Xobor Forum Software von Xobor
Datenschutz