<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
a	O
type	O
of	O
ROM	B-Device
that	O
is	O
used	O
for	O
booting	B-Operating_System
a	O
computer	O
system	O
.	O
</s>
<s>
There	O
are	O
two	O
types	O
:	O
a	O
mask	B-Device
boot	B-General_Concept
ROM	I-General_Concept
that	O
cannot	O
be	O
changed	O
afterwards	O
and	O
a	O
boot	B-Operating_System
EEPROM	B-General_Concept
,	O
which	O
can	B-Protocol
contain	O
an	O
UEFI	B-Architecture
implementation	O
.	O
</s>
<s>
To	O
continue	O
booting	B-Operating_System
,	O
the	O
system	O
may	O
need	O
to	O
read	O
a	O
bootloader	B-Application
from	O
some	O
peripheral	O
device	O
.	O
</s>
<s>
A	O
boot	B-General_Concept
ROM	I-General_Concept
provides	O
a	O
place	O
to	O
store	O
this	O
initial	O
loading	O
code	O
,	O
at	O
a	O
fixed	O
location	O
immediately	O
available	O
to	O
the	O
processor	O
when	O
execution	O
starts	O
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
mapped	O
into	O
memory	O
at	O
a	O
fixed	O
location	O
,	O
and	O
the	O
processor	O
is	O
designed	O
to	O
start	O
executing	O
from	O
this	O
location	O
after	O
reset	O
.	O
</s>
<s>
Usually	O
,	O
it	O
is	O
placed	O
on	O
the	O
same	O
die	O
as	O
the	O
CPU	O
,	O
but	O
it	O
can	B-Protocol
also	O
be	O
an	O
external	O
ROM	B-Device
chip	I-Device
,	O
as	O
is	O
common	O
in	O
older	O
systems	O
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
will	O
then	O
initialize	O
the	O
hardware	O
busses	O
and	O
peripherals	O
needed	O
to	O
boot	B-Operating_System
.	O
</s>
<s>
In	O
some	O
cases	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
capable	O
of	O
initializing	O
RAM	B-Architecture
,	O
and	O
in	O
other	O
cases	O
it	O
is	O
up	O
to	O
the	O
bootloader	B-Application
to	O
do	O
that	O
.	O
</s>
<s>
At	O
the	O
end	O
of	O
the	O
hardware	O
initialization	O
,	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
will	O
try	O
to	O
load	O
a	O
bootloader	B-Application
from	O
external	O
peripheral(s )	O
(	O
like	O
an	O
eMMC	O
,	O
a	O
microSD	O
card	O
,	O
and	O
so	O
on	O
)	O
or	O
through	O
specific	O
protocol(s )	O
on	O
a	O
bus	O
for	O
data	O
transmission	O
(	O
like	O
USB	O
,	O
UART	O
,	O
etc	O
)	O
.	O
</s>
<s>
In	O
many	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
,	O
the	O
peripherals	O
or	O
buses	O
from	O
which	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
tries	O
to	O
load	O
the	O
bootloader	B-Application
,	O
and	O
the	O
order	O
in	O
which	O
they	O
are	O
loaded	O
,	O
can	B-Protocol
be	O
configured	O
.	O
</s>
<s>
This	O
configuration	O
can	B-Protocol
be	O
done	O
by	O
blowing	O
some	O
electronic	B-Device
fuses	I-Device
inside	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
to	O
encode	O
that	O
information	O
,	O
or	O
by	O
having	O
specific	O
pins	O
of	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
high	O
or	O
low	O
at	O
boot	B-Operating_System
.	O
</s>
<s>
Some	O
boot	B-Operating_System
ROMs	O
are	O
capable	O
of	O
checking	O
the	O
digital	O
signature	O
of	O
the	O
bootloader	B-Application
and	O
will	O
refuse	O
to	O
run	O
the	O
bootloader	B-Application
and	O
stop	O
the	O
boot	B-Operating_System
if	O
the	O
signature	O
is	O
not	O
valid	O
or	O
has	O
not	O
been	O
signed	O
with	O
an	O
authorized	O
key	O
.	O
</s>
<s>
With	O
some	O
boot	B-Operating_System
ROMs	O
the	O
hash	O
of	O
the	O
public	O
key	O
needed	O
to	O
verify	O
the	O
signatures	O
is	O
encoded	O
in	O
electronic	B-Device
fuses	I-Device
inside	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
.	O
</s>
<s>
Some	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
boot	B-Operating_System
ROMs	O
also	O
support	O
a	O
Public	B-Architecture
key	I-Architecture
infrastructure	I-Architecture
and	O
the	O
hash	O
of	O
the	O
certificate	O
authority(CA )	O
public	O
key	O
is	O
encoded	O
in	O
the	O
electronic	B-Device
fuses	I-Device
instead	O
,	O
and	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
will	O
then	O
be	O
able	O
to	O
check	O
if	O
the	O
bootloader	B-Application
is	O
signed	O
by	O
an	O
authorized	O
key	O
by	O
verifying	O
that	O
key	O
with	O
the	O
CA	O
public	O
key	O
(	O
whose	O
hash	O
is	O
encoded	O
in	O
the	O
electronic	B-Device
fuses	I-Device
)	O
..	O
</s>
<s>
That	O
feature	O
can	B-Protocol
then	O
be	O
used	O
to	O
implement	O
security	O
features	O
or	O
used	O
as	O
a	O
hardware	O
root	O
of	O
trust	O
in	O
a	O
Chain	O
of	O
trust	O
,	O
but	O
once	O
configured	O
,	O
users	O
are	O
denied	O
the	O
freedom	O
to	O
replace	O
the	O
bootloader	B-Application
with	O
the	O
one	O
they	O
want	O
.	O
</s>
<s>
Just	O
before	O
jumping	O
to	O
the	O
bootloader	B-Application
,	O
some	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
also	O
remove	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
from	O
the	O
memory	O
mapping	O
,	O
while	O
others	O
do	O
not	O
,	O
making	O
it	O
possible	O
to	O
dump	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
from	O
later	O
analysis	O
.	O
</s>
<s>
If	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
still	O
visible	O
,	O
bootloaders	B-Application
can	B-Protocol
also	O
call	O
the	O
code	O
of	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
(	O
which	O
is	O
sometimes	O
documented	O
)	O
.	O
</s>
<s>
When	O
a	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
enters	O
suspend	O
to	O
RAM	B-Architecture
mode	O
,	O
in	O
many	O
cases	O
,	O
the	O
processor	O
is	O
completely	O
off	O
while	O
the	O
RAM	B-Architecture
is	O
put	O
in	O
self	O
refresh	O
mode	O
.	O
</s>
<s>
At	O
resume	O
,	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
executed	O
again	O
and	O
many	O
boot	B-Operating_System
ROMs	O
are	O
able	O
to	O
detect	O
that	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
was	O
in	O
suspend	O
to	O
RAM	B-Architecture
and	O
can	B-Protocol
resume	O
by	O
jumping	O
directly	O
to	O
the	O
kernel	B-Operating_System
which	O
then	O
takes	O
care	O
of	O
powering	O
on	O
again	O
the	O
peripherals	O
which	O
were	O
off	O
and	O
restoring	O
the	O
state	O
that	O
the	O
computer	O
was	O
in	O
before	O
.	O
</s>
<s>
On	O
many	O
Allwinner	O
System	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
(	O
A10	O
,	O
A20	O
,	O
A64	O
)	O
,	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
either	O
waits	O
for	O
a	O
bootloader	B-Application
to	O
be	O
loaded	O
through	O
USB	O
(	O
if	O
a	O
specific	O
PIN	O
is	O
high	O
)	O
or	O
tries	O
to	O
boot	B-Operating_System
on	O
several	O
peripherals	O
in	O
a	O
fixed	O
order	O
.	O
</s>
<s>
Some	O
Allwinner	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
can	B-Protocol
verify	O
the	O
signature	O
of	O
the	O
booloaders	O
.	O
</s>
<s>
This	O
has	O
enabled	O
free	B-License
and	I-License
open-source	I-License
software	I-License
to	O
add	O
support	O
for	O
many	O
Allwinner	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
and	O
devices	O
using	O
them	O
in	O
bootloaders	B-Application
like	O
U-Boot	B-Language
.	O
</s>
<s>
On	O
iOS	B-Application
devices	O
,	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
called	O
"	O
SecureROM	B-General_Concept
"	O
.	O
</s>
<s>
It	O
is	O
a	O
stripped	O
down	O
version	O
of	O
iBoot	B-Operating_System
.	O
</s>
<s>
It	O
provides	O
a	O
Device	O
Firmware	O
Upgrade	O
(	O
DFU	O
)	O
mechanism	O
,	O
which	O
can	B-Protocol
be	O
activated	O
using	O
a	O
special	O
key	O
combination	O
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
of	O
NXP	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
support	O
configuring	O
the	O
peripherals	O
through	O
specific	O
pins	O
of	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
.	O
</s>
<s>
On	O
the	O
I.MX6	O
family	O
it	O
also	O
supports	O
configuring	O
the	O
boot	B-Operating_System
order	O
through	O
efuses	B-Device
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
of	O
several	O
NXP	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
have	O
many	O
ways	O
to	O
load	O
the	O
first	O
stage	O
bootloader	B-Application
(	O
from	O
eMMC	O
,	O
microSD	O
,	O
USB	O
,	O
etc	O
)	O
.	O
</s>
<s>
Several	O
NXP	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
can	B-Protocol
be	O
configured	O
to	O
verify	O
the	O
signature	O
of	O
the	O
bootloaders	B-Application
.	O
</s>
<s>
Many	O
devices	O
with	O
such	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
were	O
sold	O
without	O
that	O
verification	O
configured	O
and	O
on	O
those	O
devices	O
users	O
can	B-Protocol
install	O
the	O
bootloader	B-Application
they	O
want	O
,	O
including	O
several	O
free	B-License
and	I-License
open-source	I-License
software	I-License
bootloaders	B-Application
like	O
Das	B-Language
U-Boot	I-Language
and	O
Barebox	B-Application
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
of	O
several	O
Texas	O
Instruments	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
support	O
configuring	O
the	O
peripherals	O
through	O
specific	O
pins	O
of	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
of	O
several	O
Texas	O
Instruments	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
have	O
many	O
ways	O
to	O
load	O
the	O
first	O
stage	O
bootloader	B-Application
(	O
which	O
is	O
called	O
MLO	O
in	O
the	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
reference	O
manuals	O
)	O
:	O
</s>
<s>
It	O
can	B-Protocol
be	O
loaded	O
from	O
various	O
storage	O
devices	O
(	O
MMC/SD/eMMC	O
,	O
NAND	O
,	O
etc	O
)	O
.	O
</s>
<s>
With	O
MMC/SD/eMMC	O
,	O
it	O
can	B-Protocol
be	O
loaded	O
directly	O
from	O
card	O
sectors	O
(	O
called	O
RAW	O
mode	O
in	O
the	O
manual	O
)	O
or	O
from	O
a	O
FAT12/16/32	O
partition	O
.	O
</s>
<s>
It	O
can	B-Protocol
also	O
be	O
loaded	O
from	O
USB	O
or	O
UART	O
.	O
</s>
<s>
On	O
the	O
OMAP36xx	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
,	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
looks	O
for	O
the	O
first	O
stage	O
bootloader	B-Application
at	O
the	O
sectors	O
0x0	O
and	O
0x20000	O
(	O
128KB	O
)	O
,	O
and	O
on	O
the	O
AM3358	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
,	O
it	O
additionally	O
looks	O
at	O
0x40000	O
(	O
256KiB	O
)	O
and	O
0x60000	O
(	O
384KiB	O
)	O
.	O
</s>
<s>
This	O
is	O
because	O
the	O
(	O
first	O
stage	O
)	O
bootloader	B-Application
is	O
loaded	O
in	O
an	O
SRAM	B-Architecture
that	O
is	O
inside	O
the	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
.	O
</s>
<s>
The	O
OMAP	O
and	O
AM335x	O
systems	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
can	B-Protocol
be	O
configured	O
to	O
verify	O
the	O
signature	O
of	O
the	O
booloaders	O
.	O
</s>
<s>
Many	O
devices	O
with	O
such	O
system	B-Architecture
on	I-Architecture
a	I-Architecture
chip	I-Architecture
were	O
sold	O
without	O
verification	O
configured	O
and	O
on	O
those	O
devices	O
users	O
can	B-Protocol
install	O
the	O
bootloader	B-Application
they	O
want	O
,	O
including	O
several	O
free	B-License
and	I-License
open-source	I-License
software	I-License
bootloaders	B-Application
like	O
Das	B-Language
U-Boot	I-Language
and	O
Coreboot	B-Device
and	O
Barebox	B-Application
.	O
</s>
<s>
STMicro	O
STM32	O
family	O
microcontrollers	B-Architecture
have	O
built-in	O
on-chip	O
ROM	B-Device
(	O
also	O
referred	O
as	O
"	O
built-in	O
bootloader	B-Application
"	O
)	O
to	O
facilitate	O
empty	O
system	O
flashing	O
.	O
</s>
<s>
Certain	O
pin	O
combinations	O
or	O
sometimes	O
efuses	B-Device
and/or	O
empty	O
flash	O
checks	O
force	O
the	O
chip	O
to	O
boot	B-Operating_System
from	O
ROM	B-Device
instead	O
of	O
the	O
firmware	O
in	O
main	O
flash	O
.	O
</s>
<s>
Technically	O
this	O
ROM	B-Device
is	O
stored	O
in	O
a	O
dedicated	O
area	O
of	O
the	O
flash	O
array	O
and	O
programmed	O
by	O
STMicro	O
during	O
production	O
.	O
</s>
<s>
Most	O
STM32	O
microcontrollers	B-Architecture
can	B-Protocol
at	O
least	O
be	O
flashed	O
over	O
UART	O
,	O
some	O
support	O
USB	O
and	O
eventually	O
other	O
interfaces	O
like	O
e.g.	O
</s>
<s>
I2C	O
,	O
SPI	B-Architecture
,	O
or	O
CAN	B-Protocol
.	O
</s>
<s>
The	O
Cortex-M	O
CPU	O
core	O
normally	O
fetches	O
vectors	O
from	O
the	O
well-known	O
addresses	O
0x00000000	O
(	O
initial	O
stack	O
pointer	O
value	O
)	O
and	O
0x00000004	O
(	O
initial	O
program	B-General_Concept
counter	I-General_Concept
value	O
)	O
.	O
</s>
<s>
Built-in	O
boot	B-General_Concept
ROM	I-General_Concept
is	O
one	O
of	O
the	O
mapping	O
options	O
,	O
another	O
would	O
typically	O
be	O
main	O
firmware	O
in	O
flash	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
firmware	O
is	O
supposed	O
to	O
do	O
all	O
the	O
jobs	O
boot	B-Operating_System
ROMs	O
do	O
;	O
part	O
of	O
the	O
firmware	O
could	O
act	O
as	O
a	O
bootloader	B-Application
similar	O
to	O
ST	O
's	O
boot	B-General_Concept
ROM	I-General_Concept
.	O
</s>
<s>
Hardware	O
could	O
provide	O
read-only	O
enforcement	O
on	O
the	O
boot	B-Operating_System
area	O
,	O
turning	O
it	O
into	O
a	O
user-provided	O
version	O
of	O
boot	B-General_Concept
ROM	I-General_Concept
.	O
</s>
<s>
On	O
devices	O
running	O
iOS	B-Application
,	O
boot	B-General_Concept
ROM	I-General_Concept
exploits	O
(	O
like	O
Limera1n	O
and	O
checkm8	O
)	O
are	O
sometimes	O
used	O
for	O
iOS	B-Application
jailbreaking	I-Application
.	O
</s>
<s>
The	O
advantage	O
for	O
people	O
wanting	O
to	O
jailbreak	B-Application
their	O
devices	O
over	O
exploits	O
that	O
affect	O
iOS	B-Application
is	O
that	O
since	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
cannot	O
be	O
modified	O
—	O
and	O
that	O
devices	O
running	O
iOS	B-Application
do	O
not	O
have	O
fuses	O
to	O
append	O
code	O
to	O
the	O
boot	B-General_Concept
ROM	I-General_Concept
,	O
Apple	O
cannot	O
fix	O
the	O
vulnerability	O
on	O
existing	O
devices	O
.	O
</s>
<s>
The	O
boot	B-General_Concept
ROM	I-General_Concept
of	O
the	O
Tegra	B-Operating_System
SoC	O
of	O
Nvidia	O
(	O
used	O
by	O
the	O
Nintendo	B-Application
Switch	I-Application
)	O
contained	O
a	O
vulnerability	O
which	O
made	O
it	O
possible	O
for	O
users	O
to	O
run	O
the	O
bootloader	B-Application
they	O
want	O
.	O
</s>
