Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

MTRR mystery (Announce)

posted by RayeR Homepage, CZ, 31.01.2012, 02:38
(edited by RayeR on 31.01.2012, 02:59)

> When I come at home I'll try pull one DIMM out.

Yes, I was right! I pulled 1 DIMM out and got back my VESA hyper speed. But why? I did some comparison. First here's output of Japhet's memstat.
for 2GB:

Int 15h, ah=88h, extended memory: 0 kB
Int 15h, ax=E801h:
ext. memory below 16 MB: 15360 (0x3c00) KB
ext. memory above 16 MB: 32494 64 KB blocks = 2030 MB [1000000-7fedffff]
Int 15h, eax=E820h:
addr 000000000, size 00009f800, type 1 (available)
addr 0000f0000, size 000010000, type 2 (reserved)
addr 0fec00000, size 001400000, type 2 (reserved)
addr 0f0000000, size 004000000, type 2 (reserved)
addr 00009f800, size 000000800, type 2 (reserved)
addr 07fef0000, size 000010000, type 2 (reserved)
addr 000100000, size 07fde0000, type 1 (available)
addr 07fee3000, size 00000d000, type 3 (ACPI)

for 4GB:

Int 15h, ah=88h, extended memory: 0 kB
Int 15h, ax=E801h:
ext. memory below 16 MB: 15360 (0x3c00) KB
ext. memory above 16 MB: 57070 64 KB blocks = 3566 MB [1000000-dfedffff]
Int 15h, eax=E820h:
addr 000000000, size 00009f800, type 1 (available)
addr 0000f0000, size 000010000, type 2 (reserved)
addr 0fec00000, size 001400000, type 2 (reserved)
addr 0f0000000, size 004000000, type 2 (reserved)
addr 00009f800, size 000000800, type 2 (reserved)
addr 0dfef0000, size 000010000, type 2 (reserved)
addr 000100000, size 0dfde0000, type 1 (available)
addr 0dfee3000, size 00000d000, type 3 (ACPI)
addr 0dfee0000, size 000003000, type 4 (ACPI)

Then I checked how MTRRs are set with 2GB.
before:

VESA 3.0 NVIDIA [262144 kB]
LFB address: E0000000h
MTRR #0 = 000000000, 06; 080000000, 1
MTRR #1 = 07FF00000, 00; 0FFF00000, 1
MTRR #2 = 000000000, 00; 000000000, 0
MTRR #3 = 000000000, 00; 000000000, 0
MTRR #4 = 000000000, 00; 000000000, 0
MTRR #5 = 000000000, 00; 000000000, 0
MTRR #6 = 000000000, 00; 000000000, 0
MTRR #7 = 000000000, 00; 000000000, 0
MTRR area E0000000-EFFFFFFFh was set to mode: WC

after:

VESA 3.0 NVIDIA [262144 kB]
LFB address: E0000000h
MTRR #0 = 000000000, 06; 080000000, 1
MTRR #1 = 07FF00000, 00; 0FFF00000, 1
MTRR #2 = 0E0000000, 01; 0F0000000, 1
MTRR area E0000000-EFFFFFFFh was set to mode: WC

And now with 4GB.
before:

VESA 3.0 NVIDIA [262144 kB]
LFB address: E0000000h
MTRR #0 = 000000000, 06; 000000000, used
MTRR #1 = 0E0000000, 00; 0E0000000, used
MTRR #2 = 000000000, 06; 0E0000000, used
MTRR #3 = 0DFF00000, 00; 0FFF00000, used
MTRR #4 = 000000000, 00; 000000000, unused
MTRR #5 = 000000000, 00; 000000000, unused
MTRR #6 = 000000000, 00; 000000000, unused
MTRR #7 = 000000000, 00; 000000000, unused
MTRR area E0000000-EFFFFFFFh was set to mode: WC

after:

VESA 3.0 NVIDIA [262144 kB]
LFB address: E0000000h
MTRR #0 = 000000000, 06; 000000000, used
MTRR #1 = 0E0000000, 01; 0F0000000, used
MTRR #2 = 000000000, 06; 0E0000000, used
MTRR #3 = 0DFF00000, 00; 0FFF00000, used
MTRR #4 = 000000000, 00; 000000000, unused
MTRR #5 = 000000000, 00; 000000000, unused
MTRR #6 = 000000000, 00; 000000000, unused
MTRR #7 = 000000000, 00; 000000000, unused
MTRR area E0000000-EFFFFFFFh was set to mode: WC

I also tested Windows NT 4.0 with VBEMP driver and they was not affected (run fast as usual). So I dumped MTRRs with my CPUID utility and hardcoded to MTRRLFBE:

This is how WinNT 4.0 + VBEMP set MTRRs:

MTRR RAW values
MSR [00000200h] = 0000000000000006h MSR [00000201h] = 0000000F80000800h
MSR [00000202h] = 0000000080000006h MSR [00000203h] = 0000000FC0000800h
MSR [00000204h] = 00000000C0000006h MSR [00000205h] = 0000000FE0000800h
MSR [00000206h] = 00000000DFF00000h MSR [00000207h] = 0000000FFFF00800h
MSR [00000208h] = 00000000E0000001h MSR [00000209h] = 0000000FF0000800h
MSR [0000020Ah] = 00000000F0000006h MSR [0000020Bh] = 0000000FF0000800h
MSR [0000020Ch] = 0000000100000006h MSR [0000020Dh] = 0000000FE0000800h
MSR [0000020Eh] = 0000000000000000h MSR [0000020Fh] = 0000000000000000h

MTRR parsed values
VESA 3.0 NVIDIA [262144 kB]
LFB address: E0000000h
MTRR #0 = 000000000, 06; 080000000, used
MTRR #1 = 080000000, 06; 0C0000000, used
MTRR #2 = 0C0000000, 06; 0E0000000, used
MTRR #3 = 0DFF00000, 00; 0FFF00000, used
MTRR #4 = 0E0000000, 01; 0F0000000, used
MTRR #5 = 0F0000000, 06; 0F0000000, used
MTRR #6 = 000000000, 06; 0E0000000, used
MTRR #7 = 000000000, 00; 000000000, unused
MTRR area E0000000-EFFFFFFFh was set to mode: WC

And gues what? I got fast LFB even in pure DOS. So as you can see my tool set the MTRR for LFB properly (MTRR #4 = 0E0000000, 01; 0F0000000, used). But it seems to interfere with other MTRRs that was set by silly BIOS. I tried to clear them out 1 by 1 but didn't helped. Do you see the problem? Please help.

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22632 Postings in 2109 Threads, 402 registered users, 366 users online (0 registered, 366 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum