Rev 91 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 91 | Rev 115 | ||
---|---|---|---|
Line 31... | Line 31... | ||
31 | .newprocessplace: |
31 | .newprocessplace: |
32 | ;eax = address of process information for current slot |
32 | ;eax = address of process information for current slot |
33 | cmp eax,ebx |
33 | cmp eax,ebx |
34 | jz .endnewprocessplace ;empty slot after high boundary |
34 | jz .endnewprocessplace ;empty slot after high boundary |
35 | add eax,0x20 |
35 | add eax,0x20 |
36 | cmp word [eax+0xa],9 ;check process state, 9 means that process slot is empty |
36 | cmp word [eax+TASKDATA.state],9 ;check process state, 9 means that process slot is empty |
37 | jnz .newprocessplace |
37 | jnz .newprocessplace |
38 | .endnewprocessplace: |
38 | .endnewprocessplace: |
39 | mov ebx,eax |
39 | mov ebx,eax |
40 | sub eax,0x3000+second_base_address |
40 | sub eax,0x3000+second_base_address |
41 | shr eax,5 ;calculate slot index |
41 | shr eax,5 ;calculate slot index |
42 | cmp eax,256 |
42 | cmp eax,256 |
43 | jge .failed ;it should be <256 |
43 | jge .failed ;it should be <256 |
44 | mov word [ebx+0xa],9 ;set process state to 9 (for slot after hight boundary) |
44 | mov word [ebx+TASKDATA.state],9 ;set process state to 9 (for slot after hight boundary) |
45 | mov [new_process_place],eax ;save process slot |
45 | mov [new_process_place],eax ;save process slot |
46 | pop ebx |
46 | pop ebx |
47 | ret |
47 | ret |
48 | .failed: |
48 | .failed: |
49 | xor eax,eax |
49 | xor eax,eax |
Line 111... | Line 111... | ||
111 | add [appl_path_size],24 |
111 | add [appl_path_size],24 |
112 | sub eax,11 ;last 11 bytes = application name |
112 | sub eax,11 ;last 11 bytes = application name |
113 | ; mov eax,[esp] ;eax - pointer to file name |
113 | ; mov eax,[esp] ;eax - pointer to file name |
114 | mov ebx,[new_process_place] |
114 | mov ebx,[new_process_place] |
115 | shl ebx,8 |
115 | shl ebx,8 |
116 | add ebx,0x80000 |
116 | add ebx,0x80000 + APPDATA.app_name |
117 | mov ecx,11 |
117 | mov ecx,11 |
118 | call memmove |
118 | call memmove |
Line 119... | Line 119... | ||
119 | 119 | ||
120 | ;read header of file |
120 | ;read header of file |
Line 205... | Line 205... | ||
205 | .cleanfailed_mem1: |
205 | .cleanfailed_mem1: |
206 | ;there is mem for directory entry, but there is no mem for pages |
206 | ;there is mem for directory entry, but there is no mem for pages |
207 | ;so free directory entry |
207 | ;so free directory entry |
208 | mov eax,[new_process_place] |
208 | mov eax,[new_process_place] |
209 | shl eax,8 |
209 | shl eax,8 |
210 | mov eax,[0x80000+eax+0xB8] |
210 | mov eax,[0x80000+eax+APPDATA.dir_table] |
211 | call MEM_Free_Page |
211 | call MEM_Free_Page |
212 | .cleanfailed_mem: |
212 | .cleanfailed_mem: |
213 | ;there is no mem for directory entry, display message. |
213 | ;there is no mem for directory entry, display message. |
214 | mov esi,start_not_enough_memory |
214 | mov esi,start_not_enough_memory |
215 | call sys_msg_board_str |
215 | call sys_msg_board_str |
Line 217... | Line 217... | ||
217 | push ecx ; save error code |
217 | push ecx ; save error code |
218 | ;can't read file, clean process name. |
218 | ;can't read file, clean process name. |
219 | ;this avoid problems with panel application. |
219 | ;this avoid problems with panel application. |
220 | mov edi,[new_process_place] |
220 | mov edi,[new_process_place] |
221 | shl edi,8 |
221 | shl edi,8 |
222 | add edi,0x80000 |
222 | add edi,0x80000 + APPDATA.app_name |
223 | mov ecx,11 |
223 | mov ecx,11 |
224 | mov eax,' ' |
224 | mov eax,' ' |
225 | cld |
225 | cld |
226 | rep stosb |
226 | rep stosb |
227 | pop eax |
227 | pop eax |
Line 278... | Line 278... | ||
278 | 278 | ||
279 | ;set new process name |
279 | ;set new process name |
280 | mov eax,[esp] ;eax - pointer to file name |
280 | mov eax,[esp] ;eax - pointer to file name |
281 | mov ebx,[new_process_place] |
281 | mov ebx,[new_process_place] |
282 | shl ebx,8 |
282 | shl ebx,8 |
283 | add ebx,0x80000 |
283 | add ebx,0x80000 + APPDATA.app_name |
284 | mov ecx,11 |
284 | mov ecx,11 |
Line 285... | Line 285... | ||
285 | call memmove |
285 | call memmove |
286 | 286 | ||
Line 369... | Line 369... | ||
369 | .cleanfailed_mem1: |
369 | .cleanfailed_mem1: |
370 | ;there is mem for directory entry, but there is no mem for pages |
370 | ;there is mem for directory entry, but there is no mem for pages |
371 | ;so free directory entry |
371 | ;so free directory entry |
372 | mov eax,[new_process_place] |
372 | mov eax,[new_process_place] |
373 | shl eax,8 |
373 | shl eax,8 |
374 | mov eax,[0x80000+eax+0xB8] |
374 | mov eax,[0x80000+eax+APPDATA.dir_table] |
375 | call MEM_Free_Page |
375 | call MEM_Free_Page |
376 | .cleanfailed_mem: |
376 | .cleanfailed_mem: |
377 | ;there is no mem for directory entry, display message. |
377 | ;there is no mem for directory entry, display message. |
378 | mov esi,start_not_enough_memory |
378 | mov esi,start_not_enough_memory |
379 | call sys_msg_board_str |
379 | call sys_msg_board_str |
Line 381... | Line 381... | ||
381 | push ecx ; save error code |
381 | push ecx ; save error code |
382 | ;can't read file, clean process name. |
382 | ;can't read file, clean process name. |
383 | ;this avoid problems with panel application. |
383 | ;this avoid problems with panel application. |
384 | mov edi,[new_process_place] |
384 | mov edi,[new_process_place] |
385 | shl edi,8 |
385 | shl edi,8 |
386 | add edi,0x80000 |
386 | add edi,0x80000+APPDATA.app_name |
387 | mov ecx,11 |
387 | mov ecx,11 |
388 | mov eax,' ' |
388 | mov eax,' ' |
389 | cld |
389 | cld |
390 | rep stosb |
390 | rep stosb |
391 | pop eax |
391 | pop eax |
Line 415... | Line 415... | ||
415 | ; mov ebx,[new_process_place] |
415 | ; mov ebx,[new_process_place] |
416 | ;set 0x8c field of extended information about process |
416 | ;set 0x8c field of extended information about process |
417 | ;(size of application memory) |
417 | ;(size of application memory) |
418 | shl ebx,8 |
418 | shl ebx,8 |
419 | mov eax,[app_mem] |
419 | mov eax,[app_mem] |
420 | mov [second_base_address+0x80000+0x8c+ebx],eax |
420 | mov [second_base_address+0x80000+APPDATA.mem_size+ebx],eax |
421 | ;set 0x10 field of information about process |
421 | ;set 0x10 field of information about process |
422 | ;(application base address) |
422 | ;(application base address) |
423 | ; mov ebx,[new_process_place] |
423 | ; mov ebx,[new_process_place] |
424 | ; shl ebx,5 |
424 | ; shl ebx,5 |
425 | shr ebx,3 |
425 | shr ebx,3 |
426 | mov dword [second_base_address+0x3000+ebx+0x10],std_application_base_address |
426 | mov dword [second_base_address+0x3000+ebx+TASKDATA.mem_start],std_application_base_address |
Line 427... | Line 427... | ||
427 | 427 | ||
428 | ;add command line parameters |
428 | ;add command line parameters |
429 | .add_command_line: |
429 | .add_command_line: |
430 | mov edx,[app_i_param] |
430 | mov edx,[app_i_param] |
Line 464... | Line 464... | ||
464 | ;****************************************************************** |
464 | ;****************************************************************** |
465 | mov ebx,[new_process_place] |
465 | mov ebx,[new_process_place] |
466 | mov eax,ebx |
466 | mov eax,ebx |
467 | shl ebx,5 |
467 | shl ebx,5 |
468 | add ebx,0x3000 ;ebx - pointer to information about process |
468 | add ebx,0x3000 ;ebx - pointer to information about process |
469 | mov [ebx+0xe],al ;set window number on screen = process slot |
469 | mov [ebx+TASKDATA.wnd_number],al ;set window number on screen = process slot |
Line 470... | Line 470... | ||
470 | 470 | ||
Line 471... | Line 471... | ||
471 | mov [ebx],dword 1+2+4 ;set default event flags (see 40 function) |
471 | mov [ebx+TASKDATA.event_mask],dword 1+2+4 ;set default event flags (see 40 function) |
472 | 472 | ||
473 | inc dword [process_number] |
473 | inc dword [process_number] |
Line 474... | Line 474... | ||
474 | mov eax,[process_number] |
474 | mov eax,[process_number] |
475 | mov [ebx+4],eax ;set PID |
475 | mov [ebx+TASKDATA.pid],eax ;set PID |
476 | 476 | ||
477 | mov ecx,ebx |
477 | mov ecx,ebx |
478 | add ecx,draw_data-0x3000 ;ecx - pointer to draw data |
478 | add ecx,draw_data-0x3000 ;ecx - pointer to draw data |
479 | ;set draw data to full screen |
479 | ;set draw data to full screen |
480 | mov [ecx+0],dword 0 |
480 | mov [ecx+RECT.left],dword 0 |
481 | mov [ecx+4],dword 0 |
481 | mov [ecx+RECT.top],dword 0 |
482 | mov eax,[0xfe00] |
482 | mov eax,[0xfe00] |
483 | mov [ecx+8],eax |
483 | mov [ecx+RECT.right],eax |
484 | mov eax,[0xfe04] |
484 | mov eax,[0xfe04] |
485 | mov [ecx+12],eax |
485 | mov [ecx+RECT.bottom],eax |
486 | ;set window state to 'normal' (non-minimized/maximized/rolled-up) state |
486 | ;set window state to 'normal' (non-minimized/maximized/rolled-up) state |
487 | mov [ecx+WDATA.fl_wstate],WSTATE_NORMAL |
487 | mov [ecx+WDATA.fl_wstate],WSTATE_NORMAL |
488 | ;set cr3 register in TSS of application |
488 | ;set cr3 register in TSS of application |
489 | mov ecx,[new_process_place] |
489 | mov ecx,[new_process_place] |
490 | shl ecx,8 |
490 | shl ecx,8 |
Line 491... | Line 491... | ||
491 | mov eax,[0x800B8+ecx] |
491 | mov eax,[0x80000+APPDATA.dir_table+ecx] |
492 | add eax,8+16 ;add flags |
492 | add eax,8+16 ;add flags |
Line 564... | Line 564... | ||
564 | mov ebx,[new_process_place] |
564 | mov ebx,[new_process_place] |
565 | shl ebx,5 |
565 | shl ebx,5 |
566 | ; set if debuggee |
566 | ; set if debuggee |
567 | test byte [esp+28], 1 |
567 | test byte [esp+28], 1 |
568 | jz .no_debug |
568 | jz .no_debug |
569 | mov [0x3000+ebx+0xa], byte 1 ; set process state - suspended |
569 | mov [0x3000+ebx+TASKDATA.state], 1 ; set process state - suspended |
570 | mov eax, [0x3000] |
570 | mov eax, [0x3000] |
571 | mov [0x80000+ebx*8+0xac], eax ;set debugger PID - current |
571 | mov [0x80000+ebx*8+APPDATA.debugger_slot], eax ;set debugger PID - current |
572 | jmp .debug |
572 | jmp .debug |
573 | .no_debug: |
573 | .no_debug: |
574 | mov [0x3000+ebx+0xa], byte 0 ; set process state - running |
574 | mov [0x3000+ebx+TASKDATA.state], 0 ; set process state - running |
575 | .debug: |
575 | .debug: |
Line 576... | Line 576... | ||
576 | 576 | ||
577 | mov esi,new_process_running |
577 | mov esi,new_process_running |
Line 620... | Line 620... | ||
620 | mov [app_start],ebx |
620 | mov [app_start],ebx |
621 | mov [app_esp],ecx |
621 | mov [app_esp],ecx |
Line 622... | Line 622... | ||
622 | 622 | ||
623 | mov esi,[0x3000] |
623 | mov esi,[0x3000] |
624 | shl esi,8 |
624 | shl esi,8 |
625 | add esi,0x80000 |
625 | add esi,0x80000+APPDATA.app_name |
Line 626... | Line 626... | ||
626 | mov ebx,esi ;ebx=esi - pointer to extended information about current thread |
626 | mov ebx,esi ;ebx=esi - pointer to extended information about current thread |
627 | 627 | ||
628 | mov edi,[new_process_place] |
628 | mov edi,[new_process_place] |
629 | shl edi,8 |
629 | shl edi,8 |
630 | add edi,0x80000 |
630 | add edi,0x80000 |
631 | mov edx,edi ;edx=edi - pointer to extended infomation about new thread |
631 | lea edx, [edi+APPDATA.app_name] ;edx=edi - pointer to extended infomation about new thread |
632 | mov ecx,256/4 |
632 | mov ecx,256/4 |
633 | rep stosd ;clean extended information about new thread |
633 | rep stosd ;clean extended information about new thread |
634 | mov edi,edx |
634 | mov edi,edx |
635 | mov ecx,11 |
635 | mov ecx,11 |
636 | rep movsb ;copy process name |
636 | rep movsb ;copy process name |
637 | mov eax,[ebx+0x8c] |
637 | mov eax,[ebx+APPDATA.mem_size] |
638 | mov [app_mem],eax ;set memory size |
638 | mov [app_mem],eax ;set memory size |
639 | mov eax,[ebx+0xb8] |
639 | mov eax,[ebx+APPDATA.dir_table] |
640 | mov [edx+0xb8],eax ;copy page directory |
640 | mov dword [edx-APPDATA.app_name+APPDATA.dir_table],eax ;copy page directory |
641 | ; mov eax,[new_process_place] |
641 | ; mov eax,[new_process_place] |
Line 642... | Line 642... | ||
642 | ; mov ebx,[0x3000] |
642 | ; mov ebx,[0x3000] |
Line 667... | Line 667... | ||
667 | mov esi,ebx ;save new size |
667 | mov esi,ebx ;save new size |
668 | add ebx,4095 |
668 | add ebx,4095 |
669 | and ebx,not (4096-1) ;round up size |
669 | and ebx,not (4096-1) ;round up size |
670 | mov ecx,[0x3000] |
670 | mov ecx,[0x3000] |
671 | shl ecx,8 |
671 | shl ecx,8 |
672 | mov edx,[0x8008C+ecx] |
672 | mov edx,[0x80000 + APPDATA.mem_size +ecx] |
673 | add edx,4095 |
673 | add edx,4095 |
674 | and edx,not (4096-1) ;old size |
674 | and edx,not (4096-1) ;old size |
675 | mov eax,[0x800B8+ecx] |
675 | mov eax,[0x80000 + APPDATA.dir_table+ecx] |
676 | call MEM_Get_Linear_Address |
676 | call MEM_Get_Linear_Address |
677 | ;eax - linear address of page directory |
677 | ;eax - linear address of page directory |
678 | call MEM_Heap_Lock ;guarantee that two threads willn't |
678 | call MEM_Heap_Lock ;guarantee that two threads willn't |
679 | ;change memory size simultaneously |
679 | ;change memory size simultaneously |
680 | cmp ebx,edx |
680 | cmp ebx,edx |
Line 702... | Line 702... | ||
702 | 702 | ||
703 | .unlock: |
703 | .unlock: |
704 | mov ebx,esi |
704 | mov ebx,esi |
705 | mov eax,[0x3000] |
705 | mov eax,[0x3000] |
706 | shl eax,8 |
706 | shl eax,8 |
707 | mov [eax+0x8008c],ebx ;write new memory size |
707 | mov [eax+0x80000 + APPDATA.mem_size],ebx ;write new memory size |
708 | ;search threads and update |
708 | ;search threads and update |
709 | ;application memory size infomation |
709 | ;application memory size infomation |
710 | mov ecx,[eax+0x800b8] |
710 | mov ecx,[eax+0x80000 + APPDATA.dir_table] |
Line 711... | Line 711... | ||
711 | mov eax,2 |
711 | mov eax,2 |
712 | 712 | ||
713 | .search_threads: |
713 | .search_threads: |
714 | ;eax = current slot |
714 | ;eax = current slot |
715 | ;ebx = new memory size |
715 | ;ebx = new memory size |
716 | ;ecx = page directory |
716 | ;ecx = page directory |
717 | cmp eax,[0x3004] |
717 | cmp eax,[0x3004] |
718 | jg .search_threads_end |
718 | jg .search_threads_end |
719 | mov edx,eax |
719 | mov edx,eax |
720 | shl edx,5 |
720 | shl edx,5 |
721 | cmp word [0x3000+edx+0xa],9 ;if slot empty? |
721 | cmp word [0x3000+edx+TASKDATA.state],9 ;if slot empty? |
722 | jz .search_threads_next |
722 | jz .search_threads_next |
723 | shl edx,3 |
723 | shl edx,3 |
724 | cmp [edx+0x800b8],ecx ;if it is our thread? |
724 | cmp [edx+0x80000+APPDATA.dir_table],ecx ;if it is our thread? |
725 | jnz .search_threads_next |
725 | jnz .search_threads_next |
726 | mov [edx+0x8008c],ebx ;update memory size |
726 | mov [edx+0x80000+APPDATA.mem_size],ebx ;update memory size |
727 | .search_threads_next: |
727 | .search_threads_next: |
728 | inc eax |
728 | inc eax |
Line 751... | Line 751... | ||
751 | mov ecx,2*32 |
751 | mov ecx,2*32 |
Line 752... | Line 752... | ||
752 | 752 | ||
753 | .loop: |
753 | .loop: |
754 | ;ecx=offset of current process info entry |
754 | ;ecx=offset of current process info entry |
755 | ;ebx=maximum permitted offset |
755 | ;ebx=maximum permitted offset |
756 | cmp byte [second_base_address+0x3000+ecx+0xa],9 |
756 | cmp byte [second_base_address+0x3000+ecx+TASKDATA.state],9 |
757 | jz .endloop ;skip empty slots |
757 | jz .endloop ;skip empty slots |
758 | cmp [second_base_address+0x3000+ecx+0x4],eax ;check PID |
758 | cmp [second_base_address+0x3000+ecx+TASKDATA.pid],eax ;check PID |
759 | jz .pid_found |
759 | jz .pid_found |
760 | .endloop: |
760 | .endloop: |
761 | add ecx,32 |
761 | add ecx,32 |
762 | cmp ecx,ebx |
762 | cmp ecx,ebx |
Line 799... | Line 799... | ||
799 | ; edx - start address in other process |
799 | ; edx - start address in other process |
800 | ;Output: |
800 | ;Output: |
801 | ; eax - number of bytes written |
801 | ; eax - number of bytes written |
802 | pushad |
802 | pushad |
803 | shl eax,8 |
803 | shl eax,8 |
804 | mov eax,[0x80000+eax+0xB8] |
804 | mov eax,[0x80000+eax+APPDATA.dir_table] |
805 | call MEM_Get_Linear_Address |
805 | call MEM_Get_Linear_Address |
806 | mov ebp,eax |
806 | mov ebp,eax |
807 | ;ebp=linear address of page directory of other process. |
807 | ;ebp=linear address of page directory of other process. |
808 | add edx,std_application_base_address ;convert to linear address |
808 | add edx,std_application_base_address ;convert to linear address |
809 | test ecx,ecx |
809 | test ecx,ecx |
Line 904... | Line 904... | ||
904 | ; edx - start address in other process |
904 | ; edx - start address in other process |
905 | ;Output: |
905 | ;Output: |
906 | ; eax - number of bytes read. |
906 | ; eax - number of bytes read. |
907 | pushad |
907 | pushad |
908 | shl eax,8 |
908 | shl eax,8 |
909 | mov eax,[0x80000+eax+0xB8] |
909 | mov eax,[0x80000+eax+APPDATA.dir_table] |
910 | call MEM_Get_Linear_Address |
910 | call MEM_Get_Linear_Address |
911 | mov ebp,eax |
911 | mov ebp,eax |
912 | add edx,std_application_base_address |
912 | add edx,std_application_base_address |
913 | .read_loop: |
913 | .read_loop: |
914 | ;ebx = current buffer address |
914 | ;ebx = current buffer address |
Line 1007... | Line 1007... | ||
1007 | ; eax = 1 region lays in app memory |
1007 | ; eax = 1 region lays in app memory |
1008 | ; eax = 0 region don't lays in app memory |
1008 | ; eax = 0 region don't lays in app memory |
1009 | test ecx,ecx |
1009 | test ecx,ecx |
1010 | jle .ok |
1010 | jle .ok |
1011 | shl eax,5 |
1011 | shl eax,5 |
1012 | cmp word [0x3000+eax+0xa],0 |
1012 | cmp word [0x3000+eax+TASKDATA.state],0 |
1013 | jnz .failed |
1013 | jnz .failed |
1014 | shl eax,3 |
1014 | shl eax,3 |
1015 | mov eax,[0x80000+eax+0xb8] |
1015 | mov eax,[0x80000+eax+APPDATA.dir_table] |
1016 | test eax,eax |
1016 | test eax,eax |
1017 | jz .failed |
1017 | jz .failed |
1018 | call MEM_Get_Linear_Address |
1018 | call MEM_Get_Linear_Address |
1019 | push ebx |
1019 | push ebx |
1020 | push ecx |
1020 | push ecx |
Line 1079... | Line 1079... | ||
1079 | ;set ipc buffer area |
1079 | ;set ipc buffer area |
1080 | mov edi,[0x3000] |
1080 | mov edi,[0x3000] |
1081 | shl edi,8 |
1081 | shl edi,8 |
1082 | add edi,0x80000 |
1082 | add edi,0x80000 |
1083 | cli |
1083 | cli |
1084 | mov [edi+0xA0],ebx ;set fields in extended information area |
1084 | mov [edi+APPDATA.ipc_start],ebx ;set fields in extended information area |
1085 | mov [edi+0xA4],ecx |
1085 | mov [edi+APPDATA.ipc_size],ecx |
1086 | sti |
1086 | sti |
1087 | mov [esp+36],dword 0 ;success |
1087 | mov [esp+36],dword 0 ;success |
1088 | ret |
1088 | ret |
Line 1089... | Line 1089... | ||
1089 | 1089 | ||
Line 1098... | Line 1098... | ||
1098 | test eax,eax |
1098 | test eax,eax |
1099 | jz .no_pid |
1099 | jz .no_pid |
1100 | mov ebp,eax |
1100 | mov ebp,eax |
1101 | ;ebp = slot of other process |
1101 | ;ebp = slot of other process |
1102 | shl eax,8 |
1102 | shl eax,8 |
1103 | mov edi,[eax+0x80000+0xa0] ;is ipc area defined? |
1103 | mov edi,[eax+0x80000+APPDATA.ipc_start] ;is ipc area defined? |
1104 | test edi,edi |
1104 | test edi,edi |
1105 | jz .no_ipc_area |
1105 | jz .no_ipc_area |
1106 | mov esi,[eax+0x80000+0xa4] ;esi - size of buffer |
1106 | mov esi,[eax+0x80000+APPDATA.ipc_size] ;esi - size of buffer |
1107 | push dword -1 ;temp variable for read_process_memory |
1107 | push dword -1 ;temp variable for read_process_memory |
1108 | mov ebx,esp |
1108 | mov ebx,esp |
1109 | push ecx |
1109 | push ecx |
1110 | push edx |
1110 | push edx |
1111 | mov ecx,4 ;read 4 bytes |
1111 | mov ecx,4 ;read 4 bytes |
Line 1129... | Line 1129... | ||
1129 | mov eax,ebp |
1129 | mov eax,ebp |
1130 | call write_process_memory |
1130 | call write_process_memory |
1131 | add edx,esi |
1131 | add edx,esi |
1132 | sub edx,4 ;move to beginning of place for our message |
1132 | sub edx,4 ;move to beginning of place for our message |
1133 | mov eax,[second_base_address+0x3010] |
1133 | mov eax,[second_base_address+0x3010] |
1134 | mov eax,[eax+0x4] ;eax - our PID |
1134 | mov eax,[eax+TASKDATA.pid] ;eax - our PID |
1135 | mov [esp+8],eax |
1135 | mov [esp+8],eax |
1136 | mov eax,ebp |
1136 | mov eax,ebp |
1137 | call write_process_memory ;write PID |
1137 | call write_process_memory ;write PID |
1138 | mov ebx,esp ;address of size of message |
1138 | mov ebx,esp ;address of size of message |
1139 | mov eax,ebp |
1139 | mov eax,ebp |
Line 1149... | Line 1149... | ||
1149 | call write_process_memory ;write message |
1149 | call write_process_memory ;write message |
1150 | sti |
1150 | sti |
1151 | ;awake other process |
1151 | ;awake other process |
1152 | shl ebp,8 |
1152 | shl ebp,8 |
1153 | mov eax,ebp |
1153 | mov eax,ebp |
1154 | or [eax+0x800A8],dword 0x40 |
1154 | or [eax+0x80000+APPDATA.event_mask],dword 0x40 |
Line 1155... | Line 1155... | ||
1155 | 1155 | ||
1156 | cmp dword [check_idle_semaphore],20 |
1156 | cmp dword [check_idle_semaphore],20 |
1157 | jge .ipc_no_cis |
1157 | jge .ipc_no_cis |
1158 | mov dword [check_idle_semaphore],5 |
1158 | mov dword [check_idle_semaphore],5 |
Line 1235... | Line 1235... | ||
1235 | .find_last_byte_end: |
1235 | .find_last_byte_end: |
1236 | add [appl_path_size],24 |
1236 | add [appl_path_size],24 |
1237 | lea esi,[eax-11] ;last 11 bytes = application name |
1237 | lea esi,[eax-11] ;last 11 bytes = application name |
1238 | mov edi,[new_process_place] |
1238 | mov edi,[new_process_place] |
1239 | shl edi,8 |
1239 | shl edi,8 |
1240 | add edi,0x80000 |
1240 | add edi,0x80000+APPDATA.app_name |
1241 | mov ecx,11 |
1241 | mov ecx,11 |
1242 | cld |
1242 | cld |
1243 | rep movsb ;copy name to extended information about process |
1243 | rep movsb ;copy name to extended information about process |
Line 1244... | Line 1244... | ||
1244 | 1244 | ||
Line 1364... | Line 1364... | ||
1364 | .cleanfailed_mem1: |
1364 | .cleanfailed_mem1: |
1365 | ;there is mem for directory entry, but there is no mem for pages |
1365 | ;there is mem for directory entry, but there is no mem for pages |
1366 | ;so free directory entry |
1366 | ;so free directory entry |
1367 | mov eax,[new_process_place] |
1367 | mov eax,[new_process_place] |
1368 | shl eax,8 |
1368 | shl eax,8 |
1369 | mov eax,[0x80000+eax+0xB8] |
1369 | mov eax,[0x80000+eax+APPDATA.dir_table] |
1370 | call MEM_Free_Page |
1370 | call MEM_Free_Page |
1371 | .cleanfailed_mem: |
1371 | .cleanfailed_mem: |
1372 | ;there is no mem for directory entry, display message. |
1372 | ;there is no mem for directory entry, display message. |
1373 | mov esi,start_not_enough_memory |
1373 | mov esi,start_not_enough_memory |
1374 | call sys_msg_board_str |
1374 | call sys_msg_board_str |
Line 1376... | Line 1376... | ||
1376 | push ecx |
1376 | push ecx |
1377 | ;can't read file, clean process name. |
1377 | ;can't read file, clean process name. |
1378 | ;this avoid problems with panel application. |
1378 | ;this avoid problems with panel application. |
1379 | mov edi,[new_process_place] |
1379 | mov edi,[new_process_place] |
1380 | shl edi,8 |
1380 | shl edi,8 |
1381 | add edi,0x80000 |
1381 | add edi,0x80000+APPDATA.app_name |
1382 | mov ecx,11 |
1382 | mov ecx,11 |
1383 | mov eax,' ' |
1383 | mov eax,' ' |
1384 | cld |
1384 | cld |
1385 | rep stosb |
1385 | rep stosb |
1386 | pop eax |
1386 | pop eax |
Line 1453... | Line 1453... | ||
1453 | ; now edi points to name without path |
1453 | ; now edi points to name without path |
1454 | mov esi, edi |
1454 | mov esi, edi |
1455 | mov ecx, 8 ; 8 chars for name |
1455 | mov ecx, 8 ; 8 chars for name |
1456 | mov edi, [new_process_place] |
1456 | mov edi, [new_process_place] |
1457 | shl edi, cl |
1457 | shl edi, cl |
1458 | add edi, 0x80000 |
1458 | add edi, 0x80000+APPDATA.app_name |
1459 | .copy_process_name_loop: |
1459 | .copy_process_name_loop: |
1460 | lodsb |
1460 | lodsb |
1461 | cmp al, '.' |
1461 | cmp al, '.' |
1462 | jz .copy_process_name_done |
1462 | jz .copy_process_name_done |
1463 | test al, al |
1463 | test al, al |
Line 1598... | Line 1598... | ||
1598 | .cleanfailed: |
1598 | .cleanfailed: |
1599 | push ecx |
1599 | push ecx |
1600 | ; clean process name, this avoid problems with @panel |
1600 | ; clean process name, this avoid problems with @panel |
1601 | mov edi, [new_process_place] |
1601 | mov edi, [new_process_place] |
1602 | shl edi, 8 |
1602 | shl edi, 8 |
1603 | add edi, 0x80000 |
1603 | add edi, 0x80000+APPDATA.app_name |
1604 | mov ecx, 11 |
1604 | mov ecx, 11 |
1605 | mov al, ' ' |
1605 | mov al, ' ' |
1606 | rep stosb |
1606 | rep stosb |
1607 | pop eax |
1607 | pop eax |
1608 | .failed: |
1608 | .failed: |