Linux Device Driver learning-kernel Compilation

Source: Internet
Author: User

Linux Kernel version 3.2.0 (uname-r can be viewed)
Ubuntu version 10.04 (view method http://www.bkjia.com/ OS /201203/122509.html)


Download the kernel version at http://www.kernel.org/
Decompress to a path, I decompress to/usr/src, any path should be OK, the folder name is linux-3.2
# Linux-3.2/cd/usr/src/
You can use make menuconfig, make xconfig, and other commands to configure the kernel. For more information, see http://lamp.linux.gov.cn/linux/kernel_options.html.
Compile the kernel
# Make
It may take several hours
Installation module and Kernel
# Make modules_install
# Make install
Update grub
Two methods
# Grub_mkconfig
Or
# Update-grub
Then, check the startup items in/boot/grub. cfg, which is about 60 rows.
I added the following content:
Menuentry 'ubuntu, Linux 3.2.0 '-- class Ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 6f9dd836-7461-4b59-84ca-eff8707297e1
Linux/boot/vmlinuz-3.2.0 root =/dev/sda3 ro quiet splash
}
Menuentry 'ubuntu, Linux 3.2.0 (recovery mode) '-- class Ubuntu -- class gnu-linux -- class gnu -- class OS {
Recordfail
Insmod ext2
Set root = '(hd0, 3 )'
Search -- no-floppy -- fs-uuid -- set 6f9dd836-7461-4b59-84ca-eff8707297e1
Echo 'Load Linux ...'
Linux/boot/vmlinuz-3.2.0 root =/dev/sda3 ro single
Echo 'Load the boot virtual disk ...'
}
Restart the computer and select this option to enter the newly compiled kernel.
It seems very simple, and I have been worried about it for several days. I did not know whether grub was to be updated. If I had a command, I went to the file myself. I copied a copy and modified it. It should have been wrong, each time I select the kernel, It is a kernel panic. I once suspected that there was a problem when I configured the kernel and compiled it countless times ....
Thanks to zjc and gmy for their help.
 
From bjutstar's column
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.