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

kashin Lin kashin08 at gmail.com
Sat Jan 5 05:17:32 EST 2008


Hi Matthew & Geoffrey,

thanks for your apply.
after i trying that, i found the virt addr was mapped to 0x01c21000 instead
of 0x01c21400
which i expected.
does it mean the phy base addr to be mapped must be multiple of 4k
(ie. the last 12bits are 0) in okl4?


Cheers,
kashin lin

2008/1/3, Matthew Warton <mwarton at ok-labs.com>:
>
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.okl4.org/pipermail/developer/attachments/20080105/d3958ce9/attachment.htm 


More information about the Developer mailing list