1,4 → 1,4 |
;; Copyright (C) 2021-2022, Michael Frolov aka Doczom |
;; Copyright (C) 2021-2022, Michail Frolov aka Doczom |
|
macro send_notify send_str{ |
mov dword[run_notify.message], send_str |
22,7 → 22,7 |
include '..\..\KOSfuncs.inc' |
include '..\..\dll.inc' |
|
include 'parser.inc' |
; include 'parser.inc' ; this modul does not work |
START: |
;init heap |
mcall 68, 11 |
35,11 → 35,10 |
; init futex |
mcall SF_FUTEX, SSF_CREATE, futex_cmd |
mov [futex_handle], eax |
; parse cmd_line |
cmp byte[PATH], 0 |
jz @f |
call parse_cmd |
@@: |
; parse cmd_line TODO: fix parser and testing |
;call pars_cmd |
;test eax, eax |
;jnz exit |
;;óñòàíîâêà ìàñêà ñîáûòèé íà ïîëó÷åíèå ïåðåïèñîâêè è íàæàòèÿ íà êíîïêó |
mcall SF_SET_EVENTS_MASK, 0x05 |
;load driver |
49,12 → 48,9 |
jz error_drv |
main: |
mcall SF_SYS_MISC, SSF_CONTROL_DRIVER, drv_struct |
cmp dword[save_ptr], 0 |
cmp byte[PATH], 0 |
jz still |
mcall 51, 1, thread_auto_save, thread_auto_save.stack |
cmp eax, -1 |
jz still |
mov dword[PID_AUTO_SAVE], eax |
;call add_file |
still: ;void main() |
call draw |
;;îæèäàíèå ñîáûòèÿ â òå÷åíèè 2000ìñ |
186,7 → 182,7 |
cmp byte[flag_micro_info], 1 |
mov eax, SF_CHANGE_WINDOW |
mov ebx, -1 |
mov ecx, ebx |
mov ecx,ebx;-1 |
jz draw.micro |
|
mov esi,0x00000115 ; link with 58 line |
390,7 → 386,7 |
mov esi, [sc.work_button] |
mcall |
|
mov eax, SF_DRAW_TEXT |
mov eax,SF_DRAW_TEXT;4 |
mov ebx, 0x000a0020 |
mov ecx, 0x90000000 |
add ecx, [sc.work_text] |
559,7 → 555,6 |
mcall SF_FUTEX, SSF_DESTROY, [futex_handle] |
mcall 68, 13, [log_ptr] ; free page |
|
mcall 18, 18, dword[PID_AUTO_SAVE] |
mcall SF_TERMINATE_PROCESS |
|
err_load_lib: |
659,14 → 654,14 |
movsd |
movsd |
|
cmp dword[save_ptr], 0 |
jz .no_save_mode |
push dword[log_path] |
mov eax, [save_ptr] |
mov [log_path], eax |
mcall 70, file_log |
pop dword[log_path] |
.no_save_mode: |
; cmp dword[save_file], 0 |
; jnz .no_save_mode |
; push dword[log_path] |
; mov eax, [save_ptr] |
; mov [log_path], eax |
; mcall 70, file_log |
; pop dword[log_path] |
;.no_save_mode: |
jmp @b |
.err_alloc_2: |
send_notify Error_text.alloc_2 |
680,51 → 675,6 |
.exit: |
mov byte[futex_cmd], 0x00 |
mcall -1 |
|
thread_auto_save: |
mcall 40, 0 ;clear event mask |
;calculate first data in file(4 value border graphic) |
mov eax,[drv_data.Tmax] |
mov ebx, graph_start_1.new_data |
call int_to_str |
;create file |
mcall 70, .file |
mov dword[.file], 3 |
mov dword[.log_size], 20 |
mov dword[.log_offset], 19 |
mov dword[.log_ptr], graph_start_1.new_data |
@@: |
mcall 5, 100*60 |
; add new item in file |
push dword[.log_offset] |
mov dword[.log_size], 4 |
mov dword[.log_offset], 2 |
mov eax,[.index_item] |
imul eax,1000 |
mov ebx, graph_start_1.new_data |
call int_to_str |
mcall SF_FILE, .file |
inc dword[.index_item] |
pop dword[.log_offset] |
mov dword[.log_size], 20 |
; get string y koord |
mov eax,[drv_data.Tctl] |
mov ebx, graph_start_1.new_data_2 |
call int_to_str |
mcall SF_FILE, .file |
add dword[.log_offset], 20 |
jmp @b |
mcall -1 |
.index_item: dd 1 |
.file: |
dd 2 |
.log_offset: dd 0 |
dd 0 |
.log_size: dd 19 |
.log_ptr: dd graph_start_1 |
db 0 |
save_ptr: dd 0 ; pointer to save file or zero |
PID_AUTO_SAVE: dd 0 ; for break this thread |
;Data_program; |
title db 'AMDtemp',0 |
path_drv db '/kolibrios/drivers/sensors/k10temp.sys',0 |
775,6 → 725,8 |
futex_handle: dd 0 |
futex_cmd: dd 0 ;1- stop 2 - save in file & no exit 3 - save in file & exit |
|
;save_file: db 0 ; 0 - no 1 - save ïî ñòàðèíêå |
;save_ptr: dd 0 ; pointer to save file |
drv_ptr: dd path_drv ; pointer to path on driver |
|
frame_text_1: db 'General info',0 |
847,10 → 799,6 |
dd 0 |
db '/sys/@notify',0 |
align 4 |
graph_start_1: db '0 0000 0 ' ; 9 byte |
.new_data: db '0000.0000 ' ; 10-19 byte 10 byte |
.new_data_2: db '0000.0000 ' ; 20-29 byte 10 byte |
align 4 |
graph_start: db '0 0000 0 ' ; 9 byte |
.new_data: db '0000.0000 ' ; 10-19 byte 10 byte |
.new_data_2: db '0000.0000 ' ; 20-29 byte 10 byte |
908,8 → 856,6 |
|
rb 512 ; 512 byte for stack |
thread_timer.stack: |
rb 512 ; 512 byte for stack |
thread_auto_save.stack: |
;rb 1024 |
procinfo process_information |
openfile_path: |