[okl4-developer] How to know the phys addr mapping of a virt addr?

Matthew Warton mwarton at ok-labs.com
Thu Jan 3 09:34:58 EST 2008


Hi Kashin,

virt_to_phys only works on limited cases of kernel addresses above  
0xF0000000. A more complete function that actually consults a  
particular page table (and can hence be used for other kernel  
addresses and user addresses as well) is  
generic_space_t::lookup_mapping in pistachio/src/ 
linear_ptab_walker.cc.  For an example of it's use see pistachio/src/ 
space.cc.

Cheers,
Matthew Warton


On 03/01/2008, at 12:07 AM, Geoffrey Lee wrote:

> On Wed, Jan 02, 2008 at 08:16:54PM +0800, kashin Lin wrote:
>> Hi,
>>
>> are there any function in pistachio that i can call to transfer a  
>> virt addr
>> to
>> phys addr ( which header i should include)?
>>
>> i modify the timer's driver codes in src/platform/ to adapt okl4  
>> to my
>> target, but got
>> the wrong timer behavior. i wonder if i write to the wrong  
>> address. so i
>> need a way to
>> know if the virt addr i used is mapped to the timer's base phy addr.
>
> Hi
>
> There is a virt_to_phys().
>
> If you can get far enough to get the kernel debugger initialized  
> you can
> just dump the kernel pagetable to find out where your timer is mapped.
>
> 	-gl
>
>> _______________________________________________
>> Developer mailing list
>> Developer at okl4.org
>> https://lists.okl4.org/mailman/listinfo/developer
>
>
>
> _______________________________________________
> Developer mailing list
> Developer at okl4.org
> https://lists.okl4.org/mailman/listinfo/developer




More information about the Developer mailing list