Вы находитесь на странице: 1из 3

ROM BIOS - Basic Input Output System –

The BIOS is built-in software that determines what a computer can do without accessing programs from
a disk. On PCs the BIOS contains all the code required to control the keyboard, display screen, disk
drives, serial communications, and a number of miscellaneous functions. PnP features are built into
modern BIOS chips.

BIOS Main Features

 Bootstrap Loader
 POST
 Setup Program (CMOS)

BIOS programs – drivers that help the system deal with hardware devices

 POST - Power On Self Test

One type of BIOS software, called the POST, helps test your computer each time you "power it on".

This software’s job is to "talk to" parts of the computer to find out if they are all working correctly.

 Warm boot (ctrl-alt-del) no POST


 The most noticeable POST tests are the memory, speaker and drive controller tests.
 Not exhaustive but a good first line of defense.

BOOTSTRAP LOADER

 Bootstrap loader - a microcomputer's ROM BIOS chip contains instructions to search for the
operating system, load it, and pass control to it.

CMOS - battery-powered (rated in nano-amps) memory to hold the date, time, and system setup
parameters. Usually located with the real-time clock in the motherboard chipset or in a separate real-time
clock chip.

Linux initial RAM disk (initrd) overview:

The Linux® initial RAM disk (initrd) is a temporary root file system that is mounted during system boot to
support the two-state boot process. The initrd contains various executables and drivers that permit the
real root file system to be mounted, after which the initrd RAM disk is unmounted and its memory
freed. In many embedded Linux systems, the initrd is the final root file system.

What's an initial RAM disk?

The initial RAM disk (initrd) is an initial root file system that is mounted prior to when the real
root file system is available. The initrd is bound to the kernel and loaded as part of the kernel
boot procedure. The kernel then mounts this initrd as part of the two-stage boot process to load
the modules to make the real file systems available and get at the real root file system.
The initrd contains a minimal set of directories and executables to achieve this, such as the
insmod tool to install kernel modules into the kernel.

In the case of desktop or server Linux systems, the initrd is a transient file system. Its lifetime is
short, only serving as a bridge to the real root file system. In embedded systems with no mutable
storage, the initrd is the permanent root file system. This article explores both of these contexts.

The init process:

It's Linux's first process, and parent of all the other processes. This process is the first running
process on any Linux/UNIX system, and is started directly by the kernel. It is what loads the rest
of the system, and always has a PID of 1.

The file being executed resides in /sbin/init, /etc/init, or /bin/init. If none of those are found, /bin/sh is
run as a recovery measure in case the real init got lost or corrupted. If there also the file is not found
then startup fails and the system goes to runlevel-0.

The init process examines the file /etc/inittab to determine which processes are to be
launched.From this file init gets information about runlevels, and about the processes that are
to be launched for the secific runlevel.

The /sbin/init loads all services and user specific tools and mounts all the partitions listed in /etc/fstab
and cleans /tmp.

It also starts a getty for each terminal and virtual console where user can able to log in. init will
use the fork() to make a new copy of itself and use an exec() to run the getty program. Getty
will wait for the user, then read the username. Then init will use the exec() function to run the
login program which will read the password (Some documentation says getty invokes login with
the user's name as an argument). If the password entered does not match for the user, init will
load and run getty again. If the login is successful, init will use the exec() function to run the
shell program. When the shell exits through the "logout" command, init will load and run the
getty program again. The shell is loaded by init or login and the file /etc/passwd determines the
shell to be used for the user.

The /etc/rc.d/init.d directory:

The directory /etc/rc.d/init.d contains all the commands which start or stop services which
are associated with all the run levels.

So, for a particular run level only some of the commands in /etc/rc.d/init.d runs.

All the files in /etc/rc.d/init.d have a short name which describes the services to which
they're associated. For example, /etc/rc.d/init.d/amd starts and stops the auto mount
daemon, which mounts the NFS host and devices anytime when needed.
Linux's run levels:

The run levels represent the modes in which the computer can be operated. They are
defined by a set of available services at any time they are started. Init can be in one of
eight runlevels: 0-6 and S or s. Runlevel S is not really meant to be used directly, but more
for the scripts that are executed when entering runlevel 1.

0: Halt (stops all running processes and executes shutdown)

1: Known under the name "Single-user mode". In this case the system runs with a reduced
set of services and daemons. The root file system is mounted read-only. This runlevel is
used when the others fail while booting.

2: On this level most of the services run, with the exception of network services (httpd,
named, nfs, etc). This execution level is ideal for the debug of network services, keeping
the file system shared.

3: Complete multi-user mode, with network support enabled.

4: Unused, in most of the distributions. In Slackware this level is equivalent with 3, the
only difference is that this has graphic login enabled.

5: Complete multi-user mode, with network and graphic GUI.

6: Reboot. Stops all running processes and reboots the system to the initial execution
level.

Changing the current execution level

The system boots into a runlevel specified in /etc/inittab, or to a level specified at the
LiLo prompt. To change the execution level, use the command init. For example, to
change the execution level to 3, type

init 3

To change the current execution level for example to level 3, edit /etc/inittab in a text
editor, and edit the following line:

id:3:initdefault:

Вам также может понравиться