2006-11-02 17:18:23 +03:00
|
|
|
|
;
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Ghost Monitor - утилита (стресс) тестирования и мониторинга системы
|
2007-02-02 13:23:31 +03:00
|
|
|
|
; Copyright (C) 2005, 2006, 2007 Mihailov Ilia (ghost.nsk@mail.ru)
|
|
|
|
|
; All Right Reserved
|
|
|
|
|
;
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; ВОЗМОЖНА ПОРЧА ОБОРУДОВАНИЯ!
|
|
|
|
|
; ИСПОЛЬЗУЙТЕ НА СВОЙ СТРАХ И РИСК!
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Заметки :
|
2019-08-23 23:12:13 +03:00
|
|
|
|
; Дописать запуск тестов (rtst) (нет реакции на ошибку запуска)
|
|
|
|
|
; Переделать обновление графика (сделать отдельным процессом)
|
|
|
|
|
; Добавить реакцию на параметры датчиков
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Внешние файлы :
|
2019-08-23 23:12:13 +03:00
|
|
|
|
; hwm*.inc - процедуры работы с датчиками мониторинга
|
|
|
|
|
; system.inc - вычисление загрузки процессора, завершение теста, etc...
|
|
|
|
|
; tests.inc - тесты ;-)
|
|
|
|
|
; diag.inc - поддержка диаграм
|
|
|
|
|
; tab_*.inc - процедуры отрисовки соответствуюших вкладок
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Identifier buttons :
|
2019-08-23 23:12:13 +03:00
|
|
|
|
; 01 - Exit
|
|
|
|
|
; 02 - Info tab
|
|
|
|
|
; 03 - Tests tab
|
|
|
|
|
; 04 - Config tab
|
|
|
|
|
; 05 - About tab
|
|
|
|
|
; 06 - P5 test (tab_test.inc)
|
|
|
|
|
; 07 - P6 test (tab_test.inc)
|
|
|
|
|
; 08 - K6 test (tab_test.inc)
|
|
|
|
|
; 09 - K7 test (tab_test.inc)
|
|
|
|
|
; 10 - MMX test - not used (tab_test.inc)
|
|
|
|
|
; 11 - Update time increment (tab_conf.inc)
|
|
|
|
|
; 12 - Update time decriment (tab_conf.inc)
|
|
|
|
|
; 13..17 - Color Changing buttons CPU_load, Mem_usage, Temp1, Temp2, Temp3
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
include 'config.inc'
|
|
|
|
|
include 'macros.inc'
|
|
|
|
|
|
2019-08-23 23:12:13 +03:00
|
|
|
|
macro clear_prev_no arg1 ; clears previous number printed at arg1
|
2017-12-20 03:51:00 +03:00
|
|
|
|
{
|
|
|
|
|
pusha
|
2019-08-23 23:12:13 +03:00
|
|
|
|
mov ebx, 0x00070000
|
|
|
|
|
mov ecx, 1000000 ; dummy value
|
|
|
|
|
mov edx, arg1
|
|
|
|
|
mov esi, 0x40000000 + tcol
|
|
|
|
|
mov edi, tcol ; bg col
|
|
|
|
|
mov eax, 47
|
|
|
|
|
int 0x40
|
2017-12-20 03:51:00 +03:00
|
|
|
|
popa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
nl equ 0x0d, 0x0a
|
|
|
|
|
|
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
tcol equ 0x5080d0
|
|
|
|
|
atcol equ 0x4070c0
|
2015-12-09 00:56:29 +03:00
|
|
|
|
val_mod equ 0x3090
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
MEOS_APP_START
|
2016-03-16 22:35:22 +03:00
|
|
|
|
include "tests.inc" ; <-- Много выравниваний, лучше здесь
|
2006-11-02 17:18:23 +03:00
|
|
|
|
CODE
|
|
|
|
|
;--- Init ------------------------------------------------------------
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Очищаем неинициализированные данные
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov ecx, __memory - __udata
|
|
|
|
|
mov edi, __udata
|
|
|
|
|
xor eax, eax
|
|
|
|
|
rep stosb
|
|
|
|
|
|
|
|
|
|
xor eax, eax
|
2016-03-16 22:35:22 +03:00
|
|
|
|
cpuid ; Узнаём производителя проца
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov [Vendor + 0], ebx
|
|
|
|
|
mov [Vendor + 4], edx
|
|
|
|
|
mov [Vendor + 8], ecx
|
|
|
|
|
mov eax, 1
|
2016-03-16 22:35:22 +03:00
|
|
|
|
cpuid ; Есть ли MMX ?
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov ecx, eax
|
|
|
|
|
shr al, 4
|
|
|
|
|
and ax, 0x0F0F
|
|
|
|
|
mov [CPU_fam], ah
|
|
|
|
|
mov [CPU_mod], al
|
2019-08-23 23:12:13 +03:00
|
|
|
|
mov eax, ecx
|
|
|
|
|
shr eax, 12
|
|
|
|
|
and eax, 0x0FFF0 ; Extended Family/Model bits
|
|
|
|
|
or [CPU_mod], al
|
|
|
|
|
mov al, [CPU_fam] ; will not work on AMD fam.20h -- fix it later!!
|
|
|
|
|
cmp al, 0x0F
|
|
|
|
|
jne @f
|
|
|
|
|
add [CPU_fam], ah
|
|
|
|
|
@@:
|
2006-11-02 17:18:23 +03:00
|
|
|
|
shr edx, 23
|
|
|
|
|
and dl, 1
|
|
|
|
|
mov [CPU_mmx], dl
|
|
|
|
|
shr ecx, 12
|
|
|
|
|
and cl, 11b
|
|
|
|
|
mov [CPU_type], cl
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; ! Цвета из массива colors
|
|
|
|
|
mov dword[d_cpu_load], 0xFF00 ; инициализируем график загрузки АЛУ
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov dword[d_mem_usage], 0x8BA169 ; -- mem usega
|
2016-03-16 22:35:22 +03:00
|
|
|
|
mov dword[d_temp1], 0xFF0000 ; -- график температуры ЦПУ
|
|
|
|
|
mov dword[d_temp2], 0xFF ; -- график температуры МП
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov dword[d_temp3], 0xFF7E23
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
call hwm_init ; Initialize monitoring chip
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
jmp draw_window
|
|
|
|
|
;--- Wait & translate event ------------------------------------------
|
|
|
|
|
wait_for_event:
|
2016-03-16 22:35:22 +03:00
|
|
|
|
mov byte[diag_add_v], 0 ; добавляем данные к графику только по таймеру
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov ebx, [update_time]
|
|
|
|
|
mov eax, 23
|
|
|
|
|
int 0x40
|
|
|
|
|
test eax, eax
|
|
|
|
|
jnz @f
|
|
|
|
|
inc byte [diag_add_v]
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw
|
2006-11-02 17:18:23 +03:00
|
|
|
|
@@: dec eax ; redraw request ?
|
|
|
|
|
jz draw_window
|
|
|
|
|
dec eax ; key in buffer ?
|
|
|
|
|
jz key
|
|
|
|
|
dec eax ; button in buffer ?
|
|
|
|
|
jz button
|
|
|
|
|
jmp wait_for_event
|
|
|
|
|
;--- Key pressed -----------------------------------------------------
|
|
|
|
|
key:
|
|
|
|
|
mov eax, 2
|
|
|
|
|
int 0x40
|
2016-03-16 22:35:22 +03:00
|
|
|
|
cmp ah, 27 ; Esc - shutdown
|
2006-11-02 17:18:23 +03:00
|
|
|
|
je exit
|
|
|
|
|
jmp wait_for_event
|
|
|
|
|
;--- Button down -----------------------------------------------------
|
|
|
|
|
button:
|
2015-12-09 00:56:29 +03:00
|
|
|
|
mov eax, 17 ; get id
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
|
|
|
|
cmp ah, 1 ; button id == 1 ?
|
|
|
|
|
jne noexit
|
|
|
|
|
exit: cmp byte[test_id], 0
|
|
|
|
|
je @f
|
|
|
|
|
call stop_test
|
2015-12-09 00:56:29 +03:00
|
|
|
|
@@: mov eax, -1 ; close this program
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
|
|
|
|
noexit:
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; button tabs (2 .. 5)
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp ah, 5
|
|
|
|
|
jg no_tabs
|
|
|
|
|
mov byte[act_tab], ah
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw_tabs
|
2006-11-02 17:18:23 +03:00
|
|
|
|
no_tabs:
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; кнопки запуска тество (6 .. 10)
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp ah, 10
|
|
|
|
|
jg no_test_bt
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; если нет запущеных тестов - запускаем выбранный
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp byte[test_id], 0
|
|
|
|
|
je run_test
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; если кнопка активного теста - останавливаем тест, иначе ничего не делаем
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp [test_id], ah
|
|
|
|
|
jne wait_for_event
|
|
|
|
|
call stop_test
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw_tabs
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
tsts: dd p5, p6, k6_, k7_
|
2006-11-02 17:18:23 +03:00
|
|
|
|
run_test:
|
|
|
|
|
push eax
|
|
|
|
|
movzx ecx, ah
|
|
|
|
|
mov ecx, [tsts + (ecx * 4) - (6 * 4)]
|
|
|
|
|
rtst: mov eax, 51
|
|
|
|
|
mov edx, stp
|
|
|
|
|
mov ebx, 1
|
|
|
|
|
int 0x40
|
2015-12-09 00:56:29 +03:00
|
|
|
|
cmp eax, 0xFFFFFFF0 ; -16
|
2016-03-16 22:35:22 +03:00
|
|
|
|
je wait_for_event ; <-- ошибка запуска теста, ПЕРЕПИСАТЬ
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov [test_pid], eax
|
|
|
|
|
pop eax
|
|
|
|
|
mov byte [test_id], ah
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw_tabs
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;-------------------------
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; кнопки изменения времени обновления
|
2006-11-02 17:18:23 +03:00
|
|
|
|
no_test_bt:
|
|
|
|
|
cmp ah, 11
|
|
|
|
|
jne no_ut_inc
|
|
|
|
|
add dword[update_time], 10
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw_tabs
|
2006-11-02 17:18:23 +03:00
|
|
|
|
no_ut_inc:
|
|
|
|
|
cmp ah, 12
|
|
|
|
|
jne no_ut_dec
|
|
|
|
|
cmp dword[update_time], 10
|
|
|
|
|
jng wait_for_event
|
|
|
|
|
sub dword[update_time], 10
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw_tabs
|
2006-11-02 17:18:23 +03:00
|
|
|
|
no_ut_dec:
|
|
|
|
|
;-------------------------
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; color change button schedules (13..17)
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp ah, 17
|
|
|
|
|
jg no_change_color
|
|
|
|
|
sub ah, 13
|
|
|
|
|
movzx ecx, ah
|
|
|
|
|
mov esi, [d_colors + ecx * 4]
|
|
|
|
|
mov eax, [esi]
|
2016-03-16 22:35:22 +03:00
|
|
|
|
mov ecx, (colors_end - colors) / 4 ; number of colors
|
2006-11-02 17:18:23 +03:00
|
|
|
|
@@: dec ecx
|
|
|
|
|
cmp eax, [colors + ecx * 4]
|
|
|
|
|
jne @b
|
|
|
|
|
mov ebx, [colors + ecx * 4 - 4]
|
2006-11-28 18:54:36 +03:00
|
|
|
|
mov [esi], ebx
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp redraw_tabs
|
2006-11-28 18:54:36 +03:00
|
|
|
|
no_change_color:
|
|
|
|
|
jmp wait_for_event
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
draw_window:
|
|
|
|
|
mov eax,12
|
|
|
|
|
mov ebx,1
|
|
|
|
|
int 0x40
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Создаём окно
|
2006-11-02 17:18:23 +03:00
|
|
|
|
xor eax, eax
|
|
|
|
|
mov ebx, 300 * 65536 + 309
|
2006-11-28 18:54:36 +03:00
|
|
|
|
mov ecx, 150 * 65536 + 450
|
2007-06-23 00:24:06 +04:00
|
|
|
|
mov edx, tcol + 0x14000000 ; color of work area RRGGBB,8->color
|
2007-02-12 04:06:46 +03:00
|
|
|
|
mov edi, title ; color of frames RRGGBB
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Create a graphic frame (not for graph)
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov eax, 13
|
|
|
|
|
mov ebx, 10 * 65536 + 290
|
2006-11-28 18:54:36 +03:00
|
|
|
|
mov ecx, 138 * 65536 + 105
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov edx, atcol
|
|
|
|
|
int 0x40
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; write parameter names (Cpu load, temper, etc ...)
|
2019-08-23 23:12:13 +03:00
|
|
|
|
mov edx, msgs_mon ; text for indicators
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov ebx, 17 * 65536 + 30
|
2019-08-23 23:12:13 +03:00
|
|
|
|
call show_text
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov edx, msgs_mon2
|
2016-03-16 22:35:22 +03:00
|
|
|
|
mov ebx, 166 * 65536 + 30
|
2006-11-02 17:18:23 +03:00
|
|
|
|
call show_text
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp draw_tabs ; draw tabs for the first time
|
|
|
|
|
|
|
|
|
|
redraw_tabs: ; delete previously created tabs
|
|
|
|
|
|
|
|
|
|
mov ecx, 4
|
|
|
|
|
mov eax, 8
|
|
|
|
|
mov edx, 0x80000000 + 2
|
|
|
|
|
del_tabs:
|
|
|
|
|
int 0x40
|
|
|
|
|
inc edx
|
|
|
|
|
loop del_tabs
|
|
|
|
|
|
|
|
|
|
; Delete color change buttons
|
|
|
|
|
mov eax, 8
|
|
|
|
|
mov edx, 0x80000000 + 13
|
|
|
|
|
@@:
|
|
|
|
|
int 0x40
|
|
|
|
|
inc edx
|
2019-08-23 23:12:13 +03:00
|
|
|
|
cmp edx, 0x80000000 + 13 + 5 ; 5 (buttons)
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jne @b
|
|
|
|
|
|
|
|
|
|
draw_tabs:
|
|
|
|
|
|
|
|
|
|
; Drawing color change buttons
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov eax, 8
|
|
|
|
|
mov ebx, 112 * 65536 + 5
|
|
|
|
|
mov ecx, 30 * 65536 + 6
|
|
|
|
|
mov edx, 13
|
2016-03-16 22:35:22 +03:00
|
|
|
|
|
|
|
|
|
@@:
|
|
|
|
|
mov esi, [d_colors - 13 * 4 + edx * 4]
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov esi, [esi]
|
|
|
|
|
int 0x40
|
|
|
|
|
add ecx, 10 * 65536
|
|
|
|
|
inc edx
|
2019-08-23 23:12:13 +03:00
|
|
|
|
cmp edx, 13 + 5 ; 5 (buttons)
|
2006-11-02 17:18:23 +03:00
|
|
|
|
jne @b
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; info, test, config, about buttons
|
|
|
|
|
; Create 4 buttons
|
|
|
|
|
mov edi, 250 * 65536 + 25
|
|
|
|
|
mov ecx, 4
|
|
|
|
|
mov eax, 8
|
|
|
|
|
mov ebx, 10 * 65536 + 70
|
|
|
|
|
mov edx, 2
|
2019-08-23 23:12:13 +03:00
|
|
|
|
n_bt:
|
|
|
|
|
push ecx
|
2016-03-16 22:35:22 +03:00
|
|
|
|
mov ecx, edi
|
|
|
|
|
mov esi, tcol
|
|
|
|
|
cmp byte [act_tab], dl
|
|
|
|
|
jne na1
|
|
|
|
|
mov esi, atcol
|
2019-08-23 23:12:13 +03:00
|
|
|
|
na1:
|
2016-03-16 22:35:22 +03:00
|
|
|
|
int 0x40
|
|
|
|
|
inc edx
|
|
|
|
|
add ebx, 73 * 65536
|
|
|
|
|
pop ecx
|
2019-08-23 23:12:13 +03:00
|
|
|
|
loop n_bt
|
2016-03-16 22:35:22 +03:00
|
|
|
|
|
|
|
|
|
; write name tabs
|
|
|
|
|
mov eax, 4
|
|
|
|
|
mov ebx, (18 shl 16) + 256
|
|
|
|
|
mov edx, tab_lab
|
|
|
|
|
mov ecx, 0x10000000
|
|
|
|
|
mov esi, 4
|
|
|
|
|
int 0x40
|
|
|
|
|
add ebx, (72 shl 16)
|
|
|
|
|
mov edx, tab_lab.2
|
|
|
|
|
mov esi, 5
|
|
|
|
|
int 0x40
|
|
|
|
|
add ebx, (72 shl 16)
|
|
|
|
|
mov edx, tab_lab.3
|
|
|
|
|
mov esi, 7
|
|
|
|
|
int 0x40
|
|
|
|
|
add ebx, (72 shl 16)
|
|
|
|
|
mov edx, tab_lab.4
|
|
|
|
|
mov esi, 5
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
; create a frame at the bottom of the screen
|
|
|
|
|
mov eax, 13
|
|
|
|
|
mov ebx, 10 * 65536 + 290
|
|
|
|
|
mov ecx, 275 * 65536 + 160
|
|
|
|
|
mov edx, atcol
|
|
|
|
|
int 0x40
|
|
|
|
|
mov ebx, 12 * 65536 + 286
|
|
|
|
|
mov ecx, 277 * 65536 + 156
|
|
|
|
|
mov edx, tcol
|
|
|
|
|
int 0x40
|
|
|
|
|
|
|
|
|
|
; draw the selected tab
|
|
|
|
|
mov al, [act_tab]
|
|
|
|
|
cmp al, 2
|
2019-08-23 23:12:13 +03:00
|
|
|
|
je info_tab
|
2016-03-16 22:35:22 +03:00
|
|
|
|
cmp al, 3
|
2019-08-23 23:12:13 +03:00
|
|
|
|
je test_tab
|
2016-03-16 22:35:22 +03:00
|
|
|
|
cmp al, 4
|
2019-08-23 23:12:13 +03:00
|
|
|
|
je config_tab
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jmp about_tab
|
|
|
|
|
|
|
|
|
|
;--- Drow Info tab ---------------
|
|
|
|
|
info_tab:
|
2019-08-23 23:12:13 +03:00
|
|
|
|
include "tab_info.inc"
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;--- Drow test tab ---------------
|
|
|
|
|
test_tab:
|
2019-08-23 23:12:13 +03:00
|
|
|
|
include "tab_test.inc"
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;--- Drow Config tab -------------
|
|
|
|
|
config_tab:
|
2019-08-23 23:12:13 +03:00
|
|
|
|
include "tab_conf.inc"
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;--- Drow About tab --------------
|
|
|
|
|
about_tab:
|
2019-08-23 23:12:13 +03:00
|
|
|
|
include "tab_about.inc"
|
2016-03-16 22:35:22 +03:00
|
|
|
|
|
|
|
|
|
redraw:
|
|
|
|
|
|
|
|
|
|
; frame for graph
|
|
|
|
|
|
|
|
|
|
mov eax, 13
|
|
|
|
|
mov ebx, 12 * 65536 + 286
|
|
|
|
|
mov ecx, 140 * 65536 + 101
|
|
|
|
|
mov edx, tcol
|
|
|
|
|
int 0x40
|
|
|
|
|
mov eax, 38
|
|
|
|
|
mov edx, atcol
|
|
|
|
|
mov ebx, 12 * 65536 + 286 + 12
|
|
|
|
|
mov ecx, 140 * 65536 + 140
|
|
|
|
|
@@: add ecx, 10 * 65536 + 10
|
|
|
|
|
int 0x40
|
|
|
|
|
cmp cx, 230 ; привязано к координатам окна
|
|
|
|
|
jl @b
|
|
|
|
|
|
|
|
|
|
; write CPU usage
|
2019-08-23 23:12:13 +03:00
|
|
|
|
call cpu_usage
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;--- добавляем на график ---
|
|
|
|
|
mov esi, d_cpu_load
|
2019-08-23 23:12:13 +03:00
|
|
|
|
call d_add
|
|
|
|
|
call d_show
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;---------------------------
|
|
|
|
|
movzx ecx, al
|
|
|
|
|
mov eax, 47
|
|
|
|
|
mov edx, 121 * 65536 + 30
|
|
|
|
|
xor esi, esi
|
|
|
|
|
call digit_len
|
2016-03-16 22:35:22 +03:00
|
|
|
|
clear_prev_no edx
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; write used memory
|
2006-11-02 17:18:23 +03:00
|
|
|
|
call mem_usage
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;--- добавляем на график ---
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov esi, d_mem_usage
|
|
|
|
|
call d_add
|
|
|
|
|
call d_show
|
|
|
|
|
;---------------------------
|
|
|
|
|
movzx ecx, al
|
|
|
|
|
mov eax, 47
|
|
|
|
|
mov edx, 121 * 65536 + 40
|
|
|
|
|
xor esi, esi
|
|
|
|
|
call digit_len
|
2016-03-16 22:35:22 +03:00
|
|
|
|
clear_prev_no edx
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp byte[hwm_enable], 0
|
|
|
|
|
jne show_mon
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Нет датчиков - пишем NO
|
|
|
|
|
mov ecx, 8 ;<- number of parameters
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov eax, 4
|
|
|
|
|
mov ebx, 121 * 65536 + 50
|
|
|
|
|
mov edx, msg_no
|
|
|
|
|
mov esi, 3
|
|
|
|
|
@@: int 0x40
|
|
|
|
|
add ebx, 10
|
|
|
|
|
loop @b
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
mov ecx, 7 ;<- number of parameters
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov ebx, 260 * 65536 + 30
|
|
|
|
|
@@: int 0x40
|
|
|
|
|
add ebx, 10
|
|
|
|
|
loop @b
|
|
|
|
|
|
|
|
|
|
jmp no_monitor
|
|
|
|
|
show_mon:
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;Есть датчики пишим инфу
|
2006-11-02 17:18:23 +03:00
|
|
|
|
call hwm_get_params
|
|
|
|
|
;---------------------------
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Температуру
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov ecx, 3
|
2006-11-28 18:54:36 +03:00
|
|
|
|
mov esi, hwm_temps
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov edx, 121 * 65536 + 50
|
|
|
|
|
xor eax, eax
|
|
|
|
|
sh_temp:push ecx
|
|
|
|
|
lodsw
|
|
|
|
|
push esi
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; реакция на изменения
|
2006-11-02 17:18:23 +03:00
|
|
|
|
xor esi, esi
|
|
|
|
|
cmp [old_t1 + ecx * 4 - 4], eax
|
|
|
|
|
je @f
|
|
|
|
|
mov [old_t1 + ecx * 4 - 4], eax
|
|
|
|
|
mov esi, val_mod
|
|
|
|
|
@@: movzx ecx, al
|
|
|
|
|
push eax
|
|
|
|
|
mov eax, 47
|
|
|
|
|
mov ebx, 0x20000
|
2016-03-16 22:35:22 +03:00
|
|
|
|
clear_prev_no edx
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
|
|
|
|
pop eax
|
|
|
|
|
mov cl, ah
|
|
|
|
|
mov eax, 47
|
|
|
|
|
mov ebx, 0x10000
|
|
|
|
|
add edx, 15 * 65536
|
|
|
|
|
int 0x40
|
|
|
|
|
sub edx, 15 * 65536 - 10
|
|
|
|
|
pop esi
|
|
|
|
|
pop ecx
|
|
|
|
|
loop sh_temp
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;;--- Add to the chart temp1 ---
|
2006-11-28 18:54:36 +03:00
|
|
|
|
movzx eax, word[hwm_temps]
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov esi, d_temp1
|
|
|
|
|
call d_add
|
|
|
|
|
call d_show
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;;--- Add to the chart temp2 ---
|
2006-11-28 18:54:36 +03:00
|
|
|
|
movzx eax, word[hwm_temps + 2]
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov esi, d_temp2
|
|
|
|
|
call d_add
|
|
|
|
|
call d_show
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;;--- Add to the chart temp3 ---
|
2006-11-28 18:54:36 +03:00
|
|
|
|
movzx eax, word[hwm_temps + 4]
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov esi, d_temp3
|
|
|
|
|
call d_add
|
|
|
|
|
call d_show
|
|
|
|
|
|
|
|
|
|
;---------------------------
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Скорости врашения вентилей
|
2006-11-28 18:54:36 +03:00
|
|
|
|
mov ecx, 5
|
|
|
|
|
mov esi, hwm_rpms
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov edx, 121 * 65536 + 80
|
2015-12-09 00:56:29 +03:00
|
|
|
|
sh_fan: push ecx
|
2006-11-02 17:18:23 +03:00
|
|
|
|
lodsd
|
|
|
|
|
push esi
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;реакция на изменения
|
2006-11-02 17:18:23 +03:00
|
|
|
|
xor esi, esi
|
|
|
|
|
cmp [old_f1 + ecx * 4 - 4], eax
|
|
|
|
|
je @f
|
|
|
|
|
mov [old_f1 + ecx * 4 - 4], eax
|
|
|
|
|
mov esi, val_mod
|
|
|
|
|
@@: mov ecx, eax
|
|
|
|
|
call digit_len
|
|
|
|
|
mov eax, 47
|
2016-03-16 22:35:22 +03:00
|
|
|
|
clear_prev_no edx
|
2006-11-02 17:18:23 +03:00
|
|
|
|
int 0x40
|
2013-06-05 09:47:25 +04:00
|
|
|
|
add edx, 10
|
2006-11-02 17:18:23 +03:00
|
|
|
|
pop esi
|
|
|
|
|
pop ecx
|
|
|
|
|
loop sh_fan
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;---------------------------
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Напруги
|
2006-11-28 18:54:36 +03:00
|
|
|
|
mov esi, hwm_voltages
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov edi, old_volts
|
|
|
|
|
mov ecx, 7
|
|
|
|
|
mov ebx, 260 * 65536 + 30
|
|
|
|
|
mov edx, Data_String
|
|
|
|
|
volt_nxt:
|
|
|
|
|
push ecx
|
|
|
|
|
push esi
|
|
|
|
|
call ftoa
|
2016-03-16 22:35:22 +03:00
|
|
|
|
;реакция на изменения
|
2006-11-02 17:18:23 +03:00
|
|
|
|
xor ecx, ecx
|
|
|
|
|
fld dword [esi]
|
|
|
|
|
fsub dword [edi]
|
|
|
|
|
fabs
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2019-08-23 23:12:13 +03:00
|
|
|
|
; fcomp dword [c_eps] ; bug in MeOsEmul
|
2015-12-09 00:56:29 +03:00
|
|
|
|
; fstsw ax
|
2006-11-02 17:18:23 +03:00
|
|
|
|
fcom dword [c_eps] ; 0xBADCODE
|
|
|
|
|
fstsw ax
|
2013-06-05 09:47:25 +04:00
|
|
|
|
finit
|
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
sahf
|
|
|
|
|
jc @f
|
|
|
|
|
mov ecx, val_mod
|
2016-03-16 22:35:22 +03:00
|
|
|
|
@@: mov esi, Data_String ; считаем кол-во символов
|
2006-11-02 17:18:23 +03:00
|
|
|
|
@@: lodsb
|
|
|
|
|
test al, al
|
|
|
|
|
jnz @b
|
|
|
|
|
sub esi, Data_String
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
mov eax, 4
|
|
|
|
|
int 0x40
|
|
|
|
|
add ebx, 10
|
|
|
|
|
pop esi
|
|
|
|
|
pop ecx
|
|
|
|
|
movsd
|
|
|
|
|
loop volt_nxt
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
no_monitor:
|
|
|
|
|
;---------------------------
|
2019-08-23 23:12:13 +03:00
|
|
|
|
mov al, [act_tab] ; check if info tab is active
|
2006-11-02 17:18:23 +03:00
|
|
|
|
cmp al, 2
|
2016-03-16 22:35:22 +03:00
|
|
|
|
jne end_drow_tab
|
|
|
|
|
jmp free_mem ; in tab_info.inc
|
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
end_drow_tab:
|
|
|
|
|
mov eax, 12
|
|
|
|
|
mov ebx, 2
|
|
|
|
|
int 0x40
|
|
|
|
|
jmp wait_for_event
|
|
|
|
|
;---------------------------------------------------------------------
|
2015-12-09 00:56:29 +03:00
|
|
|
|
include "system.inc"
|
2006-11-02 17:18:23 +03:00
|
|
|
|
include "hwm.inc"
|
|
|
|
|
include "diag.inc"
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
DATA
|
2016-03-16 22:35:22 +03:00
|
|
|
|
act_tab db 2 ; active tab number
|
2015-11-18 19:52:34 +03:00
|
|
|
|
tab_lab:
|
|
|
|
|
.1: db 'Info'
|
|
|
|
|
.2: db 'Tests'
|
2020-04-20 21:46:49 +03:00
|
|
|
|
.3: db 'Config'
|
2015-11-18 19:52:34 +03:00
|
|
|
|
.4: db 'About'
|
|
|
|
|
title db 'Ghost Monitor v0.4 [18/11/15]',0
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
|
|
|
|
msgs_mon mls \
|
|
|
|
|
'CPU Load (%)',\
|
|
|
|
|
'Mem Usage(%)',\
|
|
|
|
|
'Temp1',\
|
|
|
|
|
'Temp2',\
|
|
|
|
|
'Temp3',\
|
|
|
|
|
'Fan1',\
|
|
|
|
|
'Fan2',\
|
2006-11-28 18:54:36 +03:00
|
|
|
|
'Fan3',\
|
|
|
|
|
'Fan4',\
|
|
|
|
|
'Fan5'
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
msgs_mon2 mls \
|
|
|
|
|
'Vcore',\
|
|
|
|
|
'AGP',\
|
|
|
|
|
'+3.3V',\
|
|
|
|
|
'AVcc (+5V)',\
|
|
|
|
|
'+12V',\
|
|
|
|
|
'-12V',\
|
|
|
|
|
'-5V'
|
|
|
|
|
|
2015-12-09 00:56:29 +03:00
|
|
|
|
msg_yes db 'Yes'
|
2006-11-02 17:18:23 +03:00
|
|
|
|
msg_no db 'N/A'
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
update_time dd 300 ; период обновления в сотых долях секунды
|
2006-11-02 17:18:23 +03:00
|
|
|
|
d_colors dd d_cpu_load, d_mem_usage, d_temp1, d_temp2, d_temp3
|
|
|
|
|
c_eps dd 0.01
|
2006-11-28 18:54:36 +03:00
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Цвета графиков
|
|
|
|
|
colors: dd 0xff0000, 0xff00, 0xff, 0xffffff, tcol, 0xFF7E23, 0x8BA169, 0xff0000 ; первый и последний равны
|
2006-11-28 18:54:36 +03:00
|
|
|
|
colors_end:
|
2006-11-02 17:18:23 +03:00
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
UDATA
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
test_pid dd ? ; если test_id == 0 - не имеет смысла
|
|
|
|
|
test_id db ? ; 0 - тест не запушен (соответствует № кнопки 6..10)
|
|
|
|
|
diag_add_v db ? ; 0 - не добавлять данные на график, !0 - добавлять
|
2006-11-02 17:18:23 +03:00
|
|
|
|
|
2015-12-09 00:56:29 +03:00
|
|
|
|
Vendor: times 12 db ?
|
2006-11-02 17:18:23 +03:00
|
|
|
|
CPU_fam: db ?
|
|
|
|
|
CPU_mod: db ?
|
|
|
|
|
CPU_type: db ?
|
|
|
|
|
CPU_mmx: db ?
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Для реакции на изменения
|
|
|
|
|
old_t1: dd ? ; последнее значение temp1
|
2015-12-09 00:56:29 +03:00
|
|
|
|
old_t2: dd ? ; ...
|
|
|
|
|
old_t3: dd ?
|
|
|
|
|
old_f1: dd ?
|
|
|
|
|
old_f2: dd ?
|
|
|
|
|
old_f3: dd ?
|
2006-11-02 17:18:23 +03:00
|
|
|
|
old_volts: times 7 dd ?
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; Грфики
|
2006-11-02 17:18:23 +03:00
|
|
|
|
diag_beg:
|
|
|
|
|
d_cpu_load: dd ?
|
|
|
|
|
times 286 db ?
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
d_mem_usage: dd ?
|
|
|
|
|
times 286 db ?
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
d_temp1: dd ?
|
|
|
|
|
times 286 db ?
|
2013-06-05 09:47:25 +04:00
|
|
|
|
|
2006-11-02 17:18:23 +03:00
|
|
|
|
d_temp2: dd ?
|
|
|
|
|
times 286 db ?
|
|
|
|
|
|
|
|
|
|
d_temp3: dd ?
|
|
|
|
|
times 286 db ?
|
|
|
|
|
diag_end:
|
|
|
|
|
|
2016-03-16 22:35:22 +03:00
|
|
|
|
; --- стек теста, воизбежание глюков не переносить в другое место ----
|
2006-11-02 17:18:23 +03:00
|
|
|
|
th_stack: times 1024 db ?
|
|
|
|
|
stp:
|
|
|
|
|
;---------------------------------------------------------------------
|
|
|
|
|
MEOS_APP_END
|