[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tracking adresses of write and read
On Wed, May 16, 2001 at 05:34:06PM +0200, Fabrice Gautier wrote:
> On Wed, 16 May 2001 15:24:05 +0200
> Erik Mouw <J.A.K.Mouw@ITS.TUDelft.NL> wrote:
> > > I would like to be abble to see which physical adress i'm
> > > writing/reading to when I write/read in the mmap-ed memory.
> > >
> > > Who could i do this?
> >
> > My guess:
> >
> > unsigned long phys_addr;
> >
> > phys_addr = virt_to_phys(virtual_address);
> > printk(KERN_INFO "%s: phys_addr = 0x%08x\n", __FUNCTION__, phys_addr);
>
>
> Err.. Can I do this in the user space program??? That's where i'm doing
> the reads/writes
No. The userland program shouldn't even *care* about the physical
address. As long as the kernel does the physical to virtual mapping
correct the userland program should work.
> I think both virt_to_phys and printk are kernel functions, not syscall
> or libc function.
What did you expect on a mailing list with "kernel" in its name? :)
Erik
--
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031, 2600 GA Delft, The Netherlands
Phone: +31-15-2783635 Fax: +31-15-2781843 Email: J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/
-
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/
IRC Channel: irc.openprojects.net / #kernelnewbies
Web Page: http://www.kernelnewbies.org/