Results 1 to 6 of 6

Thread: Does speed of compiled Kernel depends on libraries used?

  1. #1
    Join Date
    Mar 2013
    Beans
    3

    Does speed of compiled Kernel depends on libraries used?

    Hello

    There are alternatives out to libc for example newlib etc.. They are supposed to be faster. If I compile a Kernel with that light weight libraries, will the kernel and system run faster? Some of the libraries have not all functions of libc, will then some software not run properly?

    Thanks for explaining
    Florian

  2. #2
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Does speed of compiled Kernel depends on libraries used?

    I think you may be misunderstanding what a kernel does. The kernel is simply the first program (and it is not a program in the normal sense) that gets loaded from your storage medium. It can't use any external libraries at all, as those would have to be loaded from disk, without knowing where on the disk they are yet!

    So no, compiling a kernel won't depend upon the libraries used, mostly because there aren't any.

    However, if you meant the userspace programs, (everything except the kernel and its modules), then compiling against a different C standard library may or may not give quicker programs, it depends upon whether the program in question actually uses libc, and/or whether it uses it extensively. To be honest, there are so many separate programs that it's not worth the effort, and you can just trust that the libc standard implementation is 'good enough'.

  3. #3
    Join Date
    Mar 2013
    Beans
    3

    Re: Does speed of compiled Kernel depends on libraries used?

    Thank you for the explanation!
    I'm setting up a cross compiling environment for Arm and so I have to choose which library to use. I suppose when the Kernel is compiled there will be usage of the functions of the library and therefore I thought there would be a difference in the compiled Kernel! Perhaps you could give me some advice regarding to this!

    Best regards and thanks!
    Florian

  4. #4
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Does speed of compiled Kernel depends on libraries used?

    Quote Originally Posted by Flo89 View Post
    Thank you for the explanation!
    I'm setting up a cross compiling environment for Arm and so I have to choose which library to use. I suppose when the Kernel is compiled there will be usage of the functions of the library and therefore I thought there would be a difference in the compiled Kernel! Perhaps you could give me some advice regarding to this!

    Best regards and thanks!
    Florian


    Nope, there isn't any usage of C standard library functions in the kernel as far as I know. For the commonly-used generic ones (like, say, strcmp), they tend to write/copy their own and compile it in. For things like file functions, there isn't any point, as the kernel doesn't really know about files except at the hardware levels.

    There is no difference if you want to make your kernel faster, as you (probably) won't use libc at all for the kernel. If you want to do that, compile the kernel with the menu-based make
    utility:

    Code:
    make menuconfig
    And only select what you require for the hardware you have. This will markedly ​increase performance.

  5. #5
    Join Date
    Mar 2013
    Beans
    3

    Re: Does speed of compiled Kernel depends on libraries used?

    Thank you, my friend

    I'm sure you have remarked that I'm not fimiliar with that kind of stuff (coming from µC world without operating system) but with the help of people like you and some good books I'm sure this will work... In some days

  6. #6
    Join Date
    Jun 2011
    Location
    United Kingdom
    Beans
    Hidden!
    Distro
    Lubuntu Development Release

    Re: Does speed of compiled Kernel depends on libraries used?

    Quote Originally Posted by Flo89 View Post
    Thank you, my friend

    I'm sure you have remarked that I'm not familiar with that kind of stuff (coming from µC world without operating system) but with the help of people like you and some good books I'm sure this will work... In some days


    Good luck in your quest! Without an operating system seems terrifying to me, but no doubt I'll have to get used to that at some point as well.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •