Rev 237 | Rev 252 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 237 | Rev 247 | ||
---|---|---|---|
Line 87... | Line 87... | ||
87 | app_mem dd ? ;0x10 |
87 | app_mem dd ? ;0x10 |
88 | endl |
88 | endl |
Line 89... | Line 89... | ||
89 | 89 | ||
90 | stdcall load_file,[file_name] |
90 | stdcall load_file,[file_name] |
91 | mov ecx, -ERROR_FILE_NOT_FOUND |
- | |
92 | 91 | mov ecx, -ERROR_FILE_NOT_FOUND |
|
93 | test eax, eax |
92 | test eax, eax |
Line 94... | Line 93... | ||
94 | jz .err ;fail |
93 | jz .err_file |
95 | 94 | ||
Line -... | Line 95... | ||
- | 95 | mov [file_base], eax |
|
- | 96 | mov [file_size], ebx |
|
- | 97 | ||
96 | mov [file_base], eax |
98 | pushfd |
97 | mov [file_size], ebx |
99 | cli |
98 | 100 | ||
99 | lea ebx, [app_cmdline] |
101 | lea ebx, [app_cmdline] |
100 | call test_app_header |
102 | call test_app_header |
Line 101... | Line 103... | ||
101 | mov ecx, -0x1F |
103 | mov ecx, -0x1F |
102 | test eax, eax |
104 | test eax, eax |
Line 103... | Line -... | ||
103 | jz .err ;fail |
- | |
104 | - | ||
105 | mov esi, new_process_loading |
- | |
106 | call sys_msg_board_str ; write message to message board |
105 | jz .err_hdr |
107 | 106 | ||
108 | pushfd |
107 | mov esi, new_process_loading |
109 | cli |
108 | call sys_msg_board_str ; write message to message board |
110 | 109 | ||
Line 123... | Line 122... | ||
123 | call set_application_table_status |
122 | call set_application_table_status |
Line 124... | Line 123... | ||
124 | 123 | ||
125 | call get_new_process_place |
124 | call get_new_process_place |
126 | test eax, eax |
125 | test eax, eax |
127 | mov ecx, -0x20 ; too many processes |
126 | mov ecx, -0x20 ; too many processes |
Line 128... | Line 127... | ||
128 | jz .err |
127 | jz .err_hdr |
129 | 128 | ||
130 | mov [slot], eax |
129 | mov [slot], eax |
131 | shl eax, 8 |
130 | shl eax, 8 |
Line 170... | Line 169... | ||
170 | mov [ebx+APPDATA.dir_table],eax |
169 | mov [ebx+APPDATA.dir_table],eax |
171 | mov eax,[app_mem] |
170 | mov eax,[app_mem] |
172 | mov [ebx+APPDATA.mem_size],eax |
171 | mov [ebx+APPDATA.mem_size],eax |
Line 173... | Line 172... | ||
173 | 172 | ||
174 | mov ecx, [file_size] |
173 | mov ecx, [file_size] |
175 | add ecx, 3 |
174 | mov eax, ecx |
176 | shr ecx, 2 |
175 | shr ecx, 2 |
177 | mov esi, [file_base] |
176 | mov esi, [file_base] |
178 | mov edi, new_app_base |
177 | mov edi, new_app_base |
179 | cld |
178 | cld |
- | 179 | rep movsd |
|
- | 180 | and eax, 3 |
|
- | 181 | jz @F |
|
- | 182 | mov ecx, eax |
|
180 | rep movsd |
183 | rep movsb |
181 | 184 | @@: |
|
182 | stdcall kernel_free, [file_base] |
185 | stdcall kernel_free, [file_base] |
183 | lea eax, [app_cmdline] |
186 | lea eax, [app_cmdline] |
184 | stdcall set_app_params ,[slot],eax,[cmd_line],\ |
187 | stdcall set_app_params ,[slot],eax,[cmd_line],\ |
Line 185... | Line 188... | ||
185 | [file_name], dword 0 ;[flags] |
188 | [file_name], dword 0 ;[flags] |
186 | 189 | ||
Line 187... | Line -... | ||
187 | mov eax, [save_cr3] |
- | |
188 | call set_cr3 |
- | |
189 | 190 | mov eax, [save_cr3] |
|
- | 191 | call set_cr3 |
|
- | 192 | ||
190 | xor eax, eax |
193 | popfd |
191 | mov [application_table_status],eax ;unlock application_table_status mutex |
194 | xor ebx, ebx |
192 | popfd |
195 | mov [application_table_status],ebx ;unlock application_table_status mutex |
193 | mov eax,[process_number] ;set result |
196 | mov eax,[process_number] ;set result |
194 | ret |
197 | ret |
195 | .failed: |
198 | .failed: |
- | 199 | mov eax, [save_cr3] |
|
196 | mov eax, [save_cr3] |
200 | call set_cr3 |
- | 201 | .err_hdr: |
|
197 | call set_cr3 |
202 | stdcall kernel_free,[file_base] |
198 | .err: |
203 | popfd |
199 | popfd |
204 | .err_file: |
200 | xor eax, eax |
205 | xor eax, eax |