Question about the paging
Posted: Mon Apr 23, 2018 8:10 am
Question about the paging.
I map first (64+8)GB memory 1:1
Whether it is possible to mix 1GB pages and 4KB pages?
How to map video memory from 0xA0000-0xAFFFF at 0x1101000000 (68G+16M)?
I map first (64+8)GB memory 1:1
Whether it is possible to mix 1GB pages and 4KB pages?
How to map video memory from 0xA0000-0xAFFFF at 0x1101000000 (68G+16M)?
Code: Select all
MaxMemV = 64+8 ;72GB
mov ebx,512*8*(1+1)
push ebx
mov ebx,1024*1024 ;CR3=1M
mov [PML4],ebx
lea eax,[ebx+4096]
mov [PDP],eax
pxor mm0,mm0
pop ecx
shr ecx,3
@@:
dec ecx
movq [fs:ebx+ecx*8],mm0
jnz @B
mov eax,[PML4]
mov ebx,[PDP]
mov edx,ebx
or bl,7
mov [fs:eax+8*000],ebx
mov eax,1024*1024*1024
movd mm1,eax
mov eax,1187h
movd mm0,eax
;Fill page tables
xor ecx,ecx
.1:
movq [fs:edx+8*ecx],mm0
paddq mm0,mm1
inc ecx
cmp ecx,MaxMemV
jb .1