DIY a mini Linux system

Source: Internet
Author: User
Tags ide hard drive

This article will lead you to build a mini Linux system. It takes up much less than 16M of hard disk space, but includes the XFree86 X window Window System.

Goal

The mini Linux system that this article builds can only run on a specific single computer, and if readers are interested, the system can be built on a general-purpose system that can plug and Play on most conventional PCs. But this is no longer the topic of this article, and if readers are interested, you can discuss the details with me through my email.

Our target Linux system runs on an ordinary Intel 386 PC, can have a hard drive, or not a hard drive, instead of a Flash disk. If you use flash disk, you need to be able to support from the Flash disk boot, and the size of the flash disk in 16M bytes or more. We hope that when the user starts up, they go directly to the X Window graphical interface and run the specified program in advance. Users are not required to enter a user name and password to log on.

The goal we set is a bit like an X-Terminal terminal workstation. A little improvement, but also can be made simply diskless form, that is, even 16M of Flash disk also do not. However, this is beyond the topic of this article. If you are interested, you can write and discuss with me.

System boot

Since we have to consider booting from the Flash disk, we opted to use LILO as our boot Loader instead of GRUB. This is taken into account that grub has a strong ability to recognize hard disk and file system, and Flash disk is not the standard hard drive, and our choice of file system grub is not necessarily known, bad words grub will be self-defeating. And LILO is much simpler, it began in the hard disk of the MBR to write a small program, this small program does not go through the file system, directly from the hard disk sector area code, read out Kernel Image loaded into memory. In this way, the Pau is greatly increased. And also gives us the freedom to choose the file system. So, how do we install LILO?

First, we're looking for an ordinary 800M IDE hard drive that connects to the IDE line on the target machine. In this way on our target machine, IDE1 is hanging on the Flash disk, IDE2 hanging on a working hard disk. We use standard steps to mount a Debian gnu/linux system on IDE2 's standard hard drive. Of course, if your readers don't have Debian on hand, you can also install the Red Hat system. After you have installed your work system, you should first do some job cuts, eliminating unnecessary Service and X Window and so on. The purpose of this is to improve the system start-up speed, because we in the back of the work, we must constantly restart the machine, so the start speed is very important to our efficiency.

After installing the working system, make a EXT2 file system on the FALSH disk, this command can be completed with MKE2FS. Because the Flash disk is connected to the IDE1, so in Linux, its identity is/dev/hda. The author of this article in the operation, the entire Flash disk division of an entire partition, so, when the call MKE2FS, the processing is/dev/hda1. Readers should be able to do a Ext2 file system directly on the/DEV/HDA without partitioning them beforehand.

After you have done the file system on the flash disk, you can copy a compiled kernel image file Vmlinuz to the flash disk. Note that you must first copy the Vmlinuz image file to the Flash disk before you can install LILO on the flash disk. Otherwise, LILO will Lililili, because it will not find Kernel Image on the flash disk position, so the flash disk will not start up. Also, if the reader friends in the Flash disk is a compressed file system, then LILO will also be problematic, although it can correctly find Kernel Image on the hard disk's starting position, but it has no way to deal with the file system again compressed this Kernel Image And don't know how to expand it into memory.

After Kernel Image is copied, we can edit a copy of the lilo.conf file, which can be put on the work system. However, note that the path to the file name indexed in lilo.conf can be written to. These path names are the pathname that appears on the working system. For example, if the Flash disk is Mount under the/mnt directory, then in lilo.conf, the Vmlinuz path name is/mnt/vmlinuz. Don't be mistaken about this. Otherwise, if you accidentally destroy the work system's LILO, that would be troublesome. Edit the lilo.conf, then run the Lilo command, and notice that you want to tell it to use this new lilo.conf file instead of/etc/lilo.conf.

After the LILO is installed, we can restart it immediately and test it. First in the BIOS, set to start from the IDE1, if we see the Lilo prompts, press Enter and then see the Kernel output message, this is the installation of Lilo success. Remember this method of operation, each time we update the Flash disk Kernel Image, remember to update LILO. In other words, to rerun the Lilo command again.

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.