Subversion Repositories Kolibri OS

Rev

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

Rev 5596 Rev 6252
Line 3... Line 3...
3
;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2015. 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: 5596 $
8
$Revision: 6252 $
9
 
9
 
Line 403... Line 403...
403
        pop     eax
403
        pop     eax
404
        ret
404
        ret
405
endp
405
endp
Line 406... Line 406...
406
 
406
 
407
align 4
-
 
408
proc init_LFB
-
 
409
           locals
-
 
410
             pg_count dd ?
-
 
411
           endl
-
 
412
 
-
 
413
        cmp     dword [LFBAddress], -1
-
 
414
        jne     @f
-
 
415
        mov     [BOOT_VARS+BOOT_MTRR], byte 2
-
 
416
; max VGA=640*480*4=1228800 bytes
-
 
417
; + 32*640*4=81920 bytes for mouse pointer
-
 
418
        stdcall alloc_pages, ((1228800+81920)/4096)
-
 
419
 
-
 
420
        push    eax
-
 
421
        call    alloc_page
-
 
422
        stdcall map_page_table, LFB_BASE, eax
-
 
423
        pop     eax
-
 
424
        or      eax, PG_UWR
-
 
425
        mov     ebx, LFB_BASE
-
 
426
; max VGA=640*480*4=1228800 bytes
-
 
427
; + 32*640*4=81920 bytes for mouse pointer
-
 
428
        mov     ecx, (1228800+81920)/4096
-
 
429
        call    commit_pages
-
 
430
        mov     [LFBAddress], dword LFB_BASE
-
 
431
        ret
-
 
432
@@:
-
 
433
        test    [SCR_MODE], word 0100000000000000b
-
 
434
        jnz     @f
-
 
435
        mov     [BOOT_VARS+BOOT_MTRR], byte 2
-
 
436
        ret
-
 
437
@@:
-
 
438
        call    init_mtrr
-
 
439
 
-
 
440
        mov     edx, LFB_BASE
-
 
441
        mov     esi, [LFBAddress]
-
 
442
        mov     edi, 0x00C00000
-
 
443
        mov     dword [exp_lfb+4], edx
-
 
444
 
-
 
445
        shr     edi, 12
-
 
446
        mov     [pg_count], edi
-
 
447
        shr     edi, 10
-
 
448
 
-
 
449
        bt      [cpu_caps], CAPS_PSE
-
 
450
        jnc     .map_page_tables
-
 
451
        or      esi, PDE_LARGE+PG_UWR
-
 
452
        mov     edx, sys_proc+PROC.pdt_0+(LFB_BASE shr 20)
-
 
453
@@:
-
 
454
        mov     [edx], esi
-
 
455
        add     edx, 4
-
 
456
        add     esi, 0x00400000
-
 
457
        dec     edi
-
 
458
        jnz     @B
-
 
459
 
-
 
460
        bt      [cpu_caps], CAPS_PGE
-
 
461
        jnc     @F
-
 
462
        or      dword [sys_proc+PROC.pdt_0+(LFB_BASE shr 20)], PG_GLOBAL
-
 
463
@@:
-
 
464
        mov     dword [LFBAddress], LFB_BASE
-
 
465
        mov     eax, cr3      ;flush TLB
-
 
466
        mov     cr3, eax
-
 
467
        ret
-
 
468
 
-
 
469
.map_page_tables:
-
 
470
 
-
 
471
@@:
-
 
472
        call    alloc_page
-
 
473
        stdcall map_page_table, edx, eax
-
 
474
        add     edx, 0x00400000
-
 
475
        dec     edi
-
 
476
        jnz     @B
-
 
477
 
-
 
478
        mov     eax, [LFBAddress]
-
 
479
        mov     edi, page_tabs + (LFB_BASE shr 10)
-
 
480
        or      eax, PG_GLOBAL+PG_UWR
-
 
481
        and     eax, [pte_valid_mask]
-
 
482
        mov     ecx, [pg_count]
-
 
483
        cld
-
 
484
@@:
-
 
485
        stosd
-
 
486
        add     eax, 0x1000
-
 
487
        loop    @B
-
 
488
 
-
 
489
        mov     dword [LFBAddress], LFB_BASE
-
 
490
        mov     eax, cr3      ;flush TLB
-
 
491
        mov     cr3, eax
-
 
492
 
-
 
493
        ret
-
 
494
endp
-
 
495
 
-
 
496
align 4
407
align 4
Line 497... Line 408...
497
proc new_mem_resize stdcall, new_size:dword
408
proc new_mem_resize stdcall, new_size:dword
498
 
409
 
499
        push    ebx
410
        push    ebx