Find the answer to your Linux question:
Results 1 to 8 of 8
Hello, I need to get the big picture of what a kernel is, what it includes, when it's necessary to compile a new kernel, etc., and have the following questions: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2007
    Posts
    127

    Question [SOLVED] Big picture of the Linux kernel?


    Hello,

    I need to get the big picture of what a kernel is, what it includes, when it's necessary to compile a new kernel, etc., and have the following questions:

    • What source files do I need to compile a new kernel?
    • What's the difference between downloading source files from The Linux Kernel Archives and "apt-get install" kernel + kernel-headers? Does the latter simply make it easier to download the source files, or are the kernel source files from Ubuntu different from The Linux Kernel Archives
    • When do I need to compile a new kernel?
    • Why does the kernel contain multiple files? vmlinuz, initrd.gz, filesystem.squashfs, etc.
    • When using dynamic drivers (modules) instead of static drivers, do I need to compile a new kernel? If not, how does the kernel know about the new drivers?
    • If I simply recompile... things so that I can have a new driver, what files must I replace in a liveCD ISO file? What applications will be impacted by adding a new driver to an existing ISO image?


    Thank you for any help.

  2. #2
    Linux Engineer GNU-Fan's Avatar
    Join Date
    Mar 2008
    Posts
    935
    [*]What source files do I need to compile a new kernel?

    Either the upstream package from kernel.org or the customized source package from your distribution.

    [*]What's the difference between downloading source files from The Linux Kernel Archives and "apt-get install" kernel + kernel-headers? Does the latter simply make it easier to download the source files, or are the kernel source files from Ubuntu different from The Linux Kernel Archives
    The latter are likely to have received some minor adaptations in order to fit better into the distributions.

    [*]When do I need to compile a new kernel?
    Whenever the shipped precompiled one does not meet your requirements.

    [*]Why does the kernel contain multiple files? vmlinuz, initrd.gz, filesystem.squashfs, etc.
    vmlinuz is the kernel, compressed in order to save some space. It will be uncompressed into memory during boot. initrd.gz is a ramdisk, also compressed. A ramdisk is used to load needed drivers before the kernel is ready to access the real harddrive/CDRom in order to load modules. The dilemma is this: The kernel might need to load some modules in order to access the harddrive. But the driver for that is itself a module, so can't be loaded yet. A ramdisk solves this dilemma.
    The alternative is to compile the vital harddisk+FS drivers statically into the kernel. This is the better option if you built a kernel just for one computer with specific hardware.

    [*]When using dynamic drivers (modules) instead of static drivers, do I need to compile a new kernel? If not, how does the kernel know about the new drivers?
    You would need to recompile.
    Debian GNU/Linux -- You know you want it.

  3. #3
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    Get sources, configure and build a kernel. This will answer your questions ... and raise many new ones. This is how you learn.

    Linux Kernel Newbies

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Newbie
    Join Date
    Nov 2007
    Posts
    127
    Quote Originally Posted by GNU-Fan View Post
    You would need to recompile.
    Thanks for the tips.

    I read that it's not necessary to recompile a kernel just to add a new driver, but after using "apt-get" to install a new driver, I can't load it. Is there really no way to load a driver other than rebooting (in which case, the whole point of dynamic modules seems lost, since the user has to reboot the host just to use a new driver)?

    Code:
    1. apt-get install python-software-properties
    2. add-apt-repository ppa:bjfs/ppa
    3. aptitude update
    4. aptitude install xserver-xorg-video-nouveau
    5. dpkg -l | grep -i nouveau
    6. dpkg -L xserver-xorg-video-nouveau
    7. modprobe nouveau_drv.so
        
       "FATAL: Module nouveau_drv.so not found."
    8. modprobe /usr/lib/xorg/modules/drivers/nouveau_drv.so
        
       "FATAL: Module /usr/lib/xorg/modules/drivers/nouveau_drv.so not found."
    Thank you.

  6. #5
    Linux Engineer Segfault's Avatar
    Join Date
    Jun 2008
    Location
    Acadiana
    Posts
    877
    There is absolutely no need to reboot.
    Modules you install must belong to the running kernel, kernel generally does not load modules built for different version.
    You need to run depmod after copying over modules by hand, should be done automatically if installed with apt-get.
    modprobe is to be used with module name only, without extension.

    modprobe nouveau_drv

  7. #6
    Linux Newbie
    Join Date
    Nov 2007
    Posts
    127
    Thanks, but still no go :-/

    Code:
    # depmod 
    # modprobe nouveau_drv
    FATAL: Module nouveau_drv not found.
    Could it be that the kernel of this liveCD eg. doesn't allow adding dynamic modules, or something like that?

    If the nouveau_drv doesn't match the kernel I'm running, I guess I'll have to compile and install it manually. Can this be done without rebooting?

    Thank you.

  8. #7
    Linux Newbie
    Join Date
    Nov 2007
    Posts
    127
    Install Nouveau in Ubuntu 9.10 or lower

    "Reboot to apply changes: sudo reboot" :-/

  9. #8
    Linux Newbie
    Join Date
    Nov 2007
    Posts
    127
    Figured out how to get X running with this chipset using the "nouveau" driver insteaf of "nv".

Posting Permissions

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