Subversion Repositories Kolibri OS

Rev

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

Rev 3908 Rev 4269
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: 4269 $
9
 
9
 
Line 349... Line 349...
349
        pop     ebx
349
        pop     ebx
350
        ret
350
        ret
351
endp
351
endp
Line 352... Line 352...
352
 
352
 
353
align 4
353
align 4
354
proc init_LFB
354
init_LFB:
355
           locals
-
 
356
             pg_count dd ?
-
 
Line 357... Line 355...
357
           endl
355
        xchg bx, bx
358
 
356
 
359
        cmp     dword [LFBAddress], -1
357
        cmp     dword [LFBAddress], -1
360
        jne     @f
358
        jne     @f
Line 381... Line 379...
381
        mov     [BOOT_VARS+BOOT_MTRR], byte 2
379
        mov     [BOOT_VARS+BOOT_MTRR], byte 2
382
        ret
380
        ret
383
@@:
381
@@:
384
        call    init_mtrr
382
        call    init_mtrr
Line 385... Line 383...
385
 
383
 
386
        mov     edx, LFB_BASE
384
        xor     edx, edx
387
        mov     esi, [LFBAddress]
-
 
388
        mov     edi, 0x00C00000
-
 
389
        mov     dword [exp_lfb+4], edx
-
 
390
 
-
 
391
        shr     edi, 12
-
 
392
        mov     [pg_count], edi
-
 
393
        shr     edi, 10
-
 
394
 
-
 
395
        bt      [cpu_caps], CAPS_PSE
-
 
396
        jnc     .map_page_tables
-
 
397
        or      esi, PG_LARGE+PG_UW
-
 
398
        mov     edx, sys_pgdir+(LFB_BASE shr 20)
-
 
399
@@:
-
 
400
        mov     [edx], esi
-
 
401
        add     edx, 4
-
 
402
        add     esi, 0x00400000
-
 
403
        dec     edi
-
 
404
        jnz     @B
-
 
405
 
385
        mov     eax, [LFBAddress]
406
        bt      [cpu_caps], CAPS_PGE
-
 
407
        jnc     @F
386
        bt      [cpu_caps], CAPS_PGE
408
        or      dword [sys_pgdir+(LFB_BASE shr 20)], PG_GLOBAL
-
 
409
@@:
387
        setc    dh                            ;eliminate branch and
410
        mov     dword [LFBAddress], LFB_BASE
388
        mov     ecx, LFB_SIZE/4096
411
        mov     eax, cr3      ;flush TLB
389
        mov     edi, lfb_pd_0
412
        mov     cr3, eax
-
 
Line 413... Line 390...
413
        ret
390
        lea     eax, [eax+edx+PG_UW]          ;set PG_GLOBAL if supported
-
 
391
 
-
 
392
.map_pte:
-
 
393
        stosd
Line 414... Line -...
414
 
-
 
415
.map_page_tables:
394
        add     eax, 0x1000
416
 
395
        loop    .map_pte
417
@@:
396
 
418
        call    alloc_page
-
 
419
        stdcall map_page_table, edx, eax
-
 
Line 420... Line -...
420
        add     edx, 0x00400000
-
 
421
        dec     edi
-
 
422
        jnz     @B
-
 
423
 
-
 
424
        mov     eax, [LFBAddress]
397
        mov     ecx, (LFB_SIZE/4096)/1024
425
        mov     edi, page_tabs + (LFB_BASE shr 10)
-
 
426
        or      eax, PG_UW
398
        mov     edi, sys_pgdir+(LFB_BASE shr 20)
427
        mov     ecx, [pg_count]
399
        lea     eax, [(lfb_pd_0-OS_BASE)+PG_UW]
428
        cld
400
 
429
@@:
-
 
Line -... Line 401...
-
 
401
.map_pde:
430
        stosd
402
        stosd
431
        add     eax, 0x1000
403
        add     eax, 0x1000
432
        dec     ecx
404
        loop    .map_pde
433
        jnz     @B
-
 
434
 
405
 
435
        mov     dword [LFBAddress], LFB_BASE
-
 
Line 436... Line 406...
436
        mov     eax, cr3      ;flush TLB
406
        mov     dword [exp_lfb+4], LFB_BASE
437
        mov     cr3, eax
407
        mov     dword [LFBAddress], LFB_BASE
Line 438... Line 408...
438
 
408
        mov     eax, cr3                      ;flush TLB