Page address to physical address
Posted: Fri Mar 28, 2003 7:49 am
I?ve written a function which should convert a page address into a physical address. But because of any reason, my function is incorrect!
Code: Select all
;----------------------------
; Input:
; EAX - address (paged)
; ESI - address of PD
; Output:
; EAX - physical address
addr_page2phys:
push eax
push eax
and eax,0ff300000h
shr eax,22
add esi,eax
mov eax,[esi]
and eax,0fffff000h
mov esi,eax
pop eax
and eax,03ff000h
shr eax,12
add esi,eax
mov eax,[esi]
and eax,0fffff000h
pop ebx
and ebx,0fffh
add eax,ebx
ret
;----------------------------