Find the answer to your Linux question:
Results 1 to 5 of 5
hi, I am reading this book Linux Device Drivers 3rd edition(alessandro rubini) ,in the second chapter about 'Building and Running Modules' , the book says that ------------------------- % make make[1]: ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2006
    Posts
    3

    Question Need Help in configuring and building kernel 2.6.16.18


    hi,
    I am reading this book Linux Device Drivers 3rd edition(alessandro rubini) ,in the second chapter about 'Building and Running Modules' , the book says that
    -------------------------
    % make
    make[1]: Entering directory `/usr/src/linux-2.6.10'
    CC [M] /home/ldd3/src/misc-modules/hello.o
    Building modules, stage 2.
    MODPOST
    CC /home/ldd3/src/misc-modules/hello.mod.o
    LD [M] /home/ldd3/src/misc-modules/hello.ko
    make[1]: Leaving directory `/usr/src/linux-2.6.10'
    % su
    root# insmod ./hello.ko
    Hello, world
    root# rmmod hello
    Goodbye cruel world
    root#

    Please note once again that , for the above sequence of commands to work,you must
    have a properly configured and built kernel tree in a place where the makefile is able to
    find it(/usr/src/linux-2.6.10 in the example shown).

    ----------------------------
    what does it means to have a configured and built kernel? , does it mean that i need
    to compile the kernel?
    I have the source of kernel 2.6.16.18 in the /root directory,
    how do i configure and build it?
    Please help I am totally new to device drivers!

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    what does it means to have a configured and built kernel? , does it mean that i need to compile the kernel?
    If you booted into Linux you have a configured and built kernel, it may not have optimal settings but it should do.
    I have the source of kernel 2.6.16.18 in the /root directory,
    how do i configure and build it?
    Did you download an rpm file or the actual kernel source code from kernel.org?
    install rpm files as root.
    rpm -Uhv filename.rpm
    If its actual sourcecode, then yes you'll need to compile that.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Just Joined!
    Join Date
    Oct 2006
    Posts
    3
    I have placed the kernel sources in /usr/src/linux-2.6.16.18 directory.
    I tried to compile the kernel using these commands :

    # make xconfig
    # make bzImage
    # make modules
    # make modules_install
    # cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.16.18
    # mkinitrd /boot/initrd-2.6.16.18.img 2.6.16.18
    # make install

    But when i boot into the OS with the new kernel, it gives an error at the boot time "Kernel Panic, attempted to kill init.........." ,and the OS doesn't boot! please tell me where i am wrong!

    thanks.

  4. #4
    Just Joined!
    Join Date
    Oct 2006
    Posts
    3
    sorry for the double posts!!!

  5. #5
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    I think the problem here could be that, Fedora doesn't use
    make bzimage
    cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.16.18
    mkinitrd /boot/initrd-2.6.16.18.img 2.6.16.18
    When you type
    make install
    it does it for you.
    Try again and omit these steps.
    EDIT: also Fedora uses the /usr/src/kernels/version-number directory and NOT /usr/src/linux
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

Posting Permissions

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