Compile a Linux 3.1.0 kernel that supports xen

Source: Internet
Author: User
Document directory
  • Processor types and features -->

This is my first time to fully compile the Linux kernel ...... However, starting from the higher version, many problems in the old kernel have been fixed by developers, but they are easier. Add xen support to the kernel.

From version 2.6.39, the kernel can support xen dom0 and domu directly without patches.But it is not easy to change the xen-related compilation options. Maybe I am not used to the kernel compilation method.


Environment: gcc4.5 processor Pentium D e2140 (the old processor does not support hvm and can be used together)


After downloading the Linux 3.1.0 kernel, sudo make menuconfig enters the configuration screen.

1. Configuration

Processor types and features --> Processor family selects Pentium 4 (the highest value is selected based on the actual situation. The old processor cannot)

The maximum memory size of the high memory support below is 64 GB,In this case, a hidden option is displayed:

PAE supportThis option is automatically selected.

Go to paravirtualized guest support, and a hidden option is displayed.

Xen guest support(=) Select!

The compiled kernel can be either dom0 or domu. The kernel automatically adapts.

Finally, let's take a look at other options to remove the AMD processor.

2. Installation

After configuration, make or

sudo make -j5 bzImagesudo make -j5 modules

-JN can open n threads make. N = 3-5

sudo make modules_install 

(This step will overwrite existing modules/lib/modules, and some drivers may have problems)

Then copy the. config, system. Map and arch/x86/boot/bzimage under the/usr/src/linux-3.1.0 to/boot and rename it the config-3.1.0 system. Map-3.1.0 vmlinuz-3.1.0.

sudo cp -a .config /boot/config-3.1.0sudo cp -a System.map /boot/System.map-3.1.0sudo cp arch/x86/boot/bzImage /boot/vmlinuz-3.1.0

Create initrd

Sudo Update-initramfs-C-v-K 3.1.0 // create a new initramfs startup, generating initrd. img-3.1.0

Update grub

sudo grub-mkconfig

Automatically Generated

 ### BEGIN /etc/grub.d/20_linux_xen ###Found linux image: /boot/vmlinuz-3.1.0Found initrd image: /boot/initrd.img-3.1.0menuentry 'Ubuntu GNU/Linux, with Linux 3.1.0 and XEN syms-4.1.2' --class ubuntu --class gnu-linux --class gnu --class os --class xen {insmod part_msdos insmod ext2 set root='(hd0,msdos6)' search --no-floppy --fs-uuid --set 8396057b-e888-4868-a754-27a816cae53d echo 'Loading Linux 3.1.0 ...' multiboot /boot/xen-syms-4.1.2 placeholder module /boot/vmlinuz-3.1.0 placeholder root=UUID=8396057b-e888-4868-a754-27a816cae53d ro quiet splash echo 'Loading initial ramdisk ...' module /boot/initrd.img-3.1.0} 

After the check is complete, write the configuration file to grub. cfg.

sudo grub-mkconfig -o /boot/grub.cfg

3. Install the NVIDIA official graphics card driver

Download the NVIDIA-Linux-x86-285.05.09.run installation file on the official website. (It is strongly recommended that you download the installation instructions and save them as TXT files to facilitate viewing on the console interface.) restart and enter the newly compiled Ubuntu GNU/Linux, with Linux 3.1.0 and xen 4.1.2 startup options, start a new kernel. No video card driver. Run sudo Sh./NVIDIA-Linux-x86-285.05.09.run, follow the prompts all the way to yes can be successfully installed. (If you're lucky enough to restart, you can enter the graphic interface. However, there is another problem: the window title will disappear and the problem persists: Modify the/etc/X11/Xorg. conf file (back up first ),
Section "Screen"    Identifier     "Screen0"    Device         "Device0"    Monitor        "Monitor0"    DefaultDepth    24    Option         "AddARGBGLXVisuals" "True"    SubSection     "Display"        Depth       24    EndSubSectionEndSectionSection "Extensions"    Option         "Composite" "Enable"EndSection

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.