Building an embedded Linux system on a VM -- compiling the kernel

Source: Internet
Author: User
Article Title: learn how to build an embedded Linux system on a VM-compile the kernel. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

1. download the kernel

· I used linux-2.4.20.tar.gz (google), copied to the working directory, and decompressed it.

Note: I have installed Redhat9.0 on the VM, downloaded it on XP, and copied it to Redhat through the shared directory of the VM.

2. configure the kernel

· Many configuration options. if you do not understand them, you have changed an option: Set the cpu structure to i386.

Make menuconfig (use other ones: xconfig and so on)

· Establish dependency

Make dep

· Compile the kernel

Make arc = i386 bzImage (you can also use zImage and vmLinuz. what's the difference? learn more)

· BzImage is generated under linux-2.4.20/arc/i386/boot.

Note: accept.

3. create an iso image

· Copy loadlin.exe bzImage to a directory and rename bzImage as vmlinuz

· Write a bat script to automatically run loadlin: loadlin vmlinuz named autoboot. bat

4. Prepare for running

· Create a new virtual machine and select a linux virtual machine

· Set the content of cdrom to an iso image

· Create a new software drive and install a DOS boot print in this software Drive. I use MSDOS710.IMG.

5. run

· Start the VM and enter DOS.

· Iso is identified as three files, namely, C:, and bzImage, from the perspective of autoboot.bat,loadlin.exe and bzImage.

· Run autoboot. bat and start the kernel. the following error occurs: cannot be attached to the root file system. Of course, an error is reported. there is no quote at all :)

So far, a kernel is running, and the next step is to sit on the root file system :)

Related Article

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.