1) Code refactoring and optimization.
2) Added russian language support.
3) Fix - processes information showing not been updated during the processing of mouse events.

git-svn-id: svn://kolibrios.org@2559 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2012-04-04 01:08:20 +00:00
parent 0c7a85b009
commit 9d73147338
5 changed files with 475 additions and 590 deletions

View File

@ -1,5 +1,6 @@
@erase lang.inc @erase lang.inc
@echo lang fix en >lang.inc @echo lang fix en >lang.inc
@fasm cpu.asm cpu @fasm -m 16384 cpu.asm cpu
@kpack cpu
@erase lang.inc @erase lang.inc
@pause @pause

View File

@ -1,5 +1,6 @@
@erase lang.inc @erase lang.inc
@echo lang fix et >lang.inc @echo lang fix et >lang.inc
@fasm cpu.asm cpu @fasm -m 16384 cpu.asm cpu
@kpack cpu
@erase lang.inc @erase lang.inc
@pause @pause

View File

@ -1,5 +1,6 @@
@erase lang.inc @erase lang.inc
@echo lang fix de >lang.inc @echo lang fix de >lang.inc
@fasm cpu.asm cpu @fasm -m 16384 cpu.asm cpu
@kpack cpu
@erase lang.inc @erase lang.inc
@pause @pause

View File

@ -0,0 +1,6 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm -m 16384 cpu.asm cpu
@kpack cpu
@erase lang.inc
@pause

View File

@ -1,86 +1,149 @@
; ;
; PROCESS MANAGEMENT ; CPU -process Manager
; ;
; VTurjanmaa ;------------------------------------------------------------------------------
; additions by M.Lisovin lisovin@26.ru ; version: 1.70
; last update: 04/04/2012
; changed by: Marat Zakiyanov aka Mario79, aka Mario
; changes: Code refactoring and optimization.
; Added russian language support.
; Fix - processes information showing not been updated during
; the processing of mouse events.
;------------------------------------------------------------------------------
; Many fix's and changes created by:
; Diamond, Heavyiron, SPraid, <Lrz>,
; Leency, IgorA, kaitz
;---------------------------------------------------------------------
; integrated with load_lib.obj by <Lrz> ; integrated with load_lib.obj by <Lrz>
; Compile with FASM for Menuet ;---------------------------------------------------------------------
; ; additions by M.Lisovin lisovin@26.ru
;---------------------------------------------------------------------
; original author - VTurjanmaa
;------------------------------------------------------------------------------
use32 use32
org 0x0 org 0x0
STACK_SIZE=1024
offset_y=22 ; Correction for skin
offset_x=5
db 'MENUET01' ; 8 byte id db 'MENUET01' ; 8 byte id
dd 0x01 ; header version dd 0x01 ; header version
dd START ; start of code dd START ; start of code
dd I_END ; size of image dd IM_END ; size of image
dd U_END+STACK_SIZE ; memory for app dd U_END ; memory for app
dd U_END+STACK_SIZE ; esp dd stack_area ; esp
dd 0x0 , 0x0 ; I_Param , I_Icon dd 0x0 ; boot parameters
dd 0x0 ; path
;------------------------------------------------------------------------------
include 'lang.inc' include 'lang.inc'
include '../../../macros.inc' include '../../../macros.inc'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../develop/libraries/box_lib/load_lib.mac' include '../../../develop/libraries/box_lib/load_lib.mac'
;------------------------------------------------------------------------------
display_processes=32 ; number of processes to show display_processes=32 ; number of processes to show
window_x_size=524
window_y_size=430
;------------------------------------------------------------------------------
@use_library ;use load lib macros @use_library ;use load lib macros
;------------------------------------------------------------------------------
START: ; start of execution START: ; start of execution
mcall 68,11
sys_load_library library_name, cur_dir_path, library_path, system_path, \ sys_load_library library_name, cur_dir_path, library_path, system_path, \
err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i err_message_found_lib, head_f_l, myimport, err_message_import, head_f_i
inc eax inc eax
jz close jz close
; calculate window position ;------------------------------------------------------------------------------
; at the center of the screen
mcall 40,0x27 ;set event mcall 40,0x27 ;set event
call calculate_window_pos ;------------------------------------------------------------------------------
;set window size and position for 0 function
;main loop when process name isn't edited. ;to [winxpos] and [winypos] variables
red: ;get screen size
mcall 14
mov ebx,eax
;calculate (x_screen-window_x_size)/2
shr ebx,16+1
sub ebx,window_x_size/2
shl ebx,16
mov bx,window_x_size
;winxpos=xcoord*65536+xsize
mov [winxpos],ebx
;calculate (y_screen-window_y_size)/2
and eax,0xffff
shr eax,1
sub eax,window_y_size/2
shl eax,16
mov ax,window_y_size
;winypos=ycoord*65536+ysize
mov [winypos],eax
;------------------------------------------------------------------------------
mcall 48,3,sc,40 mcall 48,3,sc,40
edit_boxes_set_sys_color edit1,edit1_end,sc ;set color edit_boxes_set_sys_color edit1,edit1_end,sc ;set color
check_boxes_set_sys_color check1,check1_end,sc ;set color check_boxes_set_sys_color check1,check1_end,sc ;set color
xor ebp,ebp ;------------------------------------------------------------------------------
inc ebp align 4
; mov ebp,1 ;main loop when process name isn't edited.
red:
call draw_window ; redraw all window call draw_window ; redraw all window
;------------------------------------------------------------------------------
align 4
still: still:
mcall 23,100 ; wait here for event 1 sec. mcall 23,100 ; wait here for event 1 sec.
dec eax ; redraw request ? dec eax ; redraw request ?
jz red jz red
dec eax ; key in buffer ? dec eax ; key in buffer ?
jz key jz key
dec eax ; button in buffer ? dec eax ; button in buffer ?
jz button jz button
sub eax,3 ; If not use mouse - show ; sub eax,3 ; If not use mouse - show
jnz still_end ; jnz still_end
push dword edit1 push dword edit1
call [edit_box_mouse] call [edit_box_mouse]
push dword[check1+32] push dword[check1+32]
push dword check1 push dword check1
call [check_box_mouse] call [check_box_mouse]
pop eax pop eax
cmp eax, dword[check1+32] cmp eax, dword[check1+32]
jnz still_end jz still_end
jmp still
push dword check1
call [check_box_draw]
;--------------------------------------
align 4
show_process_info_1:
mcall 26,9
add eax,100
mov [time_counter],eax
call show_process_info ; draw new state of processes
jmp still
;------------------------------------------------------------------------------
align 4
still_end: still_end:
xor ebp,ebp ; draw new state of processes mcall 26,9
call draw_window cmp [time_counter],eax
ja still
add eax,100
mov [time_counter],eax
call show_process_info ; draw new state of processes
jmp still jmp still
;------------------------------------------------------------------------------
align 4
key: ; key key: ; key
mcall 2 mcall 2
cmp ah,184 ; PageUp cmp ah,184 ; PageUp
jz pgdn jz pgdn
cmp ah,183 cmp ah,183
jz pgup ; PageDown jz pgup ; PageDown
cmp ah,27 cmp ah,27
jz close ; Esc jz close ; Esc
@ -90,86 +153,85 @@ still_end:
lea edi,[edit1] lea edi,[edit1]
test word ed_flags,ed_focus test word ed_flags,ed_focus
jz still_end jz still_end
sub ah,13 ; ENTER? sub ah,13 ; ENTER?
jz program_start ; RUN a program jz program_start ; RUN a program
jmp still jmp still
;------------------------------------------------------------------------------
align 4
button: button:
; get button id ; get button id
mov eax,17 mcall 17
mcall
shr eax,8 shr eax,8
;id in [10,50] corresponds to terminate buttons. ;id in [10,50] corresponds to terminate buttons.
cmp eax,10 cmp eax,10
jb noterm jb noterm
cmp eax,50 cmp eax,50
jg noterm jg noterm
;calculate button index ;calculate button index
sub eax,11 sub eax,11
;calculate process slot ;calculate process slot
mov ecx,[tasklist+4*eax] mov ecx,[tasklist+4*eax]
;ignore empty buttons ;ignore empty buttons
test ecx,ecx test ecx,ecx
jle still_end jle still_end
;terminate application ;terminate application
mov eax,18 mcall 18,2
mov ebx,2 jmp show_process_info_1 ;still_end
mcall ;--------------------------------------
jmp still_end align 4
noterm: noterm:
;special buttons ;special buttons
dec eax dec eax
jz close jz close
sub eax,50 sub eax,50
jz pgdn ;51 jz pgdn ;51
dec eax dec eax
jz pgup ;52 jz pgup ;52
; dec eax
; jz read_string
dec eax dec eax
jz program_start ;53 jz program_start ;53
dec eax dec eax
jz reboot ;54 jz reboot ;54
jmp still_end jmp still_end
;buttons handlers ;buttons handlers
;------------------------------------------------------------------------------
align 4
pgdn: pgdn:
sub [list_start],display_processes sub [list_start],display_processes
; cmp [list_start],0 ; cmp [list_start],0
jge still_end jge show_process_info_1 ;still_end
mov [list_start],0 mov [list_start],0
jmp still_end jmp show_process_info_1 ;still_end
;------------------------------------------------------------------------------
align 4
pgup: pgup:
mov eax,[list_add] ;maximal displayed process slot mov eax,[list_add] ;maximal displayed process slot
mov [list_start],eax mov [list_start],eax
jmp still_end jmp show_process_info_1 ;still_end
;------------------------------------------------------------------------------
align 4
program_start: program_start:
mov eax,70 mcall 70,file_start
mov ebx,file_start jmp show_process_info_1 ;still_end
mcall ;------------------------------------------------------------------------------
jmp still_end align 4
reboot: reboot:
mov eax,70 mcall 70,sys_reboot
mov ebx,sys_reboot
mcall
;close program if we going to reboot ;close program if we going to reboot
;------------------------------------------------------------------------------
align 4
close: close:
or eax,-1 ; close this program or eax,-1 ; close this program
mcall mcall
;------------------------------------------------------------------------------
align 4
draw_next_process: draw_next_process:
;input: ;input:
; edi - current slot ; edi - current slot
@ -177,22 +239,12 @@ draw_next_process:
;output: ;output:
; edi - next slot (or -1 if no next slot) ; edi - next slot (or -1 if no next slot)
;registers corrupted! ;registers corrupted!
;create button
test ebp,ebp
jnz .nodelete
;delete old button ;delete old button
mov eax,8
mov edx,[index] mov edx,[index]
add edx,(1 shl 31)+11 add edx,(1 shl 31)+11
mcall mcall 8
.nodelete:
;create terminate process button ;create terminate process button
mov eax,8
mov ebx,(15-offset_x)*65536+121-offset_y
mov ecx,[curposy] mov ecx,[curposy]
;sub ecx,1
shl ecx,16 shl ecx,16
mov cx,10 mov cx,10
mov edx,[index] mov edx,[index]
@ -202,63 +254,58 @@ draw_next_process:
test dword [index],1 test dword [index],1
jz .change_color_button jz .change_color_button
mov esi,0x8899aa mov esi,0x8899aa
;--------------------------------------
align 4
.change_color_button: .change_color_button:
mcall mcall ,<10,99>
;draw background for proccess information ;draw background for proccess information
mov eax,13
mov ebx,(115-offset_x)*65536+395
; ecx was already set ; ecx was already set
mov edx,0x88ff88 mov edx,0x88ff88
;contrast ;contrast
test dword [index],1 test dword [index],1
jz .change_color_info jz .change_color_info
mov edx,0xddffdd mov edx,0xddffdd
;--------------------------------------
align 4
.change_color_info: .change_color_info:
mcall mcall 13,<110,395>
;nothing else should be done ;nothing else should be done
;if there is no process for this button ;if there is no process for this button
test edi,edi test edi,edi
jl .ret jl .ret
;--------------------------------------
;find process align 4
.return_1: .return_1:
;find process
inc edi inc edi
;more comfortable register for next loop ;more comfortable register for next loop
mov ecx,edi mov ecx,edi
;precacluate pointer to process buffer ;precacluate pointer to process buffer
mov ebx,process_info_buffer mov ebx,process_info_buffer
;--------------------------------------
;find process loop align 4
.find_loop: .find_loop:
cmp ecx,256 cmp ecx,256
jge .no_processes jge .no_processes
;load process information in buffer ;load process information in buffer
mov eax,9 mcall 9
; mov ebx,process_info_buffer
mcall
;if current slot greater than maximal slot, ;if current slot greater than maximal slot,
;there is no more proccesses. ;there is no more proccesses.
cmp ecx,eax cmp ecx,eax
jg .no_processes jg .no_processes
;if slot state is equal to 9, it is empty. ;if slot state is equal to 9, it is empty.
cmp [process_info_buffer+process_information.slot_state],9 cmp [process_info_buffer+process_information.slot_state],9
jnz .process_found jnz .process_found
inc ecx inc ecx
jmp .find_loop jmp .find_loop
;--------------------------------------
align 4
.no_processes: .no_processes:
or edi,-1 or edi,-1
ret ret
;--------------------------------------
align 4
.process_found: .process_found:
;check on/off check box ;check on/off check box
push edi push edi
@ -266,37 +313,34 @@ draw_next_process:
test dword ch_flags,ch_flag_en test dword ch_flags,ch_flag_en
pop edi pop edi
jnz @f jnz @f
cmp dword [process_info_buffer+10],'ICON' cmp dword [process_info_buffer+10],'ICON'
jz .return_1 jz .return_1
cmp dword [process_info_buffer+10],'OS/I' cmp dword [process_info_buffer+10],'OS/I'
jz .return_1 jz .return_1
cmp byte [process_info_buffer+10],'@' cmp byte [process_info_buffer+10],'@'
jz .return_1 jz .return_1
;--------------------------------------
align 4
@@: mov edi,ecx @@:
mov edi,ecx
mov [list_add],ecx mov [list_add],ecx
;get processor cpeed ;get processor cpeed
;for percent calculating ;for percent calculating
mov eax,18 mcall 18,5
mov ebx,5
mcall
xor edx,edx xor edx,edx
mov ebx,100 mov ebx,100
div ebx div ebx
;eax = number of operation for 1% now ;eax = number of operation for 1% now
;calculate process cpu usage percent ;calculate process cpu usage percent
mov ebx,eax mov ebx,eax
mov eax,[process_info_buffer+process_information.cpu_usage] mov eax,[process_info_buffer+process_information.cpu_usage]
; cdq ; cdq
xor edx,edx ; for CPU more 2 GHz - mike.dld xor edx,edx ; for CPU more 2 GHz - mike.dld
div ebx div ebx
mov [cpu_percent],eax mov [cpu_percent],eax
;set text color to display process information ;set text color to display process information
;([tcolor] variable) ;([tcolor] variable)
;0% : black ;0% : black
@ -304,346 +348,144 @@ draw_next_process:
;81-100% : red ;81-100% : red
test eax,eax test eax,eax
jnz .no_black jnz .no_black
mov [tcolor],eax mov [tcolor],eax
jmp .color_set jmp .color_set
;--------------------------------------
align 4
.no_black: .no_black:
cmp eax,80 cmp eax,80
ja .no_green ja .no_green
mov dword [tcolor],0x107a30 mov dword [tcolor],0x107a30
jmp .color_set jmp .color_set
;--------------------------------------
align 4
.no_green: .no_green:
mov dword [tcolor],0xac0000 mov dword [tcolor],0xac0000
;--------------------------------------
align 4
.color_set: .color_set:
;show slot number ;show slot number
mov eax,47
mov ebx,2*65536+1*256
;ecx haven't changed since .process_found ;ecx haven't changed since .process_found
; mov ecx,edi ; mov ecx,edi
mov edx,[curposy] mov edx,[curposy]
add edx,(20-offset_x)*65536+1 add edx,15*65536+1
mov esi,[tcolor] mcall 47,<2,256>,,,[tcolor]
mcall
;show process name ;show process name
mov eax,4
mov ebx,[curposy] mov ebx,[curposy]
add ebx,(50-offset_x)*65536+1 add ebx,45*65536+1
mov ecx,[tcolor] mcall 4,,[tcolor],process_info_buffer.process_name,11
mov edx,process_info_buffer.process_name
mov esi,11
mcall
;show pid ;show pid
mov eax,47
mov ebx,8*65536+1*256
mov ecx,[process_info_buffer.PID]
mov edx,[curposy] mov edx,[curposy]
add edx,(130-offset_x)*65536+1 add edx,125*65536+1
mov esi,[tcolor] mcall 47,<8,256>,[process_info_buffer.PID],,[tcolor]
mcall
;show cpu usage ;show cpu usage
mov ecx,[process_info_buffer.cpu_usage]
add edx,60*65536 add edx,60*65536
mcall mcall ,,[process_info_buffer.cpu_usage]
;show cpu percent ;show cpu percent
mov ebx,3*65536+0*256
mov ecx,[cpu_percent]
add edx,60*65536 add edx,60*65536
mcall mcall ,<3,0>,[cpu_percent]
;show memory start - obsolete ;show memory start - obsolete
mov ebx,8*65536+1*256
mov ecx,[process_info_buffer.memory_start]
add edx,30*65536 add edx,30*65536
mcall mcall ,<8,256>,[process_info_buffer.memory_start]
;show memory usage ;show memory usage
mov ecx,[process_info_buffer.used_memory] mov ecx,[process_info_buffer.used_memory]
inc ecx inc ecx
add edx,60*65536 add edx,60*65536
mcall mcall
;show window stack and value ;show window stack and value
mov ecx,dword [process_info_buffer.window_stack_position]
add edx,60*65536 add edx,60*65536
mcall mcall ,,dword [process_info_buffer.window_stack_position]
;show window xy size ;show window xy size
mov ecx,[process_info_buffer.box.left] mov ecx,[process_info_buffer.box.left]
shl ecx,16 shl ecx,16
add ecx,[process_info_buffer.box.top] add ecx,[process_info_buffer.box.top]
add edx,60*65536 add edx,60*65536
mcall mcall
;--------------------------------------
align 4
.ret: .ret:
;build index->slot map for terminating processes. ;build index->slot map for terminating processes.
mov eax,[index] mov eax,[index]
mov [tasklist+4*eax],edi mov [tasklist+4*eax],edi
ret ret
;------------------------------------------------------------------------------
;read_string: align 4
;clean string
; mov edi,start_application
; xor eax,eax
; mov ecx,60
; cld
; rep stosb
; call print_text
; mov edi,start_application
;edi now contains pointer to last symbol
; jmp still1
;read string main loop
f11: f11:
;full update ;full update
push edi push edi
xor ebp,ebp
inc ebp
; mov ebp,1
call draw_window call draw_window
pop edi pop edi
; ;------------------------------------------------------------------------------
; still1:
;wait for message
; mov eax,23
; mov ebx,100
; mcall
; cmp eax,1
; je f11
;if no message - update process information
; cmp eax,0
; jnz .message_received
; push edi ;edi should be saved since draw_window
; xor ebp,ebp ;corrupt registers
; call draw_window
; pop edi
; jmp still1
;
;.message_received:
; cmp eax,2
; jne read_done ;buttons message
;read char
; mov eax,2
; mcall
; shr eax,8
;if enter pressed, exit read string loop
; cmp eax,13
; je read_done
;if backslash pressed?
; cmp eax,8
; jnz nobsl
;decrease pointer to last symbol
; cmp edi,start_application
; jz still1
; dec edi
;fill last symbol with space because
;print_text show all symbols
; mov [edi],byte 32
; call print_text
; jmp still1
;
; nobsl:
;write new symbol
; mov [edi],al
;display new text
; call print_text
;increment pointer to last symbol
; inc edi
;compare with end of string
; mov esi,start_application
; add esi,60
; cmp esi,edi
; jnz still1
;exiting from read string loop
;
; read_done:
;terminate string for file functions
; mov [edi],byte 0
; call print_text
; jmp still
;
;print_text:
;display start_application string
; pushad
;display text background
; mov eax,13
; mov ebx,64*65536+62*6
; mov ecx,400*65536+12
; mov edx,0xffffcc ;0xeeeeee
; mcall
;display text
; mov eax,4
; mov edx,start_application ;from start_application string
; mov ebx,70*65536+402 ;text center-aligned
; xor ecx,ecx ;black text
; mov esi,60 ;60 symbols
; mcall
; popad
; ret
window_x_size=524
window_y_size=430
calculate_window_pos:
;set window size and position for 0 function
;to [winxpos] and [winypos] variables
;get screen size
mov eax,14
mcall
mov ebx,eax
;calculate (x_screen-window_x_size)/2
shr ebx,16+1
sub ebx,window_x_size/2
shl ebx,16
mov bx,window_x_size
;winxpos=xcoord*65536+xsize
mov [winxpos],ebx
;calculate (y_screen-window_y_size)/2
and eax,0xffff
shr eax,1
sub eax,window_y_size/2
shl eax,16
mov ax,window_y_size
;winypos=ycoord*65536+ysize
mov [winypos],eax
ret
; ********************************************* ; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ******** ; ******* WINDOW DEFINITIONS AND DRAW ********
; ********************************************* ; *********************************************
align 4
align 16
draw_window: draw_window:
;ebp=1 - redraw all
;ebp=0 - redraw only process information
test ebp,ebp
jz .show_process_info
mcall 12, 1 mcall 12, 1
; DRAW WINDOW ; DRAW WINDOW
xor eax,eax ; function 0 : define and draw window xor eax,eax ; function 0 : define and draw window
mov ebx,[winxpos] ; [x start] *65536 + [x size] xor esi,esi
mov ecx,[winypos] ; [y start] *65536 + [y size] mcall ,[winxpos],[winypos],0x34ddffdd,,title
mov edx,0x34ddffdd ; color of work area RRGGBB,8->color ; function 4 : write text to window
mov edi,title ; WINDOW CAPTION;
mcall
add eax,4 ; function 4 : write text to window
mov ebx,(22-offset_x)*65536+35-offset_y
xor ecx,ecx xor ecx,ecx
mov edx,text mcall 4,<17,13>,,text,text_len
mov esi,text_len
mcall
push dword edit1 push dword edit1
call [edit_box_draw] call [edit_box_draw]
push dword check1 push dword check1
call [check_box_draw] call [check_box_draw]
align 16 mcall 26,9
.show_process_info: add eax,100
mov edi,[list_start] mov [time_counter],eax
mov [list_add],edi
mov dword [index],0
mov dword [curposy],54-offset_y
.loop_draw:
call draw_next_process
inc dword [index]
add dword [curposy],10
cmp [index],display_processes
jl .loop_draw
test ebp,ebp
jz .end_redraw
mov eax,8
mov esi,0xaabbcc
call show_process_info
; previous page button ; previous page button
mov ebx,(30-offset_x)*65536+96 mcall 8,<25,96>,<358,10>,51,0xaabbcc
mov ecx,(380-offset_y)*65536+10
mov edx,51
mcall
; next page button 52 ; next page button 52
mov ebx,(130-offset_x)*65536+96
inc edx inc edx
mcall mcall ,<125,96>
; ">" (text enter) button ; ">" (text enter) button
; mov ebx,30*65536+20
add ecx,20 shl 16 add ecx,20 shl 16
; inc edx
; mcall
; run button 53 ; run button 53
mov ebx,(456-offset_x)*65536+50
inc edx inc edx
mcall mcall ,<451,50>
; reboot button ; reboot button
sub ebx,120*65536 sub ebx,120*65536
add ebx,60 add ebx,60
sub ecx,20 shl 16 sub ecx,20 shl 16
inc edx inc edx
mcall mcall
;"PREV PAGE", "NEXT PAGE" and "REBOOT" labels ;"PREV PAGE", "NEXT PAGE" and "REBOOT" labels
mov eax,4
mov ebx,(50-offset_x)*65536+382-offset_y
xor ecx,ecx xor ecx,ecx
mov edx,tbts mcall 4,<45,360>,,tbts,tbte-tbts
mov esi,tbte-tbts
mcall
;">" labels
; mov eax,4
; mov ebx,40*65536+402
; xor ecx,ecx
; mov edx,tbts_2
; mov esi,1
; mcall
;"RUN" labels ;"RUN" labels
; mov eax,4 mcall ,<464,380>,,tbts_3,tbte_2-tbts_3
mov ebx,(475-offset_x)*65536+402-offset_y
xor ecx,ecx
mov edx,tbts_3
mov esi,tbte_2-tbts_3
mcall
;print application name in text box ;print application name in text box
; call print_text
mcall 12, 2 mcall 12, 2
.end_redraw:
ret ret
;------------------------------------------------------------------------------
align 4
show_process_info:
mov edi,[list_start]
mov [list_add],edi
mov dword [index],0
mov dword [curposy],32
;--------------------------------------
align 4
.loop_draw:
call draw_next_process
inc dword [index]
add dword [curposy],10
cmp [index],display_processes
jl .loop_draw
ret
;------------------------------------------------------------------------------
; DATA AREA ; DATA AREA
;------------------------------------------------------------------------------
system_path db '/sys/lib/' system_path db '/sys/lib/'
library_name db 'box_lib.obj',0 library_name db 'box_lib.obj',0
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -652,9 +494,9 @@ err_message_found_lib db 'Sorry I cannot load library box_lib.obj',0
head_f_i: head_f_i:
head_f_l db 'System error',0 head_f_l db 'System error',0
err_message_import db 'Error on load import library box_lib.obj',0 err_message_import db 'Error on load import library box_lib.obj',0
;------------------------------------------------------------------------------
align 4
myimport: myimport:
edit_box_draw dd aEdit_box_draw edit_box_draw dd aEdit_box_draw
edit_box_key dd aEdit_box_key edit_box_key dd aEdit_box_key
edit_box_mouse dd aEdit_box_mouse edit_box_mouse dd aEdit_box_mouse
@ -683,12 +525,16 @@ aCheck_box_mouse db 'check_box_mouse',0
;aOption_box_draw db 'option_box_draw',0 ;aOption_box_draw db 'option_box_draw',0
;aOption_box_mouse db 'option_box_mouse',0 ;aOption_box_mouse db 'option_box_mouse',0
;aVersion_op db 'version_op',0 ;aVersion_op db 'version_op',0
check1 check_box 10,(400-offset_y),6,11,0x80AABBCC,0,0,check_text,check_t_e,0;ch_flag_en ;------------------------------------------------------------------------------
align 4
check1 check_box 10,378,6,11,0x80AABBCC,0,0,check_text,check_t_e,0;ch_flag_en
check1_end: check1_end:
edit1 edit_box 350,(100-offset_x),(398-offset_y),0xffffff,0x6f9480,0,0xAABBCC,0,start_application_c,start_application,mouse_dd,ed_focus,start_application_e,start_application_e edit1 edit_box 350,95,376,0xffffff,0x6f9480,0,0xAABBCC,0,start_application_c,\
start_application,mouse_dd,ed_focus,start_application_e,start_application_e
edit1_end: edit1_end:
list_start dd 0 list_start dd 0
;------------------------------------------------------------------------------
align 4
sys_reboot: sys_reboot:
dd 7 dd 7
dd 0 dd 0
@ -696,7 +542,7 @@ sys_reboot:
dd 0 dd 0
dd 0 dd 0
db '/sys/end',0 db '/sys/end',0
;------------------------------------------------------------------------------
if lang eq de if lang eq de
text: text:
db 'NAME/BEENDEN PID CPU-LAST % ' db 'NAME/BEENDEN PID CPU-LAST % '
@ -705,13 +551,12 @@ text_len = $-text
tbts: db 'SEITE ZURUECK SEITE VOR REBOOT SYSTEM' tbts: db 'SEITE ZURUECK SEITE VOR REBOOT SYSTEM'
tbte: tbte:
;tbts_2 db '>'
tbts_3 db 'START' tbts_3 db 'START'
tbte_2: tbte_2:
check_text db '@ gehoren/aus' check_text db '@ on/off'
check_t_e=$-check_text check_t_e=$-check_text
title db 'Prozesse - Ctrl/Alt/Del',0 title db 'Prozesse - Ctrl/Alt/Del',0
;--------------------------------------
else if lang eq et else if lang eq et
text: text:
db 'NIMI/LÕPETA PID CPU-KASUTUS % ' db 'NIMI/LÕPETA PID CPU-KASUTUS % '
@ -720,13 +565,26 @@ text_len = $-text
tbts: db 'EELMINE LEHT JÄRGMINE LEHT REBOODI SÜSTEEM' tbts: db 'EELMINE LEHT JÄRGMINE LEHT REBOODI SÜSTEEM'
tbte: tbte:
;tbts_2 db '>'
tbts_3 db 'START' tbts_3 db 'START'
tbte_2: tbte_2:
check_text db '@ on/off' check_text db '@ on/off'
check_t_e=$-check_text check_t_e=$-check_text
title db 'Protsessid - Ctrl/Alt/Del' title db 'Protsessid - Ctrl/Alt/Del'
;--------------------------------------
else if lang eq ru
text:
db 'ˆŒŸ/‡€<E2809A>˜ˆœ PID CPU-‡€ƒ<E282AC>“‡Š€ % '
db '<27>€ŒŸœ <20>€—€Ž/‚‘…ƒŽ W-STACK W-SIZE'
text_len = $-text
tbts: db '<27><>…„.<E28098> ‘‹…„.<E28098> <20><EFBFBD>…‡€ƒ<E282AC>“‡Š€'
tbte:
tbts_3 db '‡€<E280A1>Š'
tbte_2:
check_text db '@ ¢ª«/¢ëª«'
check_t_e=$-check_text
title db '„¨á¯¥âç¥à ¯à®æ¥áᮢ - Ctrl/Alt/Del',0
;--------------------------------------
else else
text: text:
db 'NAME/TERMINATE PID CPU-USAGE % ' db 'NAME/TERMINATE PID CPU-USAGE % '
@ -735,23 +593,30 @@ text_len = $-text
tbts: db 'PREV PAGE NEXT PAGE REBOOT SYSTEM' tbts: db 'PREV PAGE NEXT PAGE REBOOT SYSTEM'
tbte: tbte:
;tbts_2 db '>'
tbts_3 db ' RUN' tbts_3 db ' RUN'
tbte_2: tbte_2:
check_text db '@ on/off' check_text db '@ on/off'
check_t_e=$-check_text check_t_e=$-check_text
title db 'Processes - Ctrl/Alt/Del',0 title db 'Process manager - Ctrl/Alt/Del',0
end if end if
file_start: dd 7 ;------------------------------------------------------------------------------
dd 0,0,0,0 align 4
file_start:
dd 7
dd 0
dd 0
dd 0
dd 0
start_application: db '/sys/LAUNCHER',0 start_application: db '/sys/LAUNCHER',0
start_application_e=$-start_application-1 start_application_e=$-start_application-1
; times 60 db 0 ; times 60 db 0
rb 60 rb 60
start_application_c=$-start_application-1 start_application_c=$-start_application-1
;------------------------------------------------------------------------------
I_END: IM_END:
;------------------------------------------------------------------------------
align 4
sc system_colors sc system_colors
winxpos rd 1 winxpos rd 1
winypos rd 1 winypos rd 1
@ -762,8 +627,19 @@ list_add rd 1
curposy rd 1 curposy rd 1
index rd 1 index rd 1
tasklist rd display_processes tasklist rd display_processes
time_counter rd 1
;------------------------------------------------------------------------------
align 4
library_path:
process_info_buffer process_information process_info_buffer process_information
cur_dir_path rb 1024 ;------------------------------------------------------------------------------
library_path rb 1024 align 4
cur_dir_path:
rb 1024
;------------------------------------------------------------------------------
align 4
rb 1024
stack_area:
;------------------------------------------------------------------------------
U_END: U_END:
;------------------------------------------------------------------------------