Re: /dev/kmem

From: George Anzinger (george@pioneer.net)
Date: Sat May 06 2000 - 06:13:07 EDT

  • Next message: Manfred Spraul: "Re: [patch-2.3.99-pre7-6] O_SYNC Reactivation"

    Tigran Aivazian wrote:
    >
    > On Fri, 5 May 2000, Michal Kosek wrote:
    > > On Fri, 5 May 2000, Tigran Aivazian wrote:
    > >
    > > > On Fri, 5 May 2000, Michal Kosek wrote:
    > > > > I want to learn something about using of /dev/kmem.
    > > >
    > > > The idea of /dev/kmem is that file "offsets" in it correspond to kernel
    > > > virtual addresses, so seeking to the addresses of "well-known" symbols and
    > > > reading values off there gives you the values of kernel data
    > > > structures. Of course, these values are not 100% self-consistent because
    > > > the kernel data structures change while you are reading/writing them.
    > > Yes, but how can I know what is offset of any specific structure I want to
    > > read??
    >
    > generally, under UNIX you would use nlist(3C) on /stand/unix. Under Linux
    > you get the offset by looking at System.map file or, much better, by
    > using:
    >
    > ksymoops -s map < /dev/null
    >
    > and examining the map file which contains addresses of the modules'
    > symbols also. If you look at lsof(8) source code, I vaguely remember it
    > has some very nice interface that does the symbol manipulation for you
    > which can be cut-and-pasted into your own program. Also, the MCL crash I
    > mentioned contains a useful set of functions that manipulate kernel
    > symbols - can be "borrowed" too as all this stuff is GPL.
     
    ...............snip............
    Ok, the basic idea is to look at the System.map file right?

    Now I am doing a lot of kernel testing and have more than one kernel on
    a system, using lilo to pick and choose. What is the usual method used
    to insure that the correct System.map file is avaiable to each system?
    I assume one set up a link to it at boot time, but how is this usually
    organized? For example, in my case I download the new kernel to the
    test system, run lilo and then reboot. I assume I should also download
    the System.map file, but how does the boot script know which system
    booted?

    George

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Sat May 06 2000 - 06:17:35 EDT