Библиотека сайта rus-linux.net
Take a moment to skim through the Bootdisk-HOWTO or the From-PowerUp-to-BASH-Prompt-HOWTO. These HOWTO documents can be found online at http://www.tldp.org/docs.html#howto. Both documents offer an excellent view of what it takes to get a GNU/Linux system up and running. There is also a lot of information to digest. Remember that one of our goals is, "keep it simple to avoid stressing out," so we want to ignore everything but the absolutely critical pieces of a boot / root diskset.
Basically it boils down to the following required items:
A boot loader
The Linux kernel
We don't even need an init daemon. The kernel can be told to run the shell directly by passing it an option through the boot loader.
For easy construction we will build a two-disk boot / root set rather than trying to get everything onto a single diskette. The boot loader and kernel will go on the boot disk and the shell will reside on the root disk.
For the boot disk we simply need to install the GRUB bootloader and a Linux kernel. We will need to use a kernel that does not require modules for the hardware we need to access. Mainly, it should have compiled-in support for the floppy drive, ram disk, second extended filesystem, proc filesystem, ELF binaries, and a text-based console. If such a kernel is not available, it will need to be built from source code. Kwan Lowe's Kernel Rebuild Guide is a good reference for this task, however we can ignore the sections that deal with modules and the initial ramdisk.
For the root disk we will need a floppy that has been prepared
with a filesystem. We will also need a BASH shell that is
statically-linked so we can avoid the additional complexities of shared
libraries. The configure program in the BASH source
code recognizes the
--enable-static-link option for
this feature. We will also be using the
--enable-minimal-config option to keep the BASH binary
down to a manageable size. Additional requirements for the root disk are
/dev directory and a device file for the console.
console device is required for BASH to be able
to communicate with the keyboard and video display.
There is one other, less obvious requirement to keep in mind and
that is CPU compatibility. Each generation of CPU features a more
complex architecture than its predecessor. Late generation chips have
additional registers and instructions when compared to an older 486 or
386. So a kernel optimized for a new, fast 6x86 machine will not run on
an older box. (See the
README file in the Linux
kernel source code for details.) A BASH shell built for a 6x86 will
probably not run on an older processor either. To avoid this problem, we
can choose the 386 as a lowest common denominator CPU and build all the
code for that architecture.