From e7d381a4b48091e60bd432d9a9c7a342e47d5392 Mon Sep 17 00:00:00 2001 From: "Iliya Mihailov (Ghost)" Date: Fri, 2 Feb 2007 10:23:31 +0000 Subject: [PATCH] GMon * Intel NortWood multiplier bugfix * some a small change git-svn-id: svn://kolibrios.org@313 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/system/gmon/SMBus.inc | 7 +- programs/system/gmon/config.inc | 6 +- programs/system/gmon/diag.inc | 5 + programs/system/gmon/gmon.asm | 6 +- programs/system/gmon/hwm.inc | 5 + programs/system/gmon/hwm_it87.inc | 5 + programs/system/gmon/hwm_uguru.inc | 5 + programs/system/gmon/hwm_wb.inc | 5 + programs/system/gmon/system.inc | 20 +- programs/system/gmon/tab_about.inc | 5 + programs/system/gmon/tab_conf.inc | 5 + programs/system/gmon/tab_info.inc | 11 +- programs/system/gmon/tab_test.inc | 5 + programs/system/gmon/tests.inc | 320 +++++++++++++++-------------- 14 files changed, 237 insertions(+), 173 deletions(-) diff --git a/programs/system/gmon/SMBus.inc b/programs/system/gmon/SMBus.inc index a9cfb00904..9f09a1616f 100644 --- a/programs/system/gmon/SMBus.inc +++ b/programs/system/gmon/SMBus.inc @@ -1,8 +1,13 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= ; SMBus interface ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -;include 'smb_nf2.inc' +include 'smb_nf2.inc' smb_base dd 0 ; IO port base for SMBus acces smb_slave dd 0 ; SMBus addres for monitoring chip diff --git a/programs/system/gmon/config.inc b/programs/system/gmon/config.inc index a5a76aaa2b..1d554bf593 100644 --- a/programs/system/gmon/config.inc +++ b/programs/system/gmon/config.inc @@ -1,7 +1,11 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved ; 0x00xx - Menuet 0.xx ; 0x0400 - Kolibi 4 (новое завершение процесса) -; 0x0510 - MSR -> множитель +; 0x0510 - MSR -> множитель (Kolibri 0.5.1.0) ; 0x0530 - всего/свободно памяти ; 0x0580 - новое завершение процесса OS_version equ 0x0580 diff --git a/programs/system/gmon/diag.inc b/programs/system/gmon/diag.inc index 2c1a87b0b3..16e41c4410 100644 --- a/programs/system/gmon/diag.inc +++ b/programs/system/gmon/diag.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; struc DiagramData size,color ; { ; .color dd color diff --git a/programs/system/gmon/gmon.asm b/programs/system/gmon/gmon.asm index 901c18e17d..12574a2880 100644 --- a/programs/system/gmon/gmon.asm +++ b/programs/system/gmon/gmon.asm @@ -1,5 +1,8 @@ ; ; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved +; ; ВОЗМОЖНА ПОРЧА ОБОРУДОВАНИЯ! ; ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК! ; @@ -46,7 +49,8 @@ ; 20/12/2006 - W83627DHG, W83627EHF, W83627EHG, mutipliers for AthonXP-M, Athlon64, Athlon64-M, ; Intel Dothan, Yonah, Conroe, Merom ; 24/12/2006 - ITE chips model id bugfix by Serge -; 26/15/2006 - исправленна глупая ошибка в определении ITE и uGuru +; 26/12/2006 - исправленна глупая ошибка в определении ITE и uGuru +; 31/01/2007 - исправлена ошибка внесённая 17/07/06 в определение множителя для Intel NorthWood ; ; Эй! У меня нет много времени. diff --git a/programs/system/gmon/hwm.inc b/programs/system/gmon/hwm.inc index 05636a7829..52604d6a91 100644 --- a/programs/system/gmon/hwm.inc +++ b/programs/system/gmon/hwm.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; ; HWM abstract interface, provide: ; hwm_init, hwm_get_params, hwm_enable, hwm_temps, hwm_rpms, hwm_voltages, hwm_chip_name diff --git a/programs/system/gmon/hwm_it87.inc b/programs/system/gmon/hwm_it87.inc index b6b656c341..99d6048cbc 100644 --- a/programs/system/gmon/hwm_it87.inc +++ b/programs/system/gmon/hwm_it87.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; Integrated Technology Express ; Chip Temp Volt Fan ISA SMBus ; it8705 3 8 3 + + diff --git a/programs/system/gmon/hwm_uguru.inc b/programs/system/gmon/hwm_uguru.inc index f1b53d8f34..0641c028c1 100644 --- a/programs/system/gmon/hwm_uguru.inc +++ b/programs/system/gmon/hwm_uguru.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; ABIT uGuru ; ; Chip Temp Volt Fan ISA SMBus LPC diff --git a/programs/system/gmon/hwm_wb.inc b/programs/system/gmon/hwm_wb.inc index e01c9a07e3..3bd276e01c 100644 --- a/programs/system/gmon/hwm_wb.inc +++ b/programs/system/gmon/hwm_wb.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; ; Библиотека для чипов WinBond ; diff --git a/programs/system/gmon/system.inc b/programs/system/gmon/system.inc index 7d92f6902e..b5e2c055d4 100644 --- a/programs/system/gmon/system.inc +++ b/programs/system/gmon/system.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ;-------------------------------------------------------------------- ; Загрузка процессора ; OUT : AL - загрузка в процентах @@ -259,7 +264,7 @@ noAMD: cmp dword [Vendor + 8], 'ntel' ; Check for International Electronics CPU ret @@: cmp byte [CPU_mod], 2 jae @f - mov eax, 68 ; Pentium 4 / Xeon (model < 2) + mov eax, 68 ; Pentium 4 / Xeon (model < 2) Willamete mov ebx, 3 mov edx, 0x2A int 0x40 @@ -267,17 +272,12 @@ noAMD: cmp dword [Vendor + 8], 'ntel' ; Check for International Electronics CPU and eax, 0x0F mov cl, [p4coef + eax] ret -@@: mov eax, 68 ; Pentium 4 / Xeon (model >= 2) +@@: mov eax, 68 ; Pentium 4 / Xeon (model >= 2) NorthWood mov ebx, 3 mov edx, 0x2C int 0x40 - - ; shr eax, 24 - ; and eax, 0x1F - shr eax, 27 - and al, 0Fh - add al, 8 - + shr eax, 24 + and eax, 0x1F mov dl, 10 mul dl mov cl, al @@ -322,7 +322,7 @@ athloncoef db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 1 athlonmcoef: db 110, 115, 120, 125, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100, 105 db 30, 190, 40, 200, 130, 135, 14, 210, 150, 220, 160, 165, 170, 230, 240 athloncoef3 db 45, 50, 40, 55, 25, 30, 60, 35 -p4coef db 160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150 ; Pentium 4 +p4coef db 160, 170, 180, 190, 200, 210, 220, 230, 80, 90, 100, 110, 120, 130, 140, 150 ; Pentium 4 (Willamete) coppercoeff db 50, 30, 40, 20, 55, 35, 45, 25, 35, 70, 80, 60, 20, 75, 15, 65, 90, 110, 120, 20, 95, 115, 85, 25, 35, 70, 80, 100, 20, 75, 15, 105 tualatcoeff db 120, 35, 35, 40, 55, 35, 115, 35, 160, 70, 80, 60, 40, 75, 35, 65, 90, 110, 35, 35, 95, 35, 85, 35, 35, 35, 130, 100, 140, 35, 150, 105 else diff --git a/programs/system/gmon/tab_about.inc b/programs/system/gmon/tab_about.inc index 698931974d..9134891c6c 100644 --- a/programs/system/gmon/tab_about.inc +++ b/programs/system/gmon/tab_about.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + mov edx, msg_about mov ebx, 17 * 65536 + 285 diff --git a/programs/system/gmon/tab_conf.inc b/programs/system/gmon/tab_conf.inc index 147e9972f0..03e31f5bb2 100644 --- a/programs/system/gmon/tab_conf.inc +++ b/programs/system/gmon/tab_conf.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; ; ; Вкладка настроек diff --git a/programs/system/gmon/tab_info.inc b/programs/system/gmon/tab_info.inc index 747db4f2b3..bf70f4ab46 100644 --- a/programs/system/gmon/tab_info.inc +++ b/programs/system/gmon/tab_info.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; ; ; Вкладка информации о системе @@ -29,7 +34,7 @@ mmx_en: int 0x40 mov al, byte[edx] movzx esi, al inc edx - mov ebx, 160 * 65536 + 315 + mov ebx, 160 * 65536 + 325 mov al, 4 int 0x40 ; Частота процессора @@ -88,7 +93,7 @@ mmx_en: int 0x40 fstp dword[esp] mov esi, esp call ftoa - mov ebx, 160 * 65536 + 325 + mov ebx, 160 * 65536 + 315 mov edx, Data_String mov eax, 4 mov esi, eax @@ -130,6 +135,6 @@ lab_info_tab mls \ 'CPU Vendor',\ 'CPU frequency (MHz)',\ 'MMX tehnology',\ - 'Monitoring chip',\ 'Multiplier',\ + 'Monitoring chip',\ 'Free memory (Kb)' diff --git a/programs/system/gmon/tab_test.inc b/programs/system/gmon/tab_test.inc index 52b3842a57..cf5c8631a6 100644 --- a/programs/system/gmon/tab_test.inc +++ b/programs/system/gmon/tab_test.inc @@ -1,3 +1,8 @@ +; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved + ; ; ; diff --git a/programs/system/gmon/tests.inc b/programs/system/gmon/tests.inc index 4354207377..2bc489fb16 100644 --- a/programs/system/gmon/tests.inc +++ b/programs/system/gmon/tests.inc @@ -1,62 +1,68 @@ ; +; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы +; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru) +; All Right Reserved ; -; k6, k7, p5 & p6 based on Robert Redelmeier's burnCPU tests -; ported by Ghost +; k6, k7, p5 & p6 tests based on Robert J. Redelmeier cpuburn-1.4 +; Copyright 1999, 2000 Robert J. Redelmeier. All Right Reserved +; Licensed under GNU General Public Licence 2.0. No warrantee. + +; adapted by Mihailov Ilia ; ; Заметки : ; переписть реакцию на ошибки k6: - finit - push ebp - mov ebp, esp - and ebp, -32 - sub esp, 96 - fldpi - fld qword [rtt] - fstp qword [ebp - 24] - fld qword [e] - fstp qword [ebp - 32] - mov edx, [half] - mov [ebp - 8], edx -k6_after_check: - xor eax, eax - mov ebx, eax - lea esi, [eax - 1] - mov ecx, 400000000 + finit + push ebp + mov ebp, esp + and ebp, -32 + sub esp, 96 + fldpi + fld qword [rtt] + fstp qword [ebp - 24] + fld qword [e] + fstp qword [ebp - 32] + mov edx, [half] + mov [ebp - 8], edx +k6_after_check: + xor eax, eax + mov ebx, eax + lea esi, [eax - 1] + mov ecx, 400000000 mov [ebp - 4], ecx align 32 - ;rev. eng. win. ver. (lea esi, [esi]) ; Ghost -k6_crunch: - fld qword [ebp+esi*8-16] ; CALC BLOCK - fmul qword [ebp+esi*8-24] - add edx, [half + 9 + esi + esi * 8] ;!!! - jnz $ + 2 - faddp - fld qword [ebp+esi*8-16] - dec ebx - sub edx, [half + 9 + esi + esi * 8] ;!!! - jmp $ + 2 - fmul qword [ebp+esi*8-24] - inc ebx - dec dword [ebp+esi*8+4] - fsubp - jnz k6_crunch ; time for testing ? - - test ebx, ebx ; TEST BLOCK - jnz k6_int_exit - cmp edx, [half] - jnz k6_int_exit - fldpi - fcomp st1 - fstsw ax - sahf - jz k6_after_check - dec ebx -k6_int_exit: - dec ebx - add esp, 96 - pop ebp + ;rev. eng. win. ver. (lea esi, [esi]) ; Ghost +k6_crunch: + fld qword [ebp+esi*8-16] ; CALC BLOCK + fmul qword [ebp+esi*8-24] + add edx, [half + 9 + esi + esi * 8] ;!!! + jnz $ + 2 + faddp + fld qword [ebp+esi*8-16] + dec ebx + sub edx, [half + 9 + esi + esi * 8] ;!!! + jmp $ + 2 + fmul qword [ebp+esi*8-24] + inc ebx + dec dword [ebp+esi*8+4] + fsubp + jnz k6_crunch ; time for testing ? + + test ebx, ebx ; TEST BLOCK + jnz k6_int_exit + cmp edx, [half] + jnz k6_int_exit + fldpi + fcomp st1 + fstsw ax + sahf + jz k6_after_check + dec ebx +k6_int_exit: + dec ebx + add esp, 96 + pop ebp mov eax, -1 int 0x40 ;####################################################################### @@ -116,118 +122,118 @@ k7_int_exit: int 0x40 ;####################################################################### ;####################################################################### -p5: finit - push ebp - mov ebp, esp - and ebp, -32 - sub esp, 96 - fld qword [half] - fstp qword [ebp - 24] - fld qword [rtt] - fst qword [ebp - 16] - fld st - fld st -p5_after_check: - xor eax, eax - mov eax, ebx - mov ecx, 200000000 -align 32 - ;# MAIN LOOP 16 flops / 18 cycles -p5_crunch: - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - fmul qword [ebp - 24] - fxch st1 - fadd qword [ebp - 16] - fxch st2 - - dec ecx - jnz p5_crunch - +p5: finit + push ebp + mov ebp, esp + and ebp, -32 + sub esp, 96 + fld qword [half] + fstp qword [ebp - 24] + fld qword [rtt] + fst qword [ebp - 16] + fld st + fld st +p5_after_check: + xor eax, eax + mov eax, ebx + mov ecx, 200000000 +align 32 + ;# MAIN LOOP 16 flops / 18 cycles +p5_crunch: + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + fmul qword [ebp - 24] + fxch st1 + fadd qword [ebp - 16] + fxch st2 + + dec ecx + jnz p5_crunch + jmp p5_after_check ;####################################################################### ;####################################################################### -p6: finit - push ebp - mov ebp, esp - and ebp, -32 - sub esp, 96 - fldpi - fld qword [rtt] - fstp qword [ebp - 24] - fld qword [e] - fstp qword [ebp - 32] - mov edx, [half] - mov [ebp - 8], edx -p6_after_check: - xor eax, eax - mov ebx, eax - lea esi, [eax - 1] - mov ecx, 539000000 ;# check after this count - mov [ebp - 4], ecx -align 32 -p6_crunch: ;# MAIN LOOP 21uops / 8.0 clocks - fld qword [ebp+esi*8-16] - fmul qword [ebp+esi*8-24] - add edx, [half] - jnz $ + 2 - faddp - fld qword [ebp - 24] - dec ebx - sub edx, [half + 9 + esi + esi*8] - jmp $ + 2 - fmul qword [ebp+esi*8-24] - inc ebx - dec dword [ebp+esi*8+4] - fsubp - jnz p6_crunch - - test ebx, ebx ;# Testing block - mov ebx, 0 - jnz p6_int_exit - cmp edx, [half] - jnz p6_int_exit - fldpi - fcomp st1 - fstsw ax - sahf - jz p6_after_check ;# fp result = pi ? - dec ebx -p6_int_exit: ;# error abort - dec ebx - add esp, 96 +p6: finit + push ebp + mov ebp, esp + and ebp, -32 + sub esp, 96 + fldpi + fld qword [rtt] + fstp qword [ebp - 24] + fld qword [e] + fstp qword [ebp - 32] + mov edx, [half] + mov [ebp - 8], edx +p6_after_check: + xor eax, eax + mov ebx, eax + lea esi, [eax - 1] + mov ecx, 539000000 ;# check after this count + mov [ebp - 4], ecx +align 32 +p6_crunch: ;# MAIN LOOP 21uops / 8.0 clocks + fld qword [ebp+esi*8-16] + fmul qword [ebp+esi*8-24] + add edx, [half] + jnz $ + 2 + faddp + fld qword [ebp - 24] + dec ebx + sub edx, [half + 9 + esi + esi*8] + jmp $ + 2 + fmul qword [ebp+esi*8-24] + inc ebx + dec dword [ebp+esi*8+4] + fsubp + jnz p6_crunch + + test ebx, ebx ;# Testing block + mov ebx, 0 + jnz p6_int_exit + cmp edx, [half] + jnz p6_int_exit + fldpi + fcomp st1 + fstsw ax + sahf + jz p6_after_check ;# fp result = pi ? + dec ebx +p6_int_exit: ;# error abort + dec ebx + add esp, 96 pop ebp mov eax, -1 - int 0x40 + int 0x40 ;--------------------------------------------- align 32 half dd 0x7fffffff, 0