Subversion Repositories Kolibri OS

Rev

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

Rev 6758 Rev 6792
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2016. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2016. 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: 6758 $
8
$Revision: 6792 $
Line 9... Line 9...
9
 
9
 
Line 64... Line 64...
64
        retn
64
        retn
Line 65... Line 65...
65
 
65
 
66
fs_execute_from_sysdir:
66
fs_execute_from_sysdir:
67
        xor     ebx, ebx
67
        xor     ebx, ebx
-
 
68
fs_execute_from_sysdir_param:
-
 
69
        stdcall kernel_alloc, maxPathLength
-
 
70
        push    eax ebx
-
 
71
        mov     esi, ebp
-
 
72
        mov     edi, eax
-
 
73
        xor     eax, eax
-
 
74
        call    getFullPath
68
fs_execute_from_sysdir_param:
75
        pop     ecx ebx
69
        xor     edx, edx
76
        xor     edx, edx
-
 
77
proc fs_execute
70
proc fs_execute
78
; edx = flags
71
; ebx - cmdline
79
; ecx -> cmdline
72
; edx - flags
80
; ebx -> absolute file path
73
; ebp - full filename
81
; eax = string length
74
    locals
82
    locals
75
        cmdline         rd  1
83
        cmdline         rd  1
76
        flags           rd  1
84
        flags           rd  1
77
        slot            rd  1
85
        slot            rd  1
Line 89... Line 97...
89
        cmdline_size    rd  1
97
        cmdline_size    rd  1
90
        path_string     rd  1
98
        path_string     rd  1
91
    endl
99
    endl
Line 92... Line 100...
92
 
100
 
93
        mov     [flags], edx
101
        mov     [flags], edx
94
        mov     [cmdline], ebx
-
 
95
        stdcall kernel_alloc, maxPathLength
102
        mov     [cmdline], ecx
96
        mov     [path_string], eax
103
        mov     [path_string], ebx
97
        mov     ebx, [ebp]
104
        mov     [filename_size], eax
98
        stdcall get_full_file_name, eax, maxPathLength
105
        mov     esi, -ERROR_FILE_NOT_FOUND
99
        test    eax, eax
106
        test    eax, eax
100
        jz      .err_file
-
 
101
 
107
        jz      .err_file
102
        stdcall load_file, [path_string]
-
 
103
        mov     esi, -ERROR_FILE_NOT_FOUND
108
        stdcall load_file, ebx
104
        test    eax, eax
109
        test    eax, eax
Line 105... Line 110...
105
        jz      .err_file
110
        jz      .err_file
106
 
111
 
Line 139... Line 144...
139
        jz      @f
144
        jz      @f
140
        test    al, al
145
        test    al, al
141
        jz      @f
146
        jz      @f
142
        stosb
147
        stosb
143
        loop    @b
148
        loop    @b
144
 
-
 
145
@@:
149
@@:
146
        mov     edi, [cmdline]
150
        mov     edi, [cmdline]
147
        xor     eax, eax
151
        xor     eax, eax
148
        test    edi, edi
152
        test    edi, edi
149
        jz      @f
153
        jz      @f
Line 167... Line 171...
167
        mov     ebx, [slot_base]
171
        mov     ebx, [slot_base]
168
        mov     [ebx+APPDATA.process], eax
172
        mov     [ebx+APPDATA.process], eax
169
        lea     edx, [ebx+APPDATA.list]
173
        lea     edx, [ebx+APPDATA.list]
170
        lea     ecx, [eax+PROC.thr_list]
174
        lea     ecx, [eax+PROC.thr_list]
171
        list_add_tail edx, ecx
175
        list_add_tail edx, ecx
172
        mov     edi, [path_string]
-
 
173
        mov     ecx, maxPathLength
-
 
174
        call    _strnlen
-
 
175
        mov     [filename_size], eax
-
 
176
        mov     eax, [cmdline_size]
176
        mov     eax, [cmdline_size]
177
        add     eax, sizeof.APP_HDR
177
        add     eax, sizeof.APP_HDR
178
        stdcall kernel_alloc, eax
178
        stdcall kernel_alloc, eax
179
        mov     [ebx+APPDATA.exec_params], eax
179
        mov     [ebx+APPDATA.exec_params], eax
180
        mov     edi, eax
180
        mov     edi, eax