Subversion Repositories Kolibri OS

Rev

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

Rev 3908 Rev 4265
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2012. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2012. 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: 3908 $
8
$Revision: 4265 $
Line 9... Line 9...
9
 
9
 
Line 922... Line 922...
922
        popad
922
        popad
923
        mov     eax, [w_count]
923
        mov     eax, [w_count]
924
        ret
924
        ret
925
endp
925
endp
Line -... Line 926...
-
 
926
 
-
 
927
;ebx = 1 - kernel thread
-
 
928
;ecx=thread entry point
-
 
929
;edx=thread stack pointer
-
 
930
;creation flags  0x01 - debugged
-
 
931
;                0x02 - kernel
926
 
932
 
927
align 4
933
align 4
928
proc new_sys_threads
934
proc new_sys_threads
929
       locals
935
       locals
-
 
936
         slot      dd ?
930
         slot      dd ?
937
         flags         dd ?
931
         app_cmdline   dd ? ;0x00
938
         app_cmdline   dd ? ;0x00
932
         app_path      dd ? ;0x04
939
         app_path      dd ? ;0x04
933
         app_eip       dd ? ;0x08
940
         app_eip       dd ? ;0x08
934
         app_esp       dd ? ;0x0C
941
         app_esp       dd ? ;0x0C
935
         app_mem       dd ? ;0x10
942
         app_mem       dd ? ;0x10
Line 936... Line 943...
936
       endl
943
       endl
937
 
944
 
Line 938... Line 945...
938
        cmp     ebx, 1
945
        shl     ebx, 1
939
        jne     .failed     ;other subfunctions
946
        mov     [flags], ebx
940
 
947
 
941
        xor     eax, eax
948
        xor     eax, eax
942
        mov     [app_eip], ecx
949
        mov     [app_eip], ecx
943
        mov     [app_cmdline], eax
-
 
944
        mov     [app_esp], edx
-
 
-
 
950
        mov     [app_cmdline], eax
945
        mov     [app_path], eax
951
        mov     [app_esp], edx
Line 946... Line 952...
946
       ;mov    esi,new_process_loading
952
        mov     [app_path], eax
947
       ;call   sys_msg_board_str
953
 
948
        call    lock_application_table
954
        call    lock_application_table
Line 996... Line 1002...
996
@@:
1002
@@:
997
        mov     [edx+APPDATA.tls_base], eax
1003
        mov     [edx+APPDATA.tls_base], eax
Line 998... Line 1004...
998
 
1004
 
999
        lea     eax, [app_cmdline]
1005
        lea     eax, [app_cmdline]
1000
        stdcall set_app_params , [slot], eax, dword 0, \
1006
        stdcall set_app_params , [slot], eax, dword 0, \
Line 1001... Line -...
1001
                dword 0,dword 0
-
 
1002
 
-
 
1003
       ;mov    esi,new_process_running
1007
                dword 0, [flags]
1004
       ;call   sys_msg_board_str                ;output information about succefull startup
1008
 
1005
        mov     eax, [process_number]           ;set result
1009
        mov     eax, [process_number]           ;set result
1006
        call    unlock_application_table
1010
        call    unlock_application_table
1007
        ret
1011
        ret
Line 1205... Line 1209...
1205
 
1209
 
1206
        mov     eax, [esi+0x08]  ;app_eip
1210
        mov     eax, [esi+0x08]  ;app_eip
1207
        mov     [ebx+REG_EIP], eax;app_entry
1211
        mov     [ebx+REG_EIP], eax;app_entry
1208
        mov     [ebx+REG_CS], dword app_code
1212
        mov     [ebx+REG_CS], dword app_code
-
 
1213
        mov     ecx, USER_PRIORITY
1209
        mov     ecx, USER_PRIORITY
1214
 
1210
        mov     eax, [CURRENT_TASK]
-
 
1211
        shl     eax, 8                      ; created by kernel?
-
 
1212
        cmp     [SLOT_BASE+eax+APPDATA.dir_table], sys_pgdir - OS_BASE
-
 
1213
        jnz     @f
-
 
1214
        cmp     [app_path], 0               ; it is a thread?
1215
        test    byte [flags], 2
-
 
1216
        jz      @F
1215
        jnz     @f
1217
 
1216
        mov     [ebx+REG_CS], dword os_code ; kernel thread
1218
        mov     [ebx+REG_CS], dword os_code ; kernel thread
-
 
1219
        mov     ecx, MAX_PRIORITY
1217
        mov     ecx, MAX_PRIORITY
1220
 
1218
@@:
1221
@@:
Line 1219... Line 1222...
1219
        mov     [ebx+REG_EFLAGS], dword EFL_IOPL1+EFL_IF
1222
        mov     [ebx+REG_EFLAGS], dword EFL_IOPL1+EFL_IF
1220
 
1223
 
Line 1236... Line 1239...
1236
        mov     [SLOT_BASE+ebx*8+APPDATA.debugger_slot], eax
1239
        mov     [SLOT_BASE+ebx*8+APPDATA.debugger_slot], eax
1237
.no_debug:
1240
.no_debug:
1238
        mov     [CURRENT_TASK+ebx+TASKDATA.state], dl
1241
        mov     [CURRENT_TASK+ebx+TASKDATA.state], dl
1239
        lea     edx, [SLOT_BASE+ebx*8]
1242
        lea     edx, [SLOT_BASE+ebx*8]
1240
        call    scheduler_add_thread
1243
        call    scheduler_add_thread
1241
       ;mov    esi,new_process_running
-
 
1242
       ;call   sys_msg_board_str     ;output information about succefull startup
-
 
1243
        ret
1244
        ret
1244
endp
1245
endp
Line 1245... Line 1246...
1245
 
1246