<s>
A	O
boot	B-Device
sector	I-Device
is	O
the	O
sector	B-Application
of	O
a	O
persistent	O
data	B-General_Concept
storage	I-General_Concept
device	I-General_Concept
(	O
e.g.	O
,	O
hard	B-Device
disk	I-Device
,	O
floppy	B-Device
disk	I-Device
,	O
optical	B-Device
disc	I-Device
,	O
etc	O
.	O
)	O
</s>
<s>
which	O
contains	O
machine	B-Language
code	I-Language
to	O
be	O
loaded	O
into	O
random-access	B-Architecture
memory	I-Architecture
(	O
RAM	B-Architecture
)	O
and	O
then	O
executed	O
by	O
a	O
computer	O
system	O
's	O
built-in	O
firmware	B-Application
(	O
e.g.	O
,	O
the	O
BIOS	B-Operating_System
)	O
.	O
</s>
<s>
Usually	O
,	O
the	O
very	O
first	O
sector	B-Application
of	O
the	O
hard	B-Device
disk	I-Device
is	O
the	O
boot	B-Device
sector	I-Device
,	O
regardless	O
of	O
sector	B-Application
size	O
(	O
512	O
or	O
4096	O
bytes	O
)	O
and	O
partitioning	B-Application
flavor	O
(	O
MBR	B-Device
or	O
GPT	O
)	O
.	O
</s>
<s>
The	O
purpose	O
of	O
defining	O
one	O
particular	O
sector	B-Application
as	O
the	O
boot	B-Device
sector	I-Device
is	O
inter-operability	O
between	O
firmware	B-Application
and	O
various	O
operating	O
systems	O
.	O
</s>
<s>
The	O
purpose	O
of	O
chainloading	O
first	O
a	O
firmware	B-Application
(	O
e.g.	O
,	O
the	O
BIOS	B-Operating_System
)	O
,	O
then	O
some	O
code	O
contained	O
in	O
the	O
boot	B-Device
sector	I-Device
,	O
and	O
then	O
,	O
for	O
example	O
,	O
an	O
operating	O
system	O
,	O
is	O
maximal	O
flexibility	O
.	O
</s>
<s>
On	O
an	O
IBM	O
PC	O
compatible	O
machine	O
,	O
the	O
BIOS	B-Operating_System
selects	O
a	O
boot	B-Operating_System
device	O
,	O
then	O
copies	O
the	O
first	O
sector	B-Application
from	O
the	O
device	O
(	O
which	O
may	O
be	O
an	O
MBR	B-Device
,	O
VBR	B-Device
or	O
any	O
executable	O
code	O
)	O
,	O
into	O
physical	O
memory	O
at	O
memory	B-General_Concept
address	I-General_Concept
0x7C00	O
.	O
</s>
<s>
The	O
UEFI	B-Architecture
(	O
not	O
legacy	O
boot	B-Operating_System
via	O
CSM	O
)	O
does	O
not	O
rely	O
on	O
boot	B-Device
sectors	I-Device
,	O
UEFI	B-Architecture
system	O
loads	O
the	O
boot	B-Operating_System
loader	O
(	O
EFI	O
application	O
file	O
in	O
USB	O
disk	O
or	O
in	O
the	O
EFI	B-Device
system	I-Device
partition	I-Device
)	O
directly	O
.	O
</s>
<s>
Additionally	O
,	O
the	O
UEFI	B-Architecture
specification	O
also	O
contains	O
"	O
secure	O
boot	B-Operating_System
"	O
,	O
which	O
basically	O
wants	O
the	O
UEFI	B-Architecture
code	O
to	O
be	O
digitally	O
signed	O
.	O
</s>
<s>
In	O
case	O
a	O
boot	B-Device
sector	I-Device
receives	O
physical	O
damage	O
,	O
the	O
hard	B-Device
disk	I-Device
will	O
no	O
longer	O
be	O
bootable	B-Operating_System
,	O
unless	O
used	O
with	O
a	O
custom	O
BIOS	B-Operating_System
that	O
defines	O
a	O
non-damaged	O
sector	B-Application
as	O
the	O
boot	B-Device
sector	I-Device
.	O
</s>
<s>
However	O
,	O
since	O
the	O
very	O
first	O
sector	B-Application
additionally	O
contains	O
data	O
regarding	O
the	O
partitioning	B-Application
of	O
the	O
hard	B-Device
disk	I-Device
,	O
the	O
hard	B-Device
disk	I-Device
will	O
become	O
entirely	O
unusable	O
except	O
when	O
used	O
in	O
conjunction	O
with	O
custom	O
software	O
.	O
</s>
<s>
A	O
disk	O
can	O
be	O
partitioned	B-Application
into	O
multiple	O
partitions	B-Application
and	O
,	O
on	O
conventional	O
systems	O
,	O
it	O
is	O
expected	O
to	O
be	O
.	O
</s>
<s>
There	O
are	O
two	O
definitions	O
on	O
how	O
to	O
store	O
the	O
information	O
regarding	O
the	O
partitioning	B-Application
:	O
</s>
<s>
A	O
master	B-Device
boot	I-Device
record	I-Device
(	O
MBR	B-Device
)	O
is	O
the	O
first	O
sector	B-Application
of	O
a	O
data	B-General_Concept
storage	I-General_Concept
device	I-General_Concept
that	O
has	O
been	O
partitioned	B-Application
.	O
</s>
<s>
The	O
MBR	B-Device
sector	B-Application
may	O
contain	O
code	O
to	O
locate	O
the	O
active	O
partition	B-Application
and	O
invoke	O
its	O
volume	B-Device
boot	I-Device
record	I-Device
.	O
</s>
<s>
A	O
volume	B-Device
boot	I-Device
record	I-Device
(	O
VBR	B-Device
)	O
is	O
the	O
first	O
sector	B-Application
of	O
a	O
data	B-General_Concept
storage	I-General_Concept
device	I-General_Concept
that	O
has	O
not	O
been	O
partitioned	B-Application
,	O
or	O
the	O
first	O
sector	B-Application
of	O
an	O
individual	O
partition	B-Application
on	O
a	O
data	B-General_Concept
storage	I-General_Concept
device	I-General_Concept
that	O
has	O
been	O
partitioned	B-Application
.	O
</s>
<s>
It	O
may	O
contain	O
code	O
to	O
load	O
an	O
operating	O
system	O
(	O
or	O
other	O
standalone	O
program	O
)	O
installed	O
on	O
that	O
device	O
or	O
within	O
that	O
partition	B-Application
.	O
</s>
<s>
The	O
presence	O
of	O
an	O
IBM	O
PC	O
compatible	O
boot	B-Operating_System
loader	O
for	O
x86-CPUs	O
in	O
the	O
boot	B-Device
sector	I-Device
is	O
by	O
convention	O
indicated	O
by	O
a	O
two-byte	O
hexadecimal	O
sequence	O
0x55	O
0xAA	O
(	O
called	O
the	O
boot	B-Device
sector	I-Device
signature	O
)	O
at	O
the	O
end	O
of	O
the	O
boot	B-Device
sector	I-Device
(	O
offsets	O
0x1FE	O
and	O
0x1FF	O
)	O
.	O
</s>
<s>
This	O
signature	O
indicates	O
the	O
presence	O
of	O
at	O
least	O
a	O
dummy	O
boot	B-Operating_System
loader	O
which	O
is	O
safe	O
to	O
be	O
executed	O
,	O
even	O
if	O
it	O
may	O
not	O
be	O
able	O
actually	O
to	O
load	O
an	O
operating	O
system	O
.	O
</s>
<s>
It	O
does	O
not	O
indicate	O
a	O
particular	O
(	O
or	O
even	O
the	O
presence	O
of	O
)	O
file	B-Application
system	I-Application
or	O
operating	O
system	O
,	O
although	O
some	O
old	O
versions	O
of	O
DOS	O
3	O
relied	O
on	O
it	O
in	O
their	O
process	O
to	O
detect	O
FAT-formatted	O
media	O
(	O
newer	O
versions	O
do	O
not	O
)	O
.	O
</s>
<s>
Boot	B-Operating_System
code	O
for	O
other	O
platforms	O
or	O
CPUs	O
should	O
not	O
use	O
this	O
signature	O
,	O
since	O
this	O
may	O
lead	O
to	O
a	O
crash	O
when	O
the	O
BIOS	B-Operating_System
passes	O
execution	O
to	O
the	O
boot	B-Device
sector	I-Device
assuming	O
that	O
it	O
contains	O
valid	O
executable	O
code	O
.	O
</s>
<s>
The	O
signature	O
is	O
checked	O
for	O
by	O
most	O
system	O
BIOSes	O
since	O
(	O
at	O
least	O
)	O
the	O
IBM	B-Operating_System
PC/AT	I-Operating_System
(	O
but	O
not	O
by	O
the	O
original	O
IBM	O
PC	O
and	O
some	O
other	O
machines	O
)	O
.	O
</s>
<s>
Even	O
more	O
so	O
,	O
it	O
is	O
also	O
checked	O
by	O
most	O
MBR	B-Device
boot	B-Operating_System
loaders	I-Operating_System
before	O
passing	O
control	O
to	O
the	O
boot	B-Device
sector	I-Device
.	O
</s>
<s>
Some	O
BIOSes	O
(	O
like	O
the	O
IBM	B-Operating_System
PC/AT	I-Operating_System
)	O
perform	O
the	O
check	O
only	O
for	O
fixed	O
disk/removable	O
drives	O
,	O
while	O
for	O
floppies	B-Device
and	O
superfloppies	O
,	O
it	O
is	O
enough	O
to	O
start	O
with	O
a	O
byte	O
greater	O
or	O
equal	O
to	O
06h	O
and	O
the	O
first	O
nine	O
words	O
not	O
to	O
contain	O
the	O
same	O
value	O
,	O
before	O
the	O
boot	B-Device
sector	I-Device
is	O
accepted	O
as	O
valid	O
,	O
thereby	O
avoiding	O
the	O
explicit	O
test	O
for	O
0x55	O
,	O
0xAA	O
on	O
floppies	B-Device
.	O
</s>
<s>
Since	O
old	O
boot	B-Device
sectors	I-Device
(	O
e.g.	O
,	O
very	O
old	O
CP/M	O
-86	O
and	O
DOS	O
media	O
)	O
sometimes	O
do	O
not	O
feature	O
this	O
signature	O
despite	O
the	O
fact	O
that	O
they	O
can	O
be	O
booted	O
successfully	O
,	O
the	O
check	O
can	O
be	O
disabled	O
in	O
some	O
environments	O
.	O
</s>
<s>
If	O
the	O
BIOS	B-Operating_System
or	O
MBR	B-Device
code	O
does	O
not	O
detect	O
a	O
valid	O
boot	B-Device
sector	I-Device
and	O
therefore	O
cannot	O
pass	O
execution	O
to	O
the	O
boot	B-Device
sector	I-Device
code	O
,	O
it	O
will	O
try	O
the	O
next	O
boot	B-Operating_System
device	O
in	O
the	O
row	O
.	O
</s>
<s>
CD-ROMs	O
usually	O
have	O
their	O
own	O
structure	O
of	O
boot	B-Device
sectors	I-Device
;	O
for	O
IBM	O
PC	O
compatible	O
systems	O
this	O
is	O
subject	O
to	O
El	B-Device
Torito	I-Device
specifications	I-Device
.	O
</s>
<s>
C128	B-Device
or	O
C64	O
software	O
on	O
Commodore	B-Device
DOS	I-Device
disks	O
where	O
data	O
on	O
Track	O
1	O
,	O
Sector	B-Application
0	O
began	O
with	O
a	O
magic	O
number	O
corresponding	O
to	O
string	O
"	O
CBM	O
"	O
.	O
</s>
<s>
IBM	O
mainframe	O
computers	O
place	O
a	O
small	O
amount	O
of	O
boot	B-Operating_System
code	O
in	O
the	O
first	O
and	O
second	O
track	O
of	O
the	O
first	O
cylinder	O
of	O
the	O
disk	O
,	O
and	O
the	O
root	O
directory	O
,	O
called	O
the	O
Volume	B-Application
Table	I-Application
of	I-Application
Contents	I-Application
,	O
is	O
also	O
located	O
at	O
the	O
fixed	O
location	O
of	O
the	O
third	O
track	O
of	O
the	O
first	O
cylinder	O
of	O
the	O
disk	O
.	O
</s>
<s>
Other	O
(	O
non	O
IBM-compatible	O
)	O
PC	O
systems	O
may	O
have	O
different	O
boot	B-Device
sector	I-Device
formats	O
on	O
their	O
disk	O
devices	O
.	O
</s>
<s>
On	O
IBM	O
PC	O
compatible	O
machines	O
,	O
the	O
BIOS	B-Operating_System
is	O
ignorant	O
of	O
the	O
distinction	O
between	O
VBRs	O
and	O
MBRs	O
,	O
and	O
of	O
partitioning	B-Application
.	O
</s>
<s>
The	O
firmware	B-Application
simply	O
loads	O
and	O
runs	O
the	O
first	O
sector	B-Application
of	O
the	O
storage	O
device	O
.	O
</s>
<s>
If	O
the	O
device	O
is	O
a	O
floppy	B-Device
or	O
USB	O
flash	O
drive	O
,	O
that	O
will	O
be	O
a	O
VBR	B-Device
.	O
</s>
<s>
If	O
the	O
device	O
is	O
a	O
hard	B-Device
disk	I-Device
,	O
that	O
will	O
be	O
an	O
MBR	B-Device
.	O
</s>
<s>
It	O
is	O
the	O
code	O
in	O
the	O
MBR	B-Device
which	O
generally	O
understands	O
disk	B-Application
partitioning	I-Application
,	O
and	O
in	O
turn	O
,	O
is	O
responsible	O
for	O
loading	O
and	O
running	O
the	O
VBR	B-Device
of	O
whichever	O
primary	O
partition	B-Application
is	O
set	O
to	O
boot	B-Operating_System
(	O
the	O
active	O
partition	B-Application
)	O
.	O
</s>
<s>
The	O
VBR	B-Device
then	O
loads	O
a	O
second-stage	O
bootloader	O
from	O
another	O
location	O
on	O
the	O
disk	O
.	O
</s>
<s>
Furthermore	O
,	O
whatever	O
is	O
stored	O
in	O
the	O
first	O
sector	B-Application
of	O
a	O
floppy	B-Device
diskette	I-Device
,	O
USB	O
device	O
,	O
hard	B-Device
disk	I-Device
or	O
any	O
other	O
bootable	B-Operating_System
storage	O
device	O
,	O
is	O
not	O
required	O
to	O
immediately	O
load	O
any	O
bootstrap	O
code	O
for	O
an	O
OS	O
,	O
if	O
ever	O
.	O
</s>
<s>
The	O
BIOS	B-Operating_System
merely	O
passes	O
control	O
to	O
whatever	O
exists	O
there	O
,	O
as	O
long	O
as	O
the	O
sector	B-Application
meets	O
the	O
very	O
simple	O
qualification	O
of	O
having	O
the	O
boot	B-Device
record	I-Device
signature	O
of	O
0x55	O
,	O
0xAA	O
in	O
its	O
last	O
two	O
bytes	O
.	O
</s>
<s>
This	O
is	O
why	O
it	O
is	O
easy	O
to	O
replace	O
the	O
usual	O
bootstrap	O
code	O
found	O
in	O
an	O
MBR	B-Device
with	O
more	O
complex	O
loaders	O
,	O
even	O
large	O
multi-functional	O
boot	B-Operating_System
managers	I-Operating_System
(	O
programs	O
stored	O
elsewhere	O
on	O
the	O
device	O
which	O
can	O
run	O
without	O
an	O
operating	O
system	O
)	O
,	O
allowing	O
users	O
a	O
number	O
of	O
choices	O
in	O
what	O
occurs	O
next	O
.	O
</s>
<s>
With	O
this	O
kind	O
of	O
freedom	O
,	O
abuse	O
often	O
occurs	O
in	O
the	O
form	O
of	O
boot	B-Device
sector	I-Device
viruses	O
.	O
</s>
<s>
Since	O
code	O
in	O
the	O
boot	B-Device
sector	I-Device
is	O
executed	O
automatically	O
,	O
boot	B-Device
sectors	I-Device
have	O
historically	O
been	O
a	O
common	O
attack	O
vector	O
for	O
computer	O
viruses	O
.	O
</s>
<s>
To	O
combat	O
this	O
behavior	O
,	O
the	O
system	B-Operating_System
BIOS	I-Operating_System
often	O
includes	O
an	O
option	O
to	O
prevent	O
software	O
from	O
writing	O
to	O
the	O
first	O
sector	B-Application
of	O
any	O
attached	O
hard	B-Device
drives	I-Device
;	O
it	O
could	O
thereby	O
protect	O
the	O
master	B-Device
boot	I-Device
record	I-Device
containing	O
the	O
partition	B-Application
table	O
from	O
being	O
overwritten	O
accidentally	O
,	O
but	O
not	O
the	O
volume	B-Device
boot	I-Device
records	I-Device
in	O
the	O
bootable	B-Operating_System
partitions	B-Application
.	O
</s>
<s>
Depending	O
on	O
the	O
BIOS	B-Operating_System
,	O
attempts	O
to	O
write	O
to	O
the	O
protected	O
sector	B-Application
may	O
be	O
blocked	O
with	O
or	O
without	O
user	O
interaction	O
.	O
</s>
<s>
The	O
BIOS	B-Operating_System
option	O
is	O
disabled	O
by	O
default	O
because	O
the	O
message	O
may	O
not	O
be	O
displayed	O
correctly	O
in	O
graphics	O
mode	O
and	O
blocking	O
access	O
to	O
the	O
MBR	B-Device
may	O
cause	O
problems	O
with	O
operating	O
system	O
setup	O
programs	O
or	O
disk	O
access	O
,	O
encryption	O
or	O
partitioning	B-Application
tools	O
like	O
FDISK	B-Application
,	O
which	O
may	O
not	O
have	O
been	O
written	O
to	O
be	O
aware	O
of	O
that	O
possibility	O
,	O
causing	O
them	O
to	O
abort	O
ungracefully	O
and	O
possibly	O
leaving	O
the	O
disk	B-Application
partitioning	I-Application
in	O
an	O
inconsistent	O
state	O
.	O
</s>
<s>
As	O
an	O
example	O
,	O
the	O
malware	O
NotPetya	O
attempts	O
to	O
gain	O
administrative	O
privileges	O
on	O
an	O
operating	O
system	O
,	O
and	O
then	O
would	O
attempt	O
to	O
overwrite	O
the	O
boot	B-Device
sector	I-Device
of	O
a	O
computer	O
.	O
</s>
<s>
The	O
CIA	O
has	O
also	O
developed	O
malware	O
that	O
attempts	O
to	O
modify	O
the	O
boot	B-Device
sector	I-Device
in	O
order	O
to	O
load	O
additional	O
drivers	O
to	O
be	O
used	O
by	O
other	O
malware	O
.	O
</s>
