AMDtemp: added creating file for program "Graph". To save this file, write the path to it as a parameter.

git-svn-id: svn://kolibrios.org@9771 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Doczom 2022-04-17 19:08:35 +00:00
parent 56fdad78b4
commit e7935a8fbd

View File

@ -7,7 +7,7 @@
dd I_END ; à §¬¥à ¯à®£à ¬¬ë dd I_END ; à §¬¥à ¯à®£à ¬¬ë
dd MEM ; ª®«¨ç¥á⢮ ¯ ¬ï⨠dd MEM ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
dd STACKTOP dd STACKTOP
dd 0 dd PATH
dd 0 dd 0
include '..\..\macros.inc' include '..\..\macros.inc'
include '..\..\KOSfuncs.inc' include '..\..\KOSfuncs.inc'
@ -19,10 +19,11 @@ START:
mcall SF_SYS_MISC, SSF_LOAD_DRIVER_PE, path_drv, 0 mcall SF_SYS_MISC, SSF_LOAD_DRIVER_PE, path_drv, 0
mov dword[drv_struct.handl],eax mov dword[drv_struct.handl],eax
test eax,eax ;ïðîâåðêà çàãðóçêè test eax,eax ;ïðîâåðêà çàãðóçêè
jnz main jz error_drv
jmp error_drv
main: main:
mcall SF_SYS_MISC, SSF_CONTROL_DRIVER, drv_struct mcall SF_SYS_MISC, SSF_CONTROL_DRIVER, drv_struct
cmp byte[PATH], 0
jz still
call add_file call add_file
still: ;void main() still: ;void main()
call draw call draw
@ -46,9 +47,11 @@ button:
jnz still jnz still
xor byte[flag_micro_info],1 xor byte[flag_micro_info],1
jmp still jmp still
align 4
draw: draw:
mcall SF_REDRAW, SSF_BEGIN_DRAW mcall SF_REDRAW, SSF_BEGIN_DRAW
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sc,sizeof.system_colors mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mov eax,SF_CREATE_WINDOW mov eax,SF_CREATE_WINDOW
mov ebx,0x00ff013f mov ebx,0x00ff013f
@ -60,8 +63,10 @@ draw:
mcall SF_SYS_MISC, SSF_CONTROL_DRIVER, drv_struct mcall SF_SYS_MISC, SSF_CONTROL_DRIVER, drv_struct
cmp byte[PATH], 0
jz @f
dec dword[update_flag] dec dword[update_flag]
jnz @F jnz @f
call add_new_item call add_new_item
mov dword[update_flag], 30 mov dword[update_flag], 30
@@: @@:
@ -251,6 +256,7 @@ draw:
;; ebx=pointer on value ;; ebx=pointer on value
;; ecx register don`t save ;; ecx register don`t save
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
align 4
write_data: write_data:
push eax push eax
push ebx push ebx
@ -345,10 +351,11 @@ error_drv:
exit: exit:
mcall SF_TERMINATE_PROCESS mcall SF_TERMINATE_PROCESS
align 4
add_file: add_file:
mcall SF_FILE, graph_temp mcall SF_FILE, graph_temp
mov dword[graph_temp], 3 mov dword[graph_temp], 3
mov dword[graph_temp.size], 11 mov dword[graph_temp.size], 10
mov dword[graph_temp.str], graph_start.new_data mov dword[graph_temp.str], graph_start.new_data
mov eax,[drv_data.Tmax] mov eax,[drv_data.Tmax]
mov dword[graph_temp.index], 9 mov dword[graph_temp.index], 9
@ -356,8 +363,10 @@ add_file:
call int_to_str call int_to_str
mcall SF_FILE, graph_temp mcall SF_FILE, graph_temp
mov dword[graph_temp.index], 20 mov dword[graph_temp.index], 19
mov dword[graph_temp.size], 20
ret ret
align 4
index_item: index_item:
dd 1 dd 1
add_new_item: add_new_item:
@ -365,20 +374,21 @@ add_new_item:
imul eax,1000 imul eax,1000
mov ebx, graph_start.new_data mov ebx, graph_start.new_data
call int_to_str call int_to_str
mcall SF_FILE, graph_temp mcall SF_FILE, graph_koord_x2 ;save x2=index_item
add dword[graph_temp.index], 11
inc dword[index_item] inc dword[index_item]
mov eax,[drv_data.Tctl] mov eax,[drv_data.Tctl]
mov ebx, graph_start.new_data mov ebx, graph_start.new_data_2
call int_to_str call int_to_str
mcall SF_FILE, graph_temp mcall SF_FILE, graph_temp
add dword[graph_temp.index], 11 add dword[graph_temp.index], 20
ret ret
;eax = int value / 1000 ;eax = int value / 1000
;ebx = *str ;ebx = *str
; èç çà êîíêðåòèêè äàííîãî ïðèëàæåíèÿ(à èìåííî èçìåðåíèå òåìïåðàòóðû ïðîöà), ñîìíèâàþñü ; èç çà êîíêðåòèêè äàííîãî ïðèëàæåíèÿ(à èìåííî èçìåðåíèå òåìïåðàòóðû ïðîöà), ñîìíèâàþñü
; ÷òî ïîòðåáóåòñÿ áîëüøå 3 öèôð íà çíà÷åíèå(õõõ.õõõ) òàê ÷òî áóäåò êîñòûëü ; ÷òî ïîòðåáóåòñÿ áîëüøå 3 öèôð íà çíà÷åíèå(õõõ.õõõ) òàê ÷òî áóäåò êîñòûëü
align 4
int_to_str: int_to_str:
push ecx edx esi push ecx edx esi
mov ecx, '0000' mov ecx, '0000'
@ -392,8 +402,8 @@ int_to_str:
mov esi, 10 mov esi, 10
push ebx push ebx
add ebx, 3 add ebx, 3
.loop:
and eax, 0x3ff ; 1023 and eax, 0x3ff ; 1023
.loop:
test eax, eax test eax, eax
jz @f jz @f
xor edx, edx xor edx, edx
@ -406,8 +416,6 @@ int_to_str:
pop ebx pop ebx
add ebx, 8;4 add ebx, 8;4
pop edx pop edx
;mov byte[ebx],'.'
;add ebx, 4
test edx, edx test edx, edx
jz @f jz @f
mov eax, edx mov eax, edx
@ -464,6 +472,7 @@ drv_data:
.Tcrit_hyst dd -1 .Tcrit_hyst dd -1
.sizeof = $ - drv_data ; .sizeof = $ - drv_data ;
align 4
drv_struct: drv_struct:
.handl dd 0 .handl dd 0
dd 0 dd 0
@ -471,7 +480,7 @@ drv_struct:
dd 0 dd 0
dd drv_data dd drv_data
dd drv_data.sizeof;52 ; 13*4 dd drv_data.sizeof;52 ; 13*4
align 4
run_notify: run_notify:
dd 7 dd 7
dd 0 dd 0
@ -480,17 +489,33 @@ run_notify:
dd 0 dd 0
db '/sys/@notify',0 ,0,0,0 ;âûðàâíèâàíèå db '/sys/@notify',0 ,0,0,0 ;âûðàâíèâàíèå
align 4
update_flag: dd 30 ;1 minut update_flag: dd 30 ;1 minut
graph_start: db '0 1000 0 ' ; 9 byte graph_start: db '0 0000 0 ' ; 9 byte
.new_data: db '0000.0000 ' ; 10-20 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_temp: graph_temp:
dd 2 dd 2
.index: dd 0 .index: dd 0
dd 0 dd 0
.size: dd 20 ; .size: dd 19 ;size 4 first value for Graph
.str: dd graph_start ; çàìåíèòü .str: dd graph_start ; çàìåíèòü
db '/tmp0/1/graph_temp.txt',0,0 ; âûðàâíèâàíèå db 0
dd PATH
align 4
graph_koord_x2:
dd 3
dd 2 ;index for rewrite 2 value
dd 0
dd 4
dd graph_start.new_data ; çàìåíèòü
db 0
dd PATH
align 4
PATH:
rb 512 ; buffer for command line. string for save log.
sc system_colors sc system_colors
I_END: I_END:
rd 256 rd 256