/kernel/trunk/core/mtrr.inc |
---|
7,12 → 7,22 |
$Revision$ |
; Initializes MTRRs. |
proc init_mtrr |
; Initializes PAT (Page Attribute Table) and MTRRs. |
proc init_pat_mtrr |
cmp [BOOT.mtrr], byte 2 |
je .exit |
bt [cpu_caps], CAPS_PAT ; if PAT is not supported, use MTRR |
jnc .use_mtrr |
; Change PAT_MSR for write combining memory. |
mov ecx, MSR_CR_PAT |
mov eax, PAT_VALUE ; UC UCM WC WB |
mov edx, eax |
wrmsr |
ret |
.use_mtrr: |
bt [cpu_caps], CAPS_MTRR |
jnc .exit |
739,17 → 749,7 |
jmp @b |
@@: |
; 9i. Check PAT support and reprogram PAT_MASR for write combining memory |
bt [cpu_caps], CAPS_PAT |
jnc @F |
mov ecx, MSR_CR_PAT |
mov eax, PAT_VALUE ;UC UCM WC WB |
mov edx, eax |
wrmsr |
@@: |
; 9j. Changes are done. |
; 9i. Changes are done. |
call mtrr_end_change |
.abort: |
/kernel/trunk/core/mtrrtest.asm |
---|
18,12 → 18,12 |
MAX_VARIABLE_MTRR = 10 |
start: |
; Copy test inputs, run init_mtrr, compare with test outputs. Repeat. |
; Copy test inputs, run init_pat_mtrr, compare with test outputs. Repeat. |
mov esi, test1_in_data |
mov edi, mtrrdata |
mov ecx, mtrrdata_size / 4 |
rep movsd |
call init_mtrr |
call init_pat_mtrr |
mov esi, test1_out_data |
mov edi, mtrrdata |
mov ecx, mtrrdata_size / 4 |
33,7 → 33,7 |
mov edi, mtrrdata |
mov ecx, mtrrdata_size / 4 |
rep movsd |
call init_mtrr |
call init_pat_mtrr |
mov esi, test2_out_data |
mov edi, mtrrdata |
mov ecx, mtrrdata_size / 4 |
/kernel/trunk/kernel.asm |
---|
436,7 → 436,7 |
list_init eax |
call init_video |
call init_mtrr |
call init_pat_mtrr |
mov [LFBAddress], LFB_BASE |
mov ecx, bios_fb |
call set_framebuffer |