Subversion Repositories Kolibri OS

Rev

Rev 9715 | Rev 9832 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 9715 Rev 9794
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2022. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2022. 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: 9715 $
8
$Revision: 9794 $
Line 9... Line 9...
9
 
9
 
Line 232... Line 232...
232
 
232
 
233
        mov     ecx, [APP_HEADER_00.start]
233
        mov     ecx, [APP_HEADER_00.start]
234
        mov     [ebx + APP_HDR.eip], ecx
234
        mov     [ebx + APP_HDR.eip], ecx
235
        mov     edx, [APP_HEADER_00.mem_size]
235
        mov     edx, [APP_HEADER_00.mem_size]
-
 
236
        mov     [ebx + APP_HDR._emem], edx
-
 
237
 
-
 
238
        cmp     edx, [APP_HEADER_00.i_end]
-
 
239
        jb      .fail
-
 
240
 
-
 
241
        cmp     edx, OS_BASE ;check memory
-
 
242
        jae     .fail
-
 
243
        mov     ecx, [pg_data.pages_free]
-
 
244
        shl     ecx, 12 ; ecx * 4kb
-
 
245
        cmp     edx, ecx
-
 
246
        jae     .fail
236
        mov     [ebx + APP_HDR._emem], edx
247
 
237
        shr     edx, 1
248
        shr     edx, 1
238
        sub     edx, 0x10
249
        sub     edx, 0x10
239
        mov     [ebx + APP_HDR.esp], edx
250
        mov     [ebx + APP_HDR.esp], edx
240
        mov     ecx, [APP_HEADER_00.i_param]
251
        mov     ecx, [APP_HEADER_00.i_param]
Line 259... Line 270...
259
; sanity check (functions 19,58 load app_i_end bytes and that must
270
; sanity check (functions 19,58 load app_i_end bytes and that must
260
; fit in allocated memory to prevent kernel faults)
271
; fit in allocated memory to prevent kernel faults)
261
        cmp     edx, [APP_HEADER_01.i_end]
272
        cmp     edx, [APP_HEADER_01.i_end]
262
        jb      .fail
273
        jb      .fail
263
; \end{diamond}[20.08.2006]
274
; \end{diamond}[20.08.2006]
-
 
275
        cmp     edx, OS_BASE ;check memory
-
 
276
        jae     .fail
-
 
277
        mov     ecx, [pg_data.pages_free]
-
 
278
        shl     ecx, 12 ; ecx * 4kb
-
 
279
        cmp     edx, ecx
-
 
280
        jae     .fail
Line 264... Line 281...
264
 
281
 
265
        mov     [ebx + APP_HDR._emem], edx
282
        mov     [ebx + APP_HDR._emem], edx
266
        mov     ecx, [APP_HEADER_01.stack_top]
283
        mov     ecx, [APP_HEADER_01.stack_top]
267
        mov     [ebx + APP_HDR.esp], ecx
284
        mov     [ebx + APP_HDR.esp], ecx