<s>
In	O
computing	O
,	O
a	O
device	B-Application
driver	I-Application
is	O
a	O
computer	B-Application
program	I-Application
that	O
operates	O
or	O
controls	O
a	O
particular	O
type	O
of	O
device	O
that	O
is	O
attached	O
to	O
a	O
computer	O
or	O
automaton	O
.	O
</s>
<s>
A	O
driver	O
provides	O
a	O
software	O
interface	B-Application
to	O
hardware	B-Architecture
devices	O
,	O
enabling	O
operating	B-General_Concept
systems	I-General_Concept
and	O
other	O
computer	B-Application
programs	I-Application
to	O
access	O
hardware	B-Architecture
functions	O
without	O
needing	O
to	O
know	O
precise	O
details	O
about	O
the	O
hardware	B-Architecture
being	O
used	O
.	O
</s>
<s>
A	O
driver	O
communicates	O
with	O
the	O
device	O
through	O
the	O
computer	B-General_Concept
bus	I-General_Concept
or	O
communications	O
subsystem	O
to	O
which	O
the	O
hardware	B-Architecture
connects	O
.	O
</s>
<s>
When	O
a	O
calling	B-Operating_System
program	O
invokes	O
a	O
routine	O
in	O
the	O
driver	O
,	O
the	O
driver	O
issues	O
commands	O
to	O
the	O
device	O
(	O
drives	O
it	O
)	O
.	O
</s>
<s>
Once	O
the	O
device	O
sends	O
data	O
back	O
to	O
the	O
driver	O
,	O
the	O
driver	O
may	O
invoke	O
routines	O
in	O
the	O
original	O
calling	B-Operating_System
program	O
.	O
</s>
<s>
Drivers	O
are	O
hardware	B-Architecture
dependent	O
and	O
operating-system-specific	O
.	O
</s>
<s>
They	O
usually	O
provide	O
the	O
interrupt	B-Application
handling	I-Application
required	O
for	O
any	O
necessary	O
asynchronous	O
time-dependent	O
hardware	B-Architecture
interface	B-Application
.	O
</s>
<s>
The	O
main	O
purpose	O
of	O
device	B-Application
drivers	I-Application
is	O
to	O
provide	O
abstraction	B-Application
by	O
acting	O
as	O
a	O
translator	O
between	O
a	O
hardware	B-Architecture
device	O
and	O
the	O
applications	O
or	O
operating	B-General_Concept
systems	I-General_Concept
that	O
use	O
it	O
.	O
</s>
<s>
Programmers	O
can	O
write	O
higher-level	O
application	O
code	O
independently	O
of	O
whatever	O
specific	O
hardware	B-Architecture
the	O
end-user	O
is	O
using	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
high-level	O
application	O
for	O
interacting	O
with	O
a	O
serial	B-Protocol
port	I-Protocol
may	O
simply	O
have	O
two	O
functions	O
for	O
"	O
send	O
data	O
"	O
and	O
"	O
receive	O
data	O
"	O
.	O
</s>
<s>
At	O
a	O
lower	O
level	O
,	O
a	O
device	B-Application
driver	I-Application
implementing	O
these	O
functions	O
would	O
communicate	O
to	O
the	O
particular	O
serial	B-Protocol
port	I-Protocol
controller	O
installed	O
on	O
a	O
user	O
's	O
computer	O
.	O
</s>
<s>
The	O
commands	O
needed	O
to	O
control	O
a	O
16550	B-Device
UART	I-Device
are	O
much	O
different	O
from	O
the	O
commands	O
needed	O
to	O
control	O
an	O
FTDI	O
serial	B-Protocol
port	I-Protocol
converter	O
,	O
but	O
each	O
hardware-specific	O
device	B-Application
driver	I-Application
abstracts	B-Application
these	O
details	O
into	O
the	O
same	O
(	O
or	O
similar	O
)	O
software	O
interface	B-Application
.	O
</s>
<s>
Writing	O
a	O
device	B-Application
driver	I-Application
requires	O
an	O
in-depth	O
understanding	O
of	O
how	O
the	O
hardware	B-Architecture
and	O
the	O
software	O
works	O
for	O
a	O
given	O
platform	B-Device
function	O
.	O
</s>
<s>
Because	O
drivers	O
require	O
low-level	O
access	O
to	O
hardware	B-Architecture
functions	O
in	O
order	O
to	O
operate	O
,	O
drivers	O
typically	O
operate	O
in	O
a	O
highly	O
privileged	O
environment	O
and	O
can	O
cause	O
system	O
operational	O
issues	O
if	O
something	O
goes	O
wrong	O
.	O
</s>
<s>
In	O
contrast	O
,	O
most	O
user-level	B-Operating_System
software	O
on	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
can	O
be	O
stopped	O
without	O
greatly	O
affecting	O
the	O
rest	O
of	O
the	O
system	O
.	O
</s>
<s>
Even	O
drivers	O
executing	O
in	O
user	B-Operating_System
mode	I-Operating_System
can	O
crash	O
a	O
system	O
if	O
the	O
device	O
is	O
erroneously	B-Language
programmed	I-Language
.	O
</s>
<s>
The	O
task	O
of	O
writing	O
drivers	O
thus	O
usually	O
falls	O
to	O
software	B-General_Concept
engineers	I-General_Concept
or	O
computer	O
engineers	O
who	O
work	O
for	O
hardware-development	O
companies	O
.	O
</s>
<s>
This	O
is	O
because	O
they	O
have	O
better	O
information	O
than	O
most	O
outsiders	O
about	O
the	O
design	O
of	O
their	O
hardware	B-Architecture
.	O
</s>
<s>
Moreover	O
,	O
it	O
was	O
traditionally	O
considered	O
in	O
the	O
hardware	B-Architecture
manufacturer	O
's	O
interest	O
to	O
guarantee	O
that	O
their	O
clients	O
can	O
use	O
their	O
hardware	B-Architecture
in	O
an	O
optimum	O
way	O
.	O
</s>
<s>
Typically	O
,	O
the	O
Logical	O
Device	B-Application
Driver	I-Application
(	O
LDD	O
)	O
is	O
written	O
by	O
the	O
operating	B-General_Concept
system	I-General_Concept
vendor	O
,	O
while	O
the	O
Physical	O
Device	B-Application
Driver	I-Application
(	O
PDD	O
)	O
is	O
implemented	O
by	O
the	O
device	O
vendor	O
.	O
</s>
<s>
However	O
,	O
in	O
recent	O
years	O
,	O
non-vendors	O
have	O
written	O
numerous	O
device	B-Application
drivers	I-Application
for	O
proprietary	O
devices	O
,	O
mainly	O
for	O
use	O
with	O
free	B-Application
and	I-Application
open	I-Application
source	I-Application
operating	B-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
In	O
such	O
cases	O
,	O
it	O
is	O
important	O
that	O
the	O
hardware	B-Architecture
manufacturer	O
provide	O
information	O
on	O
how	O
the	O
device	O
communicates	O
.	O
</s>
<s>
Although	O
this	O
information	O
can	O
instead	O
be	O
learned	O
by	O
reverse	O
engineering	O
,	O
this	O
is	O
much	O
more	O
difficult	O
with	O
hardware	B-Architecture
than	O
it	O
is	O
with	O
software	O
.	O
</s>
<s>
Microsoft	O
has	O
attempted	O
to	O
reduce	O
system	O
instability	O
due	O
to	O
poorly	O
written	O
device	B-Application
drivers	I-Application
by	O
creating	O
a	O
new	O
framework	O
for	O
driver	O
development	O
,	O
called	O
Windows	B-Application
Driver	I-Application
Frameworks	I-Application
(	O
WDF	O
)	O
.	O
</s>
<s>
This	O
includes	O
User-Mode	B-Application
Driver	I-Application
Framework	I-Application
(	O
UMDF	B-Application
)	O
that	O
encourages	O
development	O
of	O
certain	O
types	O
of	O
drivers	O
—	O
primarily	O
those	O
that	O
implement	O
a	O
message-based	B-Architecture
protocol	I-Architecture
for	O
communicating	O
with	O
their	O
devices	O
—	O
as	O
user-mode	B-Operating_System
drivers	O
.	O
</s>
<s>
The	O
Kernel-Mode	B-Application
Driver	I-Application
Framework	I-Application
(	O
KMDF	B-Application
)	O
model	O
continues	O
to	O
allow	O
development	O
of	O
kernel-mode	B-Operating_System
device	B-Application
drivers	I-Application
,	O
but	O
attempts	O
to	O
provide	O
standard	O
implementations	O
of	O
functions	O
that	O
are	O
known	O
to	O
cause	O
problems	O
,	O
including	O
cancellation	O
of	O
I/O	B-General_Concept
operations	I-General_Concept
,	O
power	O
management	O
,	O
and	O
plug	O
and	O
play	O
device	O
support	O
.	O
</s>
<s>
Apple	O
has	O
an	O
open-source	O
framework	O
for	O
developing	O
drivers	O
on	O
macOS	B-Application
,	O
called	O
I/O	B-General_Concept
Kit	O
.	O
</s>
<s>
In	O
Linux	B-Operating_System
environments	O
,	O
programmers	O
can	O
build	O
device	B-Application
drivers	I-Application
as	O
parts	O
of	O
the	O
kernel	B-Operating_System
,	O
separately	O
as	O
loadable	O
modules	B-Application
,	O
or	O
as	O
user-mode	B-Operating_System
drivers	O
(	O
for	O
certain	O
types	O
of	O
devices	O
where	O
kernel	B-Operating_System
interfaces	B-Application
exist	O
,	O
such	O
as	O
for	O
USB	O
devices	O
)	O
.	O
</s>
<s>
Makedev	O
includes	O
a	O
list	O
of	O
the	O
devices	O
in	O
Linux	B-Operating_System
,	O
including	O
ttyS	O
(	O
terminal	O
)	O
,	O
lp	O
(	O
parallel	B-Device
port	I-Device
)	O
,	O
hd	O
(	O
disk	B-Device
)	O
,	O
loop	O
,	O
and	O
sound	O
(	O
these	O
include	O
mixer	O
,	O
sequencer	O
,	O
dsp	B-Architecture
,	O
and	O
audio	O
)	O
.	O
</s>
<s>
Microsoft	B-Application
Windows	I-Application
.sys	O
files	O
and	O
Linux	B-Operating_System
.ko	B-Application
files	O
can	O
contain	O
loadable	O
device	B-Application
drivers	I-Application
.	O
</s>
<s>
The	O
advantage	O
of	O
loadable	O
device	B-Application
drivers	I-Application
is	O
that	O
they	O
can	O
be	O
loaded	O
only	O
when	O
necessary	O
and	O
then	O
unloaded	O
,	O
thus	O
saving	O
kernel	B-Operating_System
memory	O
.	O
</s>
<s>
Device	B-Application
drivers	I-Application
,	O
particularly	O
on	O
Microsoft	B-Application
Windows	I-Application
platforms	B-Device
,	O
can	O
run	O
in	O
kernel-mode	B-Operating_System
(	O
Ring	B-Operating_System
0	I-Operating_System
on	I-Operating_System
x86	I-Operating_System
CPUs	I-Operating_System
)	O
or	O
in	O
user-mode	B-Operating_System
(	O
Ring3	O
on	O
x86	O
CPUs	O
)	O
.	O
</s>
<s>
The	O
primary	O
benefit	O
of	O
running	O
a	O
driver	O
in	O
user	B-Operating_System
mode	I-Operating_System
is	O
improved	O
stability	O
,	O
since	O
a	O
poorly	O
written	O
user-mode	B-Operating_System
device	B-Application
driver	I-Application
cannot	O
crash	O
the	O
system	O
by	O
overwriting	O
kernel	B-Operating_System
memory	O
.	O
</s>
<s>
On	O
the	O
other	O
hand	O
,	O
user/kernel	O
-mode	O
transitions	O
usually	O
impose	O
a	O
considerable	O
performance	O
overhead	O
,	O
thus	O
making	O
kernel-mode	B-Operating_System
drivers	O
preferred	O
for	O
low-latency	O
networking	O
.	O
</s>
<s>
Kernel	B-Operating_System
space	I-Operating_System
can	O
be	O
accessed	O
by	O
user-mode	B-Operating_System
only	O
through	O
the	O
use	O
of	O
system	B-Operating_System
calls	I-Operating_System
.	O
</s>
<s>
End	O
user	O
programs	O
like	O
the	O
UNIX	O
shell	O
or	O
other	O
GUI-based	O
applications	O
are	O
part	O
of	O
user	B-Operating_System
space	I-Operating_System
.	O
</s>
<s>
These	O
applications	O
interact	O
with	O
hardware	B-Architecture
through	O
kernel	B-Operating_System
supported	O
functions	O
.	O
</s>
<s>
Because	O
of	O
the	O
diversity	O
of	O
hardware	B-Architecture
and	O
operating	B-General_Concept
systems	I-General_Concept
,	O
drivers	O
operate	O
in	O
many	O
different	O
environments	O
.	O
</s>
<s>
Drivers	O
may	O
interface	B-Application
with	O
:	O
</s>
<s>
Low-bandwidth	O
I/O	B-General_Concept
buses	B-General_Concept
of	O
various	O
sorts	O
(	O
for	O
pointing	B-Device
devices	I-Device
such	O
as	O
mice	B-Device
,	O
keyboards	B-Device
,	O
etc	O
.	O
)	O
</s>
<s>
Radio	O
frequency	O
communication	O
transceiver	O
adapters	O
for	O
wireless	B-General_Concept
personal	I-General_Concept
area	I-General_Concept
networks	I-General_Concept
as	O
used	O
for	O
short-distance	O
and	O
low-rate	O
wireless	O
communication	O
in	O
home	O
automation	O
,	O
(	O
such	O
as	O
example	O
Bluetooth	B-General_Concept
Low	I-General_Concept
Energy	I-General_Concept
(	O
BLE	O
)	O
,	O
Thread	B-Protocol
,	O
Zigbee	B-Protocol
,	O
and	O
Z-Wave	B-Device
)	O
.	O
</s>
<s>
Common	O
levels	O
of	O
abstraction	B-Application
for	O
device	B-Application
drivers	I-Application
include	O
:	O
</s>
<s>
For	O
hardware	B-Architecture
:	O
</s>
<s>
Using	O
some	O
higher-level	O
interface	B-Application
(	O
e.g.	O
</s>
<s>
Using	O
another	O
lower-level	O
device	B-Application
driver	I-Application
(	O
e.g.	O
</s>
<s>
Implementing	O
an	O
interface	B-Application
for	O
non-driver	O
software	O
(	O
e.g.	O
</s>
<s>
So	O
choosing	O
and	O
installing	O
the	O
correct	O
device	B-Application
drivers	I-Application
for	O
given	O
hardware	B-Architecture
is	O
often	O
a	O
key	O
component	O
of	O
computer	O
system	O
configuration	O
.	O
</s>
<s>
Virtual	O
device	B-Application
drivers	I-Application
represent	O
a	O
particular	O
variant	O
of	O
device	B-Application
drivers	I-Application
.	O
</s>
<s>
They	O
are	O
used	O
to	O
emulate	O
a	O
hardware	B-Architecture
device	O
,	O
particularly	O
in	O
virtualization	B-Architecture
environments	O
,	O
for	O
example	O
when	O
a	O
DOS	B-Device
program	O
is	O
run	O
on	O
a	O
Microsoft	B-Application
Windows	I-Application
computer	O
or	O
when	O
a	O
guest	O
operating	B-General_Concept
system	I-General_Concept
is	O
run	O
on	O
,	O
for	O
example	O
,	O
a	O
Xen	B-Operating_System
host	O
.	O
</s>
<s>
Instead	O
of	O
enabling	O
the	O
guest	O
operating	B-General_Concept
system	I-General_Concept
to	O
dialog	O
with	O
hardware	B-Architecture
,	O
virtual	O
device	B-Application
drivers	I-Application
take	O
the	O
opposite	O
role	O
and	O
emulates	O
a	O
piece	O
of	O
hardware	B-Architecture
,	O
so	O
that	O
the	O
guest	O
operating	B-General_Concept
system	I-General_Concept
and	O
its	O
drivers	O
running	O
inside	O
a	O
virtual	B-Architecture
machine	I-Architecture
can	O
have	O
the	O
illusion	O
of	O
accessing	O
real	O
hardware	B-Architecture
.	O
</s>
<s>
Attempts	O
by	O
the	O
guest	O
operating	B-General_Concept
system	I-General_Concept
to	O
access	O
the	O
hardware	B-Architecture
are	O
routed	O
to	O
the	O
virtual	O
device	B-Application
driver	I-Application
in	O
the	O
host	O
operating	B-General_Concept
system	I-General_Concept
as	O
e.g.	O
,	O
function	O
calls	O
.	O
</s>
<s>
The	O
virtual	O
device	B-Application
driver	I-Application
can	O
also	O
send	O
simulated	O
processor-level	O
events	O
like	O
interrupts	B-Application
into	O
the	O
virtual	B-Architecture
machine	I-Architecture
.	O
</s>
<s>
For	O
example	O
,	O
a	O
virtual	O
network	B-Protocol
adapter	I-Protocol
is	O
used	O
with	O
a	O
virtual	B-Application
private	I-Application
network	I-Application
,	O
while	O
a	O
virtual	O
disk	B-Device
device	O
is	O
used	O
with	O
iSCSI	B-Protocol
.	O
</s>
<s>
A	O
good	O
example	O
for	O
virtual	O
device	B-Application
drivers	I-Application
can	O
be	O
Daemon	B-Application
Tools	I-Application
.	O
</s>
<s>
There	O
are	O
several	O
variants	O
of	O
virtual	O
device	B-Application
drivers	I-Application
,	O
such	O
as	O
VxDs	B-Application
,	O
VLMs	O
,	O
and	O
VDDs	O
.	O
</s>
<s>
Solaris	B-Application
descriptions	O
of	O
commonly	O
used	O
device	B-Application
drivers	I-Application
:	O
</s>
<s>
Windows	B-Device
Display	I-Device
Driver	I-Device
Model	I-Device
(	O
WDDM	B-Device
)	O
–	O
the	O
graphic	O
display	O
driver	O
architecture	O
for	O
Windows	B-Application
Vista	I-Application
and	O
later	O
.	O
</s>
<s>
A	O
device	O
on	O
the	O
PCI	B-Protocol
bus	I-Protocol
or	O
USB	O
is	O
identified	O
by	O
two	O
IDs	O
which	O
consist	O
of	O
4	O
hexadecimal	O
numbers	O
each	O
.	O
</s>
<s>
A	O
PCI	B-Protocol
device	O
has	O
often	O
an	O
ID	O
pair	O
for	O
the	O
main	O
chip	O
of	O
the	O
device	O
,	O
and	O
also	O
a	O
subsystem	O
ID	O
pair	O
which	O
identifies	O
the	O
vendor	O
,	O
which	O
may	O
be	O
different	O
from	O
the	O
chip	O
manufacturer	O
.	O
</s>
<s>
Devices	O
often	O
have	O
a	O
large	O
number	O
of	O
diverse	O
and	O
customized	O
device	B-Application
drivers	I-Application
running	O
in	O
their	O
operating	B-General_Concept
system	I-General_Concept
(	O
OS	O
)	O
kernel	B-Operating_System
and	O
often	O
contain	O
various	O
bugs	B-Error_Name
and	O
vulnerabilities	O
,	O
making	O
them	O
a	O
target	O
for	O
exploits	O
.	O
</s>
<s>
Bring	O
Your	O
Own	O
Vulnerable	O
Driver	O
(	O
BYOVD	O
)	O
uses	O
signed	O
,	O
old	O
drivers	O
that	O
contain	O
flaws	O
that	O
allow	O
hackers	O
to	O
insert	O
malicious	O
code	O
into	O
the	O
kernel	B-Operating_System
.	O
</s>
<s>
There	O
is	O
a	O
lack	O
of	O
effective	O
kernel	B-Operating_System
vulnerability	O
detection	O
tools	O
,	O
especially	O
for	O
closed-source	O
OSes	O
such	O
as	O
Microsoft	B-Application
Windows	I-Application
where	O
the	O
source	O
code	O
of	O
the	O
device	B-Application
drivers	I-Application
is	O
mostly	O
not	O
public	O
(	O
open	O
source	O
)	O
and	O
the	O
drivers	O
often	O
also	O
have	O
many	O
privileges	O
.	O
</s>
<s>
A	O
group	O
of	O
security	O
researchers	O
considers	O
the	O
lack	O
of	O
isolation	O
as	O
one	O
of	O
the	O
main	O
factors	O
undermining	O
kernel	B-Operating_System
security	O
,	O
and	O
published	O
a	O
isolation	O
framework	O
to	O
protect	O
operating	B-General_Concept
system	I-General_Concept
kernels	B-Operating_System
,	O
primarily	O
the	O
monolithic	B-Operating_System
Linux	B-Operating_System
kernel	I-Operating_System
which	O
,	O
according	O
to	O
them	O
,	O
gets	O
~	O
80,000	O
commits/year	O
to	O
its	O
drivers	O
.	O
</s>
