Subversion Repositories Kolibri OS

Rev

Rev 864 | Rev 887 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 864 Rev 886
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2007. All rights reserved. ;;
4
;; Distributed under terms of the GNU General Public License    ;;
4
;; Distributed under terms of the GNU General Public License    ;;
5
;;                                                              ;;
5
;;                                                              ;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
$Revision: 864 $
8
$Revision: 886 $
Line 9... Line 9...
9
 
9
 
Line 185... Line 185...
185
	   jz .copy_process_name_done
185
           jz .copy_process_name_done
186
	   stosb
186
           stosb
187
	   loop .copy_process_name_loop
187
           loop .copy_process_name_loop
188
.copy_process_name_done:
188
.copy_process_name_done:
Line 189... Line -...
189
 
-
 
190
 
189
 
191
	   mov ebx, cr3
190
           mov ebx, cr3
Line 192... Line 191...
192
	   mov [save_cr3], ebx
191
           mov [save_cr3], ebx
193
 
192
 
Line 216... Line 215...
216
@@:
215
@@:
217
end if
216
end if
Line 218... Line 217...
218
 
217
 
Line 219... Line 218...
219
; release only virtual space, not phisical memory
218
; release only virtual space, not phisical memory
220
 
219
 
221
	   stdcall free_kernel_space, [file_base]
220
           stdcall free_kernel_space, [file_base]   ;
222
	   lea eax, [hdr_cmdline]
221
           lea eax, [hdr_cmdline]
223
	   lea ebx, [cmdline]
222
           lea ebx, [cmdline]
Line 413... Line 412...
413
           mov [edi+OS_BASE+(page_tabs shr 20)], eax
412
           mov [edi+OS_BASE+(page_tabs shr 20)], eax
Line 414... Line 413...
414
 
413
 
415
           mov eax, edi
414
           mov eax, edi
Line 416... Line -...
416
	   call set_cr3
-
 
417
 
415
           call set_cr3
418
 
416
 
419
           mov edx, [app_tabs]
417
           mov edx, [app_tabs]
420
           mov edi, master_tab
418
           mov edi, master_tab
421
@@:
419
@@:
Line 502... Line 500...
502
	   mov ecx, 1024
500
           mov ecx, 1024
503
.free:
501
.free:
504
	   mov eax, [esi]
502
           mov eax, [esi]
505
	   test eax, 1
503
           test eax, 1
506
	   jz .next
504
           jz .next
-
 
505
 
507
           test eax, 1 shl 9
506
           test eax, 1 shl 9
508
           jnz .next                      ;skip shared pages
507
           jnz .next                      ;skip shared pages
-
 
508
 
509
	   call free_page
509
           call free_page
510
.next:
510
.next:
511
	   add esi, 4
511
           add esi, 4
512
	   dec ecx
512
           dec ecx
513
	   jnz .free
513
           jnz .free
Line 528... Line 528...
528
;eax = current slot of process
528
;eax = current slot of process
529
	   mov	 ecx,eax
529
           mov   ecx,eax
530
	   shl	 ecx,5
530
           shl   ecx,5
531
	   cmp	 byte [CURRENT_TASK+ecx+0xa],9	;if process running?
531
           cmp   byte [CURRENT_TASK+ecx+0xa],9  ;if process running?
532
	   jz	 @f				 ;skip empty slots
532
           jz    @f                             ;skip empty slots
-
 
533
 
533
	   shl	 ecx,3
534
           shl   ecx,3
534
	   cmp	 [SLOT_BASE+ecx+0xB8],ebx	;compare page directory addresses
535
           cmp   [SLOT_BASE+ecx+0xB8],ebx       ;compare page directory addresses
535
	   jnz	 @f
536
           jnz   @f
-
 
537
 
536
	   inc	 edx				;thread found
538
           inc   edx                            ;thread found
537
@@:
539
@@:
538
	   inc	 eax
540
           inc   eax
539
	   cmp	 eax,[TASK_COUNT]		;exit loop if we look through all processes
541
           cmp   eax,[TASK_COUNT]               ;exit loop if we look through all processes
540
	   jle	 .loop
542
           jle   .loop
Line 856... Line 858...
856
	   ;call   sys_msg_board_str
858
           ;call   sys_msg_board_str
857
	   DEBUGF 1,"%s",new_process_loading
859
           DEBUGF 1,"%s",new_process_loading
858
.wait_lock:
860
.wait_lock:
859
	   cmp [application_table_status],0
861
           cmp [application_table_status],0
860
	   je .get_lock
862
           je .get_lock
-
 
863
 
861
	   call   change_task
864
           call   change_task
862
	   jmp .wait_lock
865
           jmp .wait_lock
Line 863... Line 866...
863
 
866
 
864
.get_lock:
867
.get_lock:
Line 928... Line 931...
928
	   push eax
931
           push eax
929
	   push ebx
932
           push ebx
930
.do_wait:
933
.do_wait:
931
	   cmp dword [ebx],0
934
           cmp dword [ebx],0
932
	   je .get_lock
935
           je .get_lock
-
 
936
 
933
	   call change_task
937
           call change_task
934
	   jmp .do_wait
938
           jmp .do_wait
935
.get_lock:
939
.get_lock:
936
	   mov eax, 1
940
           mov eax, 1
937
	   xchg eax, [ebx]
941
           xchg eax, [ebx]
938
	   test eax, eax
942
           test eax, eax
939
	   jnz .do_wait
943
           jnz .do_wait
-
 
944
 
940
	   pop ebx
945
           pop ebx
941
	   pop eax
946
           pop eax
942
	   ret
947
           ret
Line 943... Line 948...
943
 
948
 
Line 1099... Line 1104...
1099
 
1104
 
1100
	   xor	ecx, ecx	; process state - running
1105
           xor  ecx, ecx    ; process state - running
1101
; set if debuggee
1106
; set if debuggee
1102
	   test byte [flags], 1
1107
           test byte [flags], 1
-
 
1108
           jz   .no_debug
1103
	   jz	.no_debug
1109
 
1104
	   inc	ecx		; process state - suspended
1110
           inc  ecx     ; process state - suspended
1105
	   mov	eax,[CURRENT_TASK]
1111
           mov  eax,[CURRENT_TASK]
1106
	   mov	[SLOT_BASE+ebx*8+APPDATA.debugger_slot],eax
1112
           mov  [SLOT_BASE+ebx*8+APPDATA.debugger_slot],eax
1107
.no_debug:
1113
.no_debug:
1108
	   mov	[CURRENT_TASK+ebx+TASKDATA.state], cl
-
 
1109
	   ;mov    esi,new_process_running
-
 
1110
	   ;call   sys_msg_board_str     ;output information about succefull startup
1114
           mov  [CURRENT_TASK+ebx+TASKDATA.state], cl
1111
	   DEBUGF 1,"%s",new_process_running
1115
           DEBUGF 1,"%s",new_process_running
1112
	   ret
1116
           ret
Line 1113... Line 1117...
1113
endp
1117
endp