Find the answer to your Linux question:
Results 1 to 9 of 9
Hi, I wanted to know that, how the kernel .config file options are related to source code of kernel....
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2010
    Posts
    44

    Lightbulb Relation between kernel config file and kernel source


    Hi,

    I wanted to know that, how the kernel .config file options are related to source code of kernel.

  2. #2
    Linux Newbie nplusplus's Avatar
    Join Date
    Apr 2010
    Location
    Charlotte, NC, USA
    Posts
    106
    It is my understanding that the .config file indicates which flags and options are to be passed to the compiler during kernel compilation. So, all of those options, which normally take an =y, =n, or =m, indicate all of the features the kernel will have once built. "y" means it should have the feature built in, "n" means it should not, and I believe "m" means the compilation process should build a module for it.

    The more y's you have, the more space in memory your kernel will take when it runs.

  3. #3
    Linux Newbie
    Join Date
    Jun 2004
    Location
    Halesowen, West Midlands, UK
    Posts
    107
    Quote Originally Posted by nplusplus View Post
    It is my understanding that the .config file indicates which flags and options are to be passed to the compiler during kernel compilation. So, all of those options, which normally take an =y, =n, or =m, indicate all of the features the kernel will have once built. "y" means it should have the feature built in, "n" means it should not, and I believe "m" means the compilation process should build a module for it.

    The more y's you have, the more space in memory your kernel will take when it runs.
    Quite correct in all respects. A module gets loaded automatically if the hardware is present or when you plug the hardware in, e.g plugging a USB device in will cause the module to be loaded for it.

  4. #4
    Just Joined!
    Join Date
    Dec 2010
    Posts
    44
    Thanks Siddly,

    But what I want to know is, Is there any generic way to find which option of .config file activates which part of code(file) and how it is.

  5. #5
    Just Joined!
    Join Date
    Apr 2011
    Posts
    6

    Relation between kernel config file and kernel source

    You want to customize the kernel to your PC to make it smaller and faster.
    Configuring a custom kernel is quite long and tedious (but building a customized config file, of course, is fast say 1-2 hours).

    You need to know the hardware details of your CPU and peripherals/drivers
    so you can choose which specific kernel feature you only need. The shell
    commands below would give you this info and store data in the corresponding
    files at current directory (or provide pathname to store them somewhere else):

    host]$ lspci > hardware.info
    host]$ cat /proc/cpuinfo > cpu.info

    I hope this helps.

  6. #6
    Just Joined!
    Join Date
    Dec 2010
    Posts
    44
    OK, lets come to the main aim...

    I just want to understand nfs part of the kernel code(don't want to customize), how it is implemented and how code works, and all ...

    Can any body help me....

  7. #7
    Linux Newbie
    Join Date
    Apr 2010
    Location
    Novosibirsk, Russia
    Posts
    145
    If you a "kernel hacker" - it would be easier to read some kernel docs, instead of digging code by yourself You can try to read kernel documentation, shipped with kernel sources, or begin to read The Linux Kernel . When you will be aware how kernel works in some details, I suppose, it would not be painful to look into source code

  8. #8
    Linux Enthusiast Bemk's Avatar
    Join Date
    Sep 2008
    Location
    Oosterhout-NB, Netherlands
    Posts
    525
    I think you'd be better of punching a query in Google. As I'm working on my own OS, the workings of an NFS also tend to interest me. I find osdev.org to be quite a handy resource.

    This page doesn't contain much useful info itself but the references mentioned just might.

  9. #9
    Linux Newbie
    Join Date
    Jun 2004
    Location
    Halesowen, West Midlands, UK
    Posts
    107
    You can get a good idea from "make xconfig" or "make menuconfig" and using the help which describes what each option does.Even when rebuilding an existing kernel it's a good idea to disable options for harware that's not on your system, that way you can have a smaller kernel that's specific to your hardware.Most distro kernels come configured for everything so everyone gets a working kernel for whatever hardware that's on their box. It just means a much larger kernel than is necessary for individual hardware configurations.

Posting Permissions

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