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 :)