How to map 0xB8000..0xBFFFF at 68GB+16MB=(0x1101000000) ?
My code is:
MaxMem dd 64 ;64GB
MemoryStart dd 1024*1024 ;1M
push 0
pop fs
mov eax,[MaxMem]
shl eax,12
lea ebx,[eax+512*8*(2+1)]
mov ebp,ebx
push ebx
mov eax,[MemoryStart]
mov ebx,eax
lea eax,[ebx+4*1024-1] ;\ Align to 4*1024
and ax,not (4*1024-1) ;/
mov [PML4],eax
add eax,4*1024
mov [PDP],eax
add eax,4*1024
mov [PDT],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 ecx,[PDT]
or bl,7
or cl,7
mov [fs:eax+8*000],ebx
;Fill page tables
mov eax,[PDP]
xor edx,edx
.1:
mov [fs:eax+8*edx],ecx
add ecx,4*1024
inc edx
cmp edx,[MaxMem]
jb .1
mov eax,2*1024*1024
movd mm1,eax
mov eax,PT_AVL+PT_PS+PT_U+PT_W+PT_P ;Start from 1st 0..2MB-1
movd mm0,eax
mov ecx,[MaxMem]
shl ecx,9
mov eax,[PDT]
.0:
movq [fs:eax],mm0
paddq mm0,mm1
add eax,8
loop .0
mov eax,[AddrLFB]
or eax,eax
jz @F
or eax,PT_AVL+PT_PS+PT_U+PT_W+PT_P
movd mm0,eax
mov edx,[PDT]
add edx,(68 shl 9)*8
mov ecx,8
.2:
movq [fs:edx],mm0
paddq mm0,mm1
add edx,8
loop .2
mov eax,0xB8000+PT_AVL+PT_U+PT_W+PT_P
movd mm0,eax
movq [fs:edx],mm0
@@: