/proc/ksyms and /proc/kallsyms relationship? - Kernel

This is a discussion on /proc/ksyms and /proc/kallsyms relationship? - Kernel ; / newbie question below, if not interested, please ignore / Hello, In kernel 2.4, there was a /proc/ksyms file. This file, if I understand correctly, was a method to access the kernel's public symbol table. What was displayed had all ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: /proc/ksyms and /proc/kallsyms relationship?

  1. /proc/ksyms and /proc/kallsyms relationship?

    / newbie question below, if not interested, please ignore /

    Hello,

    In kernel 2.4, there was a /proc/ksyms file. This file, if I understand
    correctly, was a method to access the kernel's public symbol table. What
    was displayed had all the public kernel's symbols (variables,
    functions..) and its associated global addresses, along with some other
    usefull stuff, like a CRC value, and the module exporting every specific
    symbol.
    Fine until this point.

    In 2.6 kernels, /proc/ksyms disappeared. Many sources suggest that it
    was replaced by the /proc/kallsyms file.
    BUT this file seems to be something completely different, and I haven't
    figured out in what way it is different. It seems that it's not the
    kernels public symbols table.

    So, some questions to anyone that knows more on this:

    1. Is my description of the functionality of /proc/ksyms in 2.4 kernels
    correct?

    2. What exactly the /proc/kallsyms file contains? Why does this file
    exist and how is it used?

    3. Why was there this change in name and behavior of the file?

    4. If one wants to find out what are the exported symbols from some
    module, so to know which symbols can he use in a future module, how can
    he achieve this?

    From what I understand about /proc/kallsyms, it contains even the
    symbols that are not exported using EXPORT_SYMBOL(symbol_name).
    /proc/ksyms, contained every symbol except those that were not
    exported (considering the export all default policy in 2.4, in contrast
    with the export none policy of 2.6)

    /I've already asked about this in kernelnewbies mailing list, but did
    not get any useful answer. I also could not find any usefull answers
    anywhere on new (and in kernel books). Most references say "just use
    /proc/kallsyms instead of /proc/ksyms.

    Sorry for the extra long post
    Thanks & regards
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

  2. Re: /proc/ksyms and /proc/kallsyms relationship?

    On Mon, 10 Nov 2008 03:00:16 +0200,
    John K wrote:
    >In kernel 2.4, there was a /proc/ksyms file. This file, if I understand
    >correctly, was a method to access the kernel's public symbol table. What
    >was displayed had all the public kernel's symbols (variables,
    >functions..) and its associated global addresses, along with some other
    >usefull stuff, like a CRC value, and the module exporting every specific
    >symbol.
    >Fine until this point.
    >
    >In 2.6 kernels, /proc/ksyms disappeared. Many sources suggest that it
    >was replaced by the /proc/kallsyms file.
    >BUT this file seems to be something completely different, and I haven't
    >figured out in what way it is different. It seems that it's not the
    >kernels public symbols table.
    >
    >So, some questions to anyone that knows more on this:
    >
    >1. Is my description of the functionality of /proc/ksyms in 2.4 kernels
    >correct?


    Yes.

    >2. What exactly the /proc/kallsyms file contains? Why does this file
    >exist and how is it used?


    kallsyms contains (as the name suggests) all the global symbols in the
    kernel and the loaded modules. It was originally added for kernel
    debugging but it became so useful that it supplanted ksyms.

    >4. If one wants to find out what are the exported symbols from some
    >module, so to know which symbols can he use in a future module, how can
    >he achieve this?


    nm | grep __ksymtab

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

  3. Re: /proc/ksyms and /proc/kallsyms relationship?

    On Mon, 10 Nov 2008 03:00:16 +0200
    John K wrote:

    > 4. If one wants to find out what are the exported symbols from some
    > module, so to know which symbols can he use in a future module, how
    > can he achieve this?


    you as developer can do a grep on the kernel source for
    EXPORT_SYMBOL ...

    and the module loader will also tell you if you use a symbol that's not
    exported....

    but realistically if you use the standard APIs you're not going to find
    symbols that aren't exported... what kind of driver are you trying to
    write?

    --
    Arjan van de Ven Intel Open Source Technology Centre
    For development, discussion and tips for power savings,
    visit http://www.lesswatts.org
    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

+ Reply to Thread