Subversion Repositories Kolibri OS

Rev

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

Rev 859 Rev 861
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: 859 $
8
$Revision: 861 $
Line 9... Line 9...
9
 
9
 
Line 354... Line 354...
354
	   xor eax, eax
354
	   xor eax, eax
355
	   mov [dir_addr], eax
355
	   mov [dir_addr], eax
Line 356... Line 356...
356
 
356
 
357
	   mov eax, [app_size]
357
	   mov eax, [app_size]
358
	   add eax, 4095
358
	   add eax, 4095
359
	   and eax, NOT(4095)
359
           and eax, not 4095
360
	   mov [app_size], eax
360
	   mov [app_size], eax
361
	   mov ebx, eax
361
	   mov ebx, eax
362
	   shr eax, 12
362
	   shr eax, 12
Line 363... Line 363...
363
	   mov [app_pages], eax
363
	   mov [app_pages], eax
364
 
364
 
365
	   add ebx, 0x3FFFFF
365
	   add ebx, 0x3FFFFF
366
	   and ebx, NOT(0x3FFFFF)
366
           and ebx, not 0x3FFFFF
Line 367... Line 367...
367
	   shr ebx, 22
367
	   shr ebx, 22
368
	   mov [app_tabs], ebx
368
	   mov [app_tabs], ebx
369
 
369
 
Line 370... Line 370...
370
	   mov ecx, [img_size]
370
	   mov ecx, [img_size]
371
	   add ecx, 4095
371
	   add ecx, 4095
372
	   and ecx, NOT(4095)
372
           and ecx, not 4095
Line 373... Line 373...
373
 
373
 
374
	   mov [img_size], ecx
374
	   mov [img_size], ecx
375
	   shr ecx, 12
375
	   shr ecx, 12
376
	   mov [img_pages], ecx
376
	   mov [img_pages], ecx
377
 
377
 
378
     if GREEDY_KERNEL
378
;     if GREEDY_KERNEL
379
	   lea eax, [ecx+ebx+2]    ;only image size
379
;           lea eax, [ecx+ebx+2]    ;only image size
Line 380... Line 380...
380
     else
380
;     else
381
	   lea eax, [eax+ebx+2]    ;all requested memory
381
;           lea eax, [eax+ebx+2]    ;all requested memory
382
     end if
-
 
383
      ;     cmp eax, [pg_data.pages_free]
382
;     end if
-
 
383
      ;     cmp eax, [pg_data.pages_free]
-
 
384
      ;     ja .fail
-
 
385
 
-
 
386
           call _alloc_page
-
 
387
	   test eax, eax
-
 
388
	   mov [dir_addr], eax
-
 
389
	   jz .fail
-
 
390
 
-
 
391
           ;lea edi, [eax + OS_BASE]
-
 
392
           ;mov ecx, (OS_BASE shr 20)/4
-
 
393
           ;xor eax, eax
Line 384... Line 394...
384
      ;     ja .fail
394
           ;cld
385
 
395
           ;rep stosd
386
           call _alloc_page
396
 
387
	   test eax, eax
397
           ;mov ecx, 1024-(OS_BASE shr 20)/4
388
	   jz .fail
398
           ;mov esi, _sys_pdbr+(OS_BASE shr 20)
Line 389... Line 399...
389
	   mov [dir_addr], eax
399
           ;rep movsd
390
 
400
 
391
           lea edi, [eax + OS_BASE]
401
           lea edi, [eax+OS_BASE]
Line 392... Line 402...
392
           mov ecx, (OS_BASE shr 20)/4
402
           mov ecx, 512
393
	   xor eax, eax
403
           xor eax, eax
394
	   cld
404
           cld
Line 395... Line 405...
395
	   rep stosd
405
           rep stosd
396
 
406
 
Line -... Line 407...
-
 
407
           mov ecx, 512
397
           mov ecx, 1024-(OS_BASE shr 20)/4
408
           mov esi, _sys_pdbr+(HEAP_BASE shr 20)
398
           mov esi, _sys_pdbr+(OS_BASE shr 20)
409
           rep movsd
399
	   rep movsd
410
 
400
 
411
           mov edi, [dir_addr]
401
           mov edi, [dir_addr]
412
           lea eax, [edi+PG_SW]
402
           lea eax, [edi+PG_SW]
413
           mov [edi+OS_BASE+(page_tabs shr 20)], eax
Line 403... Line 414...
403
           mov [edi+OS_BASE+(page_tabs shr 20)], eax
414
 
404
 
415
           mov eax, edi
405
           and eax, -4096
416
	   call set_cr3
406
	   call set_cr3
417
 
Line 407... Line 418...
407
 
418