<s>
The	O
multi-stage	O
booting	B-Application
process	I-Application
of	I-Application
Linux	I-Application
is	O
in	O
many	O
ways	O
similar	O
to	O
the	O
BSD	B-Operating_System
and	O
other	O
Unix-style	O
boot	B-Operating_System
processes	B-Operating_System
,	O
from	O
which	O
it	O
derives	O
.	O
</s>
<s>
Booting	B-Operating_System
a	O
Linux	B-Operating_System
installation	O
involves	O
multiple	O
stages	O
and	O
software	O
components	O
,	O
including	O
firmware	B-Application
initialization	O
,	O
execution	O
of	O
a	O
boot	B-Application
loader	I-Application
,	O
loading	O
and	O
startup	O
of	O
a	O
Linux	B-Operating_System
kernel	I-Operating_System
image	O
,	O
and	O
execution	O
of	O
various	O
startup	O
scripts	B-Language
and	O
daemons	B-Operating_System
.	O
</s>
<s>
For	O
each	O
of	O
these	O
stages	O
and	O
components	O
there	O
are	O
different	O
variations	O
and	O
approaches	O
;	O
for	O
example	O
,	O
GRUB	B-Application
,	O
coreboot	B-Device
or	O
Das	B-Language
U-Boot	I-Language
can	O
be	O
used	O
as	O
boot	B-Application
loaders	I-Application
(	O
historical	O
examples	O
are	O
LILO	B-Application
,	O
SYSLINUX	B-Application
or	O
Loadlin	B-Application
)	O
,	O
while	O
the	O
startup	O
scripts	B-Language
can	O
be	O
either	O
traditional	O
init-style	O
,	O
or	O
the	O
system	O
configuration	O
can	O
be	O
performed	O
through	O
modern	O
alternatives	O
such	O
as	O
systemd	B-Application
or	O
Upstart	B-Device
.	O
</s>
<s>
Early	O
stages	O
of	O
the	O
Linux	B-Application
startup	I-Application
process	I-Application
depend	O
very	O
much	O
on	O
the	O
computer	O
architecture	O
.	O
</s>
<s>
IBM	O
PC	O
compatible	O
hardware	B-Architecture
is	O
one	O
architecture	O
Linux	B-Operating_System
is	O
commonly	O
used	O
on	O
;	O
on	O
these	O
systems	O
,	O
the	O
BIOS	B-Operating_System
plays	O
an	O
important	O
role	O
,	O
which	O
might	O
not	O
have	O
exact	O
analogs	O
on	O
other	O
systems	O
.	O
</s>
<s>
In	O
the	O
following	O
example	O
,	O
IBM	O
PC	O
compatible	O
hardware	B-Architecture
is	O
assumed	O
:	O
</s>
<s>
The	O
BIOS	B-Operating_System
performs	O
startup	O
tasks	O
like	O
the	O
Power-on	B-Device
self-test	I-Device
specific	O
to	O
the	O
actual	O
hardware	B-Architecture
platform	O
.	O
</s>
<s>
Once	O
the	O
hardware	B-Architecture
is	O
enumerated	B-Language
and	O
the	O
hardware	B-Architecture
which	O
is	O
necessary	O
for	O
boot	B-Operating_System
is	O
initialized	O
correctly	O
,	O
the	O
BIOS	B-Operating_System
loads	O
and	O
executes	O
the	O
boot	B-Operating_System
code	O
from	O
the	O
configured	O
boot	B-Operating_System
device	O
.	O
</s>
<s>
The	O
boot	B-Application
loader	I-Application
often	O
presents	O
the	O
user	O
with	O
a	O
menu	O
of	O
possible	O
boot	B-Operating_System
options	O
and	O
has	O
a	O
default	O
option	O
,	O
which	O
is	O
selected	O
after	O
some	O
time	O
passes	O
.	O
</s>
<s>
Once	O
the	O
selection	O
is	O
made	O
,	O
the	O
boot	B-Application
loader	I-Application
loads	O
the	O
kernel	B-Operating_System
into	O
memory	O
,	O
supplies	O
it	O
with	O
some	O
parameters	O
and	O
gives	O
it	O
control	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
,	O
if	O
compressed	O
,	O
will	O
decompress	O
itself	O
.	O
</s>
<s>
It	O
then	O
sets	O
up	O
system	O
functions	O
such	O
as	O
essential	O
hardware	B-Architecture
and	O
memory	O
paging	O
,	O
and	O
calls	O
start_kernel( )	O
which	O
performs	O
the	O
majority	O
of	O
system	O
setup	O
(	O
interrupts	B-Application
,	O
the	O
rest	O
of	O
memory	B-General_Concept
management	I-General_Concept
,	O
device	O
and	O
driver	O
initialization	O
,	O
etc	O
.	O
)	O
.	O
</s>
<s>
It	O
then	O
starts	O
up	O
,	O
separately	O
,	O
the	O
idle	B-Algorithm
process	I-Algorithm
,	O
scheduler	O
,	O
and	O
the	O
init	B-Device
process	I-Device
,	O
which	O
is	O
executed	O
in	O
user	B-Operating_System
space	I-Operating_System
.	O
</s>
<s>
The	O
init	B-Operating_System
either	O
consists	O
of	O
scripts	B-Language
that	O
are	O
executed	O
by	O
the	O
shell	B-Operating_System
(	O
sysv	O
,	O
bsd	B-Operating_System
,	O
runit	O
)	O
or	O
configuration	O
files	O
that	O
are	O
executed	O
by	O
the	O
binary	O
components	O
(	O
systemd	B-Application
,	O
upstart	B-Device
)	O
.	O
</s>
<s>
Init	B-Operating_System
has	O
specific	O
levels	O
(	O
sysv	O
,	O
bsd	B-Operating_System
)	O
or	O
targets	O
(	O
systemd	B-Application
)	O
,	O
each	O
of	O
which	O
consists	O
of	O
specific	O
set	O
of	O
services	O
(	O
daemons	B-Operating_System
)	O
.	O
</s>
<s>
The	O
typical	O
desktop	O
environment	O
begins	O
with	O
a	O
daemon	B-Operating_System
,	O
called	O
the	O
display	O
manager	O
,	O
that	O
starts	O
a	O
graphic	O
environment	O
which	O
consists	O
of	O
a	O
graphical	O
server	O
that	O
provides	O
a	O
basic	O
underlying	O
graphical	O
stack	O
and	O
a	O
login	O
manager	O
that	O
provides	O
the	O
ability	O
to	O
enter	O
credentials	O
and	O
select	O
a	O
session	O
.	O
</s>
<s>
On	O
shutdown	B-Device
,	O
init	B-Operating_System
is	O
called	O
to	O
close	O
down	O
all	O
user	B-Operating_System
space	I-Operating_System
functionality	O
in	O
a	O
controlled	O
manner	O
.	O
</s>
<s>
Once	O
all	O
the	O
other	O
processes	B-Operating_System
have	O
terminated	O
,	O
init	B-Operating_System
makes	O
a	O
system	B-Operating_System
call	I-Operating_System
to	O
the	O
kernel	B-Operating_System
instructing	O
it	O
to	O
shut	O
the	O
system	O
down	O
.	O
</s>
<s>
The	O
boot	B-Application
loader	I-Application
phase	O
varies	O
by	O
computer	O
architecture	O
.	O
</s>
<s>
Since	O
the	O
earlier	O
phases	O
are	O
not	O
specific	O
to	O
the	O
operating	O
system	O
,	O
the	O
BIOS-based	O
boot	B-Operating_System
process	I-Operating_System
for	O
x86	B-Operating_System
and	O
x86-64	B-Device
architectures	O
is	O
considered	O
to	O
start	O
when	O
the	O
master	B-Device
boot	I-Device
record	I-Device
(	O
MBR	O
)	O
code	O
is	O
executed	O
in	O
real	B-Application
mode	I-Application
and	O
the	O
first-stage	O
boot	B-Application
loader	I-Application
is	O
loaded	O
.	O
</s>
<s>
In	O
UEFI	B-Architecture
systems	O
,	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
can	O
be	O
executed	O
directly	O
by	O
UEFI	B-Architecture
firmware	I-Architecture
via	O
EFISTUB	O
,	O
but	O
usually	O
uses	O
GRUB	B-Application
2	I-Application
or	O
systemd-boot	B-Application
as	O
a	O
boot	B-Application
loader	I-Application
.	O
</s>
<s>
Below	O
is	O
a	O
summary	O
of	O
some	O
popular	O
boot	B-Application
loaders	I-Application
:	O
</s>
<s>
GRUB	B-Application
2	I-Application
differs	O
from	O
GRUB	B-Application
1	O
by	O
being	O
capable	O
of	O
automatic	O
detection	O
of	O
various	O
operating	O
systems	O
and	O
automatic	O
configuration	O
.	O
</s>
<s>
The	O
stage1	O
is	O
loaded	O
and	O
executed	O
either	O
by	O
the	O
BIOS	B-Operating_System
from	O
the	O
Master	B-Device
boot	I-Device
record	I-Device
(	O
MBR	O
)	O
.	O
</s>
<s>
The	O
second-stage	O
loader	O
(	O
stage2	O
,	O
the	O
/boot/grub/	O
files	O
)	O
is	O
loaded	O
by	O
the	O
stage1.5	O
and	O
displays	O
the	O
GRUB	B-Application
startup	O
menu	O
that	O
allows	O
the	O
user	O
to	O
choose	O
an	O
operating	O
system	O
or	O
examine	O
and	O
edit	O
startup	O
parameters	O
.	O
</s>
<s>
After	O
a	O
menu	O
entry	O
is	O
chosen	O
and	O
optional	O
parameters	O
are	O
given	O
,	O
GRUB	B-Application
loads	O
the	O
linux	B-Operating_System
kernel	I-Operating_System
into	O
memory	O
and	O
passes	O
control	O
to	O
it	O
.	O
</s>
<s>
GRUB	B-Application
2	I-Application
is	O
also	O
capable	O
of	O
chain-loading	O
of	O
another	O
boot	B-Application
loader	I-Application
.	O
</s>
<s>
In	O
UEFI	B-Architecture
systems	O
,	O
the	O
stage1	O
and	O
stage1.5	O
usually	O
are	O
the	O
same	O
UEFI	B-Architecture
application	O
file	O
(	O
such	O
as	O
grubx64.efi	O
for	O
x64	B-Device
UEFI	B-Architecture
systems	O
)	O
.	O
</s>
<s>
systemd-boot	B-Application
(	O
formerly	O
Gummiboot	B-Application
)	O
,	O
a	O
bootloader	B-Application
included	O
with	O
systemd	B-Application
that	O
requires	O
minimal	O
configuration	O
(	O
for	O
UEFI	B-Architecture
systems	O
only	O
)	O
.	O
</s>
<s>
SYSLINUX/ISOLINUX	O
is	O
a	O
boot	B-Application
loader	I-Application
that	O
specializes	O
in	O
booting	B-Operating_System
full	O
Linux	B-Operating_System
installations	O
from	O
FAT	O
filesystems	B-Application
.	O
</s>
<s>
It	O
is	O
often	O
used	O
for	O
boot	B-Operating_System
or	O
rescue	O
floppy	O
discs	O
,	O
live	O
USBs	O
,	O
and	O
other	O
lightweight	O
boot	B-Operating_System
systems	O
.	O
</s>
<s>
ISOLINUX	B-Application
is	O
generally	O
used	O
by	O
Linux	B-Operating_System
live	O
CDs	O
and	O
bootable	B-Operating_System
install	O
CDs	O
.	O
</s>
<s>
rEFInd	B-Device
,	O
a	O
boot	B-Application
manager	I-Application
for	O
UEFI	B-Architecture
systems	O
.	O
</s>
<s>
coreboot	B-Device
is	O
a	O
free	O
implementation	O
of	O
the	O
UEFI	B-Architecture
or	O
BIOS	B-Operating_System
and	O
usually	O
deployed	O
with	O
the	O
system	B-Device
board	I-Device
,	O
and	O
field	O
upgrades	O
provided	O
by	O
the	O
vendor	O
if	O
need	O
be	O
.	O
</s>
<s>
Parts	O
of	O
coreboot	B-Device
becomes	O
the	O
systems	O
BIOS	B-Operating_System
and	O
stays	O
resident	O
in	O
memory	O
after	O
boot	B-Operating_System
.	O
</s>
<s>
Das	B-Language
U-Boot	I-Language
is	O
a	O
boot	B-Application
loader	I-Application
for	O
embedded	O
systems	O
.	O
</s>
<s>
It	O
is	O
used	O
on	O
systems	O
that	O
do	O
not	O
have	O
a	O
BIOS/UEFI	O
but	O
rather	O
employ	O
custom	O
methods	O
to	O
read	O
the	O
boot	B-Application
loader	I-Application
into	O
memory	O
and	O
execute	O
it	O
.	O
</s>
<s>
Historical	O
boot	B-Application
loaders	I-Application
,	O
no	O
longer	O
in	O
common	O
use	O
,	O
include	O
:	O
</s>
<s>
LILO	B-Application
does	O
not	O
understand	O
or	O
parse	O
filesystem	B-Application
layout	O
.	O
</s>
<s>
Instead	O
,	O
a	O
configuration	O
file	O
(	O
/etc/lilo.conf	O
)	O
is	O
created	O
in	O
a	O
live	O
system	O
which	O
maps	O
raw	O
offset	O
information	O
(	O
mapper	O
tool	O
)	O
about	O
location	O
of	O
kernel	B-Operating_System
and	O
ram	B-Application
disks	I-Application
(	O
initrd	B-Application
or	O
initramfs	B-Application
)	O
.	O
</s>
<s>
The	O
configuration	O
file	O
,	O
which	O
includes	O
data	O
such	O
as	O
boot	B-Operating_System
partition	B-Application
and	O
kernel	B-Operating_System
pathname	O
for	O
each	O
,	O
as	O
well	O
as	O
customized	O
options	O
if	O
needed	O
,	O
is	O
then	O
written	O
together	O
with	O
bootloader	B-Application
code	O
into	O
MBR	O
bootsector	O
.	O
</s>
<s>
When	O
this	O
bootsector	O
is	O
read	O
and	O
given	O
control	O
by	O
BIOS	B-Operating_System
,	O
LILO	B-Application
loads	O
the	O
menu	O
code	O
and	O
draws	O
it	O
then	O
uses	O
stored	O
values	O
together	O
with	O
user	B-General_Concept
input	I-General_Concept
to	O
calculate	O
and	O
load	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
or	O
chain-load	O
any	O
other	O
boot-loader	O
.	O
</s>
<s>
GRUB	B-Application
1	O
includes	O
logic	O
to	O
read	O
common	O
file	B-Application
systems	I-Application
at	O
run-time	O
in	O
order	O
to	O
access	O
its	O
configuration	O
file	O
.	O
</s>
<s>
This	O
gives	O
GRUB	B-Application
1	O
ability	O
to	O
read	O
its	O
configuration	O
file	O
from	O
the	O
filesystem	B-Application
rather	O
than	O
have	O
it	O
embedded	O
into	O
the	O
MBR	O
,	O
which	O
allows	O
it	O
to	O
change	O
the	O
configuration	O
at	O
run-time	O
and	O
specify	O
disks	O
and	O
partitions	B-Application
in	O
a	O
human-readable	O
format	O
rather	O
than	O
relying	O
on	O
offsets	O
.	O
</s>
<s>
It	O
also	O
contains	O
a	O
command-line	B-Application
interface	I-Application
,	O
which	O
makes	O
it	O
easier	O
to	O
fix	O
or	O
modify	O
GRUB	B-Application
if	O
it	O
is	O
misconfigured	O
or	O
corrupt	O
.	O
</s>
<s>
Loadlin	B-Application
is	O
a	O
boot	B-Application
loader	I-Application
that	O
can	O
replace	O
a	O
running	O
DOS	B-Device
or	O
Windows	O
9x	O
kernel	B-Operating_System
with	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
at	O
run	O
time	O
.	O
</s>
<s>
This	O
can	O
be	O
useful	O
in	O
the	O
case	O
of	O
hardware	B-Architecture
that	O
needs	O
to	O
be	O
switched	O
on	O
via	O
software	O
and	O
for	O
which	O
such	O
configuration	O
programs	O
are	O
proprietary	O
and	O
only	O
available	O
for	O
DOS	B-Device
.	O
</s>
<s>
This	O
booting	B-Operating_System
method	O
is	O
less	O
necessary	O
nowadays	O
,	O
as	O
Linux	B-Operating_System
has	O
drivers	O
for	O
a	O
multitude	O
of	O
hardware	B-Architecture
devices	O
,	O
but	O
it	O
has	O
seen	O
some	O
use	O
in	O
mobile	B-Application
devices	I-Application
.	O
</s>
<s>
Another	O
use	O
case	O
is	O
when	O
the	O
Linux	B-Operating_System
is	O
located	O
on	O
a	O
storage	O
device	O
which	O
is	O
not	O
available	O
to	O
the	O
BIOS	B-Operating_System
for	O
booting	B-Operating_System
:	O
DOS	B-Device
or	O
Windows	O
can	O
load	O
the	O
appropriate	O
drivers	O
to	O
make	O
up	O
for	O
the	O
BIOS	B-Operating_System
limitation	O
and	O
boot	B-Operating_System
Linux	B-Operating_System
from	O
there	O
.	O
</s>
<s>
The	O
Linux	B-Operating_System
kernel	I-Operating_System
handles	O
all	O
operating	O
system	O
processes	B-Operating_System
,	O
such	O
as	O
memory	B-General_Concept
management	I-General_Concept
,	O
task	O
scheduling	O
,	O
I/O	B-General_Concept
,	O
interprocess	B-Operating_System
communication	I-Operating_System
,	O
and	O
overall	O
system	O
control	O
.	O
</s>
<s>
This	O
is	O
loaded	O
in	O
two	O
stages	O
in	O
the	O
first	O
stage	O
,	O
the	O
kernel	B-Operating_System
(	O
as	O
a	O
compressed	O
image	O
file	O
)	O
is	O
loaded	O
into	O
memory	O
and	O
decompressed	O
,	O
and	O
a	O
few	O
fundamental	O
functions	O
such	O
as	O
basic	O
memory	B-General_Concept
management	I-General_Concept
are	O
set	O
up	O
.	O
</s>
<s>
Control	O
is	O
then	O
switched	O
one	O
final	O
time	O
to	O
the	O
main	O
kernel	B-Operating_System
start	O
process	O
.	O
</s>
<s>
Once	O
the	O
kernel	B-Operating_System
is	O
fully	O
operational	O
and	O
as	O
part	O
of	O
its	O
startup	O
,	O
upon	O
being	O
loaded	O
and	O
executing	O
the	O
kernel	B-Operating_System
looks	O
for	O
an	O
init	B-Device
process	I-Device
to	O
run	O
,	O
which	O
(	O
separately	O
)	O
sets	O
up	O
a	O
user	B-Operating_System
space	I-Operating_System
and	O
the	O
processes	B-Operating_System
needed	O
for	O
a	O
user	O
environment	O
and	O
ultimate	O
login	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
itself	O
is	O
then	O
allowed	O
to	O
go	O
idle	B-Algorithm
,	O
subject	O
to	O
calls	O
from	O
other	O
processes	B-Operating_System
.	O
</s>
<s>
For	O
some	O
platforms	O
(	O
like	O
ARM	O
64-bit	O
)	O
,	O
kernel	B-Operating_System
decompression	O
has	O
to	O
be	O
performed	O
by	O
the	O
boot	B-Application
loader	I-Application
instead	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
is	O
typically	O
loaded	O
as	O
an	O
image	O
file	O
,	O
compressed	O
into	O
either	O
zImage	B-Application
or	I-Application
bzImage	I-Application
formats	O
with	O
zlib	B-Language
.	O
</s>
<s>
A	O
routine	O
at	O
the	O
head	O
of	O
it	O
does	O
a	O
minimal	O
amount	O
of	O
hardware	B-Architecture
setup	O
,	O
decompresses	O
the	O
image	O
fully	O
into	O
high	B-Application
memory	I-Application
,	O
and	O
takes	O
note	O
of	O
any	O
RAM	B-Application
disk	I-Application
if	O
configured	O
.	O
</s>
<s>
It	O
then	O
executes	O
kernel	B-Operating_System
startup	O
via	O
./arch/i386/boot/head	O
and	O
the	O
startup_32	O
(	O
)	O
(	O
for	O
x86	B-Operating_System
based	I-Operating_System
processors	O
)	O
process	O
.	O
</s>
<s>
The	O
startup	O
function	O
for	O
the	O
kernel	B-Operating_System
(	O
also	O
called	O
the	O
swapper	O
or	O
process	O
0	O
)	O
establishes	O
memory	B-General_Concept
management	I-General_Concept
(	O
paging	O
tables	O
and	O
memory	O
paging	O
)	O
,	O
detects	O
the	O
type	O
of	O
CPU	B-General_Concept
and	O
any	O
additional	O
functionality	O
such	O
as	O
floating	B-Algorithm
point	I-Algorithm
capabilities	O
,	O
and	O
then	O
switches	O
to	O
non-architecture	O
specific	O
Linux	B-Operating_System
kernel	I-Operating_System
functionality	O
via	O
a	O
call	O
to	O
start_kernel( )	O
.	O
</s>
<s>
It	O
sets	O
up	O
interrupt	B-Application
handling	I-Application
(	O
IRQs	B-General_Concept
)	O
,	O
further	O
configures	O
memory	O
,	O
starts	O
the	O
Init	B-Device
process	I-Device
(	O
the	O
first	O
user-space	B-Operating_System
process	O
)	O
,	O
and	O
then	O
starts	O
the	O
idle	B-Algorithm
task	I-Algorithm
via	O
cpu_idle( )	O
.	O
</s>
<s>
Notably	O
,	O
the	O
kernel	B-Operating_System
startup	O
process	O
also	O
mounts	O
the	O
initial	B-Application
RAM	I-Application
disk	I-Application
(	O
"	O
initrd	B-Application
"	O
)	O
that	O
was	O
loaded	O
previously	O
as	O
the	O
temporary	O
root	O
file	B-Application
system	I-Application
during	O
the	O
boot	B-Operating_System
phase	O
.	O
</s>
<s>
The	O
initrd	B-Application
allows	O
driver	O
modules	B-Application
to	O
be	O
loaded	O
directly	O
from	O
memory	O
,	O
without	O
reliance	O
upon	O
other	O
devices	O
(	O
e.g.	O
</s>
<s>
This	O
split	O
of	O
some	O
drivers	O
statically	O
compiled	O
into	O
the	O
kernel	B-Operating_System
and	O
other	O
drivers	O
loaded	O
from	O
initrd	B-Application
allows	O
for	O
a	O
smaller	O
kernel	B-Operating_System
.	O
</s>
<s>
The	O
root	O
file	B-Application
system	I-Application
is	O
later	O
switched	O
via	O
a	O
call	O
to	O
pivot_root( )	O
which	O
unmounts	O
the	O
temporary	O
root	O
file	B-Application
system	I-Application
and	O
replaces	O
it	O
with	O
the	O
use	O
of	O
the	O
real	O
one	O
,	O
once	O
the	O
latter	O
is	O
accessible	O
.	O
</s>
<s>
The	O
memory	O
used	O
by	O
the	O
temporary	O
root	O
file	B-Application
system	I-Application
is	O
then	O
reclaimed	O
.	O
</s>
<s>
Thus	O
,	O
the	O
kernel	B-Operating_System
initializes	O
devices	O
,	O
mounts	O
the	O
root	O
filesystem	B-Application
specified	O
by	O
the	O
boot	B-Application
loader	I-Application
as	O
read	O
only	O
,	O
and	O
runs	O
Init	B-Operating_System
(	O
/sbin/init	B-Device
)	O
which	O
is	O
designated	O
as	O
the	O
first	O
process	O
run	O
by	O
the	O
system	O
(	O
PID	B-Operating_System
=	O
1	O
)	O
.	O
</s>
<s>
A	O
message	O
is	O
printed	O
by	O
the	O
kernel	B-Operating_System
upon	O
mounting	O
the	O
file	B-Application
system	I-Application
,	O
and	O
by	O
Init	B-Operating_System
upon	O
starting	O
the	O
Init	B-Device
process	I-Device
.	O
</s>
<s>
It	O
may	O
also	O
optionally	O
run	O
Initrd	B-Application
to	O
allow	O
setup	O
and	O
device	O
related	O
matters	O
(	O
RAM	B-Application
disk	I-Application
or	O
similar	O
)	O
to	O
be	O
handled	O
before	O
the	O
root	O
file	B-Application
system	I-Application
is	O
mounted	O
.	O
</s>
<s>
According	O
to	O
Red	O
Hat	O
,	O
the	O
detailed	O
kernel	B-Operating_System
process	O
at	O
this	O
stage	O
is	O
therefore	O
summarized	O
as	O
follows	O
:	O
</s>
<s>
"	O
When	O
the	O
kernel	B-Operating_System
is	O
loaded	O
,	O
it	O
immediately	O
initializes	O
and	O
configures	O
the	O
computer	O
's	O
memory	O
and	O
configures	O
the	O
various	O
hardware	B-Architecture
attached	O
to	O
the	O
system	O
,	O
including	O
all	O
processors	O
,	O
I/O	B-General_Concept
subsystems	O
,	O
and	O
storage	O
devices	O
.	O
</s>
<s>
It	O
then	O
looks	O
for	O
the	O
compressed	O
initrd	B-Application
image	O
in	O
a	O
predetermined	O
location	O
in	O
memory	O
,	O
decompresses	O
it	O
,	O
mounts	O
it	O
,	O
and	O
loads	O
all	O
necessary	O
drivers	O
.	O
</s>
<s>
Next	O
,	O
it	O
initializes	O
virtual	O
devices	O
related	O
to	O
the	O
file	B-Application
system	I-Application
,	O
such	O
as	O
LVM	B-Application
or	O
software	O
RAID	B-Architecture
before	O
unmounting	O
the	O
initrd	B-Application
disk	B-Application
image	I-Application
and	O
freeing	O
up	O
all	O
the	O
memory	O
the	O
disk	B-Application
image	I-Application
once	O
occupied	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
then	O
creates	O
a	O
root	O
device	O
,	O
mounts	O
the	O
root	O
partition	B-Application
read-only	O
,	O
and	O
frees	O
any	O
unused	O
memory	O
.	O
</s>
<s>
At	O
this	O
point	O
,	O
the	O
kernel	B-Operating_System
is	O
loaded	O
into	O
memory	O
and	O
operational	O
.	O
</s>
<s>
An	O
initramfs-style	O
boot	B-Operating_System
is	O
similar	O
,	O
but	O
not	O
identical	O
to	O
the	O
described	O
initrd	B-Application
boot	B-Operating_System
.	O
</s>
<s>
At	O
this	O
point	O
,	O
with	O
interrupts	B-Application
enabled	O
,	O
the	O
scheduler	O
can	O
take	O
control	O
of	O
the	O
overall	O
management	O
of	O
the	O
system	O
,	O
to	O
provide	O
pre-emptive	O
multi-tasking	O
,	O
and	O
the	O
init	B-Device
process	I-Device
is	O
left	O
to	O
continue	O
booting	B-Operating_System
the	O
user	O
environment	O
in	O
user	B-Operating_System
space	I-Operating_System
.	O
</s>
<s>
initramfs	B-Application
,	O
also	O
known	O
as	O
early	O
user	B-Operating_System
space	I-Operating_System
,	O
has	O
been	O
available	O
since	O
version	O
2.5.46	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
,	O
with	O
the	O
intent	O
to	O
replace	O
as	O
many	O
functions	O
as	O
possible	O
that	O
previously	O
the	O
kernel	B-Operating_System
would	O
have	O
performed	O
during	O
the	O
startup	O
process	O
.	O
</s>
<s>
Typical	O
uses	O
of	O
early	O
user	B-Operating_System
space	I-Operating_System
are	O
to	O
detect	O
what	O
device	B-Application
drivers	I-Application
are	O
needed	O
to	O
load	O
the	O
main	O
user	B-Operating_System
space	I-Operating_System
file	B-Application
system	I-Application
and	O
load	O
them	O
from	O
a	O
temporary	B-Application
filesystem	I-Application
.	O
</s>
<s>
Many	O
distributions	O
use	O
dracut	B-Application
to	O
generate	O
and	O
maintain	O
the	O
initramfs	B-Application
image	O
.	O
</s>
<s>
Once	O
the	O
kernel	B-Operating_System
has	O
started	O
,	O
it	O
starts	O
the	O
init	B-Device
process	I-Device
,	O
a	O
daemon	B-Operating_System
which	O
then	O
bootstraps	O
the	O
user	B-Operating_System
space	I-Operating_System
,	O
for	O
example	O
by	O
checking	O
and	O
mounting	O
file	B-Application
systems	I-Application
,	O
and	O
starting	O
up	O
other	O
processes	B-Operating_System
.	O
</s>
<s>
The	O
init	B-Device
system	I-Device
is	O
the	O
first	O
daemon	B-Operating_System
to	O
start	O
(	O
during	O
booting	B-Operating_System
)	O
and	O
the	O
last	O
daemon	B-Operating_System
to	O
terminate	O
(	O
during	O
shutdown	B-Device
)	O
.	O
</s>
<s>
Historically	O
this	O
was	O
the	O
"	O
SysV	O
init	B-Operating_System
"	O
,	O
which	O
was	O
just	O
called	O
"	O
init	B-Operating_System
"	O
.	O
</s>
<s>
More	O
recent	O
Linux	B-Operating_System
distributions	O
are	O
likely	O
to	O
use	O
one	O
of	O
the	O
more	O
modern	O
alternatives	O
such	O
as	O
systemd	B-Application
.	O
</s>
<s>
Below	O
is	O
a	O
summary	O
of	O
the	O
main	O
init	B-Operating_System
processes	B-Operating_System
:	O
</s>
<s>
SysV	O
init	B-Operating_System
(	O
simply	O
"	O
init	B-Operating_System
"	O
)	O
is	O
similar	O
to	O
the	O
Unix	B-Application
and	O
BSD	B-Operating_System
init	B-Operating_System
processes	B-Operating_System
,	O
from	O
which	O
it	O
derived	O
.	O
</s>
<s>
In	O
a	O
standard	O
Linux	B-Operating_System
system	O
,	O
init	B-Operating_System
is	O
executed	O
with	O
a	O
parameter	O
,	O
known	O
as	O
a	O
runlevel	B-Device
,	O
which	O
takes	O
a	O
value	O
from	O
0	O
to	O
6	O
and	O
determines	O
which	O
subsystems	O
are	O
made	O
operational	O
.	O
</s>
<s>
Each	O
runlevel	B-Device
has	O
its	O
own	O
scripts	B-Language
which	O
codify	O
the	O
various	O
processes	B-Operating_System
involved	O
in	O
setting	O
up	O
or	O
leaving	O
the	O
given	O
runlevel	B-Device
,	O
and	O
it	O
is	O
these	O
scripts	B-Language
which	O
are	O
referenced	O
as	O
necessary	O
in	O
the	O
boot	B-Operating_System
process	I-Operating_System
.	O
</s>
<s>
Init	B-Operating_System
scripts	B-Language
are	O
typically	O
held	O
in	O
directories	O
with	O
names	O
such	O
as	O
"	O
rc	O
...	O
"	O
.	O
</s>
<s>
The	O
top	O
level	O
configuration	O
file	O
for	O
init	B-Operating_System
is	O
at	O
/etc/inittab	O
.	O
</s>
<s>
During	O
system	B-Operating_System
boot	I-Operating_System
,	O
it	O
checks	O
whether	O
a	O
default	O
runlevel	B-Device
is	O
specified	O
in	O
/etc/inittab	O
,	O
and	O
requests	O
the	O
runlevel	B-Device
to	O
enter	O
via	O
the	O
system	B-Device
console	I-Device
if	O
not	O
.	O
</s>
<s>
It	O
then	O
proceeds	O
to	O
run	O
all	O
the	O
relevant	O
boot	B-Operating_System
scripts	B-Language
for	O
the	O
given	O
runlevel	B-Device
,	O
including	O
loading	O
modules	B-Application
,	O
checking	O
the	O
integrity	O
of	O
the	O
root	O
file	B-Application
system	I-Application
(	O
which	O
was	O
mounted	O
read-only	O
)	O
and	O
then	O
remounting	O
it	O
for	O
full	O
read-write	O
access	O
,	O
and	O
sets	O
up	O
the	O
network	B-Architecture
.	O
</s>
<s>
After	O
it	O
has	O
spawned	O
all	O
of	O
the	O
processes	B-Operating_System
specified	O
,	O
init	B-Operating_System
goes	O
dormant	O
,	O
and	O
waits	O
for	O
one	O
of	O
three	O
events	O
to	O
happen	O
:	O
processes	B-Operating_System
that	O
started	O
to	O
end	O
or	O
die	O
,	O
a	O
power	O
failure	O
signal	O
,	O
or	O
a	O
request	O
via	O
/sbin/telinit	O
to	O
further	O
change	O
the	O
runlevel	B-Device
.	O
</s>
<s>
systemd	B-Application
is	O
a	O
modern	O
alternative	O
to	O
SysV	O
init	B-Operating_System
.	O
</s>
<s>
Like	O
init	B-Operating_System
,	O
systemd	B-Application
is	O
a	O
daemon	B-Operating_System
that	O
manages	O
other	O
daemons	B-Operating_System
.	O
</s>
<s>
All	O
daemons	B-Operating_System
,	O
including	O
systemd	B-Application
,	O
are	O
background	B-Operating_System
processes	I-Operating_System
.	O
</s>
<s>
Lennart	O
Poettering	O
and	O
Kay	O
Sievers	O
,	O
software	O
engineers	O
that	O
initially	O
developed	O
systemd	B-Application
,	O
sought	O
to	O
surpass	O
the	O
efficiency	O
of	O
the	O
init	B-Device
daemon	I-Device
in	O
several	O
ways	O
.	O
</s>
<s>
They	O
wanted	O
to	O
improve	O
the	O
software	O
framework	O
for	O
expressing	O
dependencies	O
,	O
to	O
allow	O
more	O
processing	O
to	O
be	O
done	O
in	O
parallel	B-Operating_System
during	O
system	O
booting	B-Operating_System
,	O
and	O
to	O
reduce	O
the	O
computational	O
overhead	O
of	O
the	O
shell	B-Operating_System
.	O
</s>
<s>
Systemd	B-Application
's	O
initialization	O
instructions	O
for	O
each	O
daemon	B-Operating_System
are	O
recorded	O
in	O
a	O
declarative	O
configuration	O
file	O
rather	O
than	O
a	O
shell	B-Operating_System
script	O
.	O
</s>
<s>
For	O
inter-process	B-Operating_System
communication	I-Operating_System
,	O
systemd	B-Application
makes	O
Unix	B-Protocol
domain	I-Protocol
sockets	I-Protocol
and	O
D-Bus	B-Language
available	O
to	O
the	O
running	O
daemons	B-Operating_System
.	O
</s>
<s>
Systemd	B-Application
is	O
also	O
capable	O
of	O
aggressive	O
parallelization	B-Operating_System
.	O
</s>
