<s>
HAL	B-Application
(	O
Hardware	B-Operating_System
Abstraction	I-Operating_System
Layer	I-Operating_System
or	O
rather	O
Hardware	B-Architecture
Annotation	O
Library	O
)	O
is	O
a	O
software	O
subsystem	O
for	O
UNIX-like	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
providing	O
hardware	B-Operating_System
abstraction	I-Operating_System
.	O
</s>
<s>
HAL	B-Application
is	O
now	O
deprecated	B-General_Concept
on	O
most	O
Linux	B-Application
distributions	O
and	O
on	O
FreeBSD	B-Operating_System
.	O
</s>
<s>
Functionality	O
is	O
being	O
merged	O
into	O
udev	B-Application
on	O
Linux	B-Application
as	O
of	O
2008	O
–	O
2010	O
and	O
devd	O
on	O
FreeBSD	B-Operating_System
.	O
</s>
<s>
Previously	O
,	O
HAL	B-Application
was	O
built	O
on	O
top	O
of	O
udev	B-Application
.	O
</s>
<s>
Some	O
other	O
operating	B-General_Concept
systems	I-General_Concept
which	O
do	O
n't	O
have	O
an	O
alternative	O
like	O
udev	B-Application
or	O
devd	O
still	O
use	O
HAL	B-Application
.	O
</s>
<s>
The	O
purpose	O
of	O
the	O
hardware	B-Operating_System
abstraction	I-Operating_System
layer	I-Operating_System
was	O
to	O
allow	O
desktop	B-Application
applications	I-Application
to	O
discover	O
and	O
use	O
the	O
hardware	B-Architecture
of	O
the	O
host	O
system	O
through	O
a	O
simple	O
,	O
portable	B-Architecture
and	O
abstract	B-Application
API	B-General_Concept
,	O
regardless	O
of	O
the	O
type	O
of	O
the	O
underlying	O
hardware	B-Architecture
.	O
</s>
<s>
HAL	B-Application
for	O
Linux	B-Application
OS	I-Application
was	O
originally	O
envisioned	O
by	O
Havoc	O
Pennington	O
.	O
</s>
<s>
It	O
became	O
a	O
freedesktop.org	B-Application
project	O
,	O
and	O
was	O
a	O
key	O
part	O
of	O
the	O
software	O
stack	O
of	O
the	O
GNOME	B-Application
and	O
KDE	B-Application
desktop	O
environments	O
.	O
</s>
<s>
It	O
is	O
free	B-Application
software	I-Application
,	O
dual-licensed	O
under	O
both	O
the	O
GNU	B-License
General	I-License
Public	I-License
License	I-License
and	O
the	O
Academic	B-License
Free	I-License
License	I-License
.	O
</s>
<s>
HAL	B-Application
is	O
unrelated	O
to	O
the	O
concept	O
of	O
Windows	B-Device
NT	I-Device
kernel	B-Operating_System
HALs	B-Application
,	O
which	O
handle	O
some	O
platform-specific	O
core	O
functionality	O
within	O
the	O
kernel	B-Operating_System
,	O
such	O
as	O
interrupt	O
routing	O
.	O
</s>
<s>
Traditionally	O
,	O
the	O
operating	B-Operating_System
system	I-Operating_System
kernel	I-Operating_System
was	O
responsible	O
for	O
providing	O
an	O
abstract	B-Application
interface	O
to	O
the	O
hardware	B-Architecture
the	O
system	O
ran	O
on	O
.	O
</s>
<s>
Applications	O
used	O
the	O
system	B-Operating_System
call	I-Operating_System
interface	O
,	O
or	O
performed	O
file	O
I/O	B-General_Concept
on	O
device	B-Application
nodes	I-Application
in	O
order	O
to	O
communicate	O
with	O
hardware	B-Architecture
through	O
these	O
abstractions	B-Application
.	O
</s>
<s>
This	O
sufficed	O
for	O
the	O
simple	O
hardware	B-Architecture
of	O
early	O
desktop	O
computing	O
.	O
</s>
<s>
Computer	B-Architecture
hardware	I-Architecture
,	O
however	O
,	O
has	O
increased	O
in	O
complexity	O
and	O
the	O
abstractions	B-Application
provided	O
by	O
Unix	B-Application
kernels	B-Operating_System
have	O
not	O
kept	O
pace	O
with	O
the	O
proliferating	O
number	O
of	O
device	O
and	O
peripheral	O
types	O
now	O
common	O
on	O
both	O
server	O
and	O
desktop	O
computers	O
.	O
</s>
<s>
Most	O
modern	O
buses	B-General_Concept
have	O
also	O
become	O
hotplug-capable	O
and	O
can	O
have	O
non-trivial	O
topologies	B-Architecture
.	O
</s>
<s>
As	O
a	O
result	O
,	O
devices	O
are	O
discovered	O
or	O
change	O
state	O
in	O
ways	O
which	O
can	O
be	O
difficult	O
to	O
track	O
through	O
the	O
system	B-Operating_System
call	I-Operating_System
interface	O
or	O
Unix	B-Application
IPC	B-Operating_System
.	O
</s>
<s>
The	O
complexity	O
of	O
doing	O
so	O
forces	O
application	O
authors	O
to	O
re-implement	O
hardware	B-Architecture
support	O
logic	O
.	O
</s>
<s>
These	O
must	O
often	O
be	O
invoked	O
in	O
ways	O
that	O
can	O
be	O
awkward	O
to	O
express	O
with	O
the	O
Unix	B-Application
permissions	O
model	O
(	O
for	O
example	O
,	O
allowing	O
users	O
to	O
join	O
wireless	B-General_Concept
networks	I-General_Concept
only	O
if	O
they	O
are	O
logged	O
into	O
the	O
video	O
console	O
)	O
.	O
</s>
<s>
Application	O
authors	O
resort	O
to	O
using	O
setuid	O
binaries	O
or	O
run	O
service	O
daemons	B-Operating_System
to	O
provide	O
their	O
own	O
access	O
control	O
and	O
privilege	O
separation	O
,	O
potentially	O
introducing	O
security	O
holes	O
each	O
time	O
.	O
</s>
<s>
HAL	B-Application
is	O
a	O
single	O
daemon	B-Operating_System
responsible	O
for	O
discovering	O
,	O
enumerating	O
and	O
mediating	O
access	O
to	O
most	O
of	O
the	O
hardware	B-Architecture
on	O
the	O
host	O
computer	O
.	O
</s>
<s>
Applications	O
communicate	O
with	O
HAL	B-Application
through	O
the	O
D-Bus	B-Language
IPC	B-Operating_System
mechanism	O
,	O
which	O
abstracts	O
the	O
hardware	B-Architecture
behind	O
an	O
object-based	B-Application
RPC	B-Operating_System
mechanism	O
.	O
</s>
<s>
Each	O
logical	O
hardware	B-Architecture
device	O
is	O
represented	O
as	O
a	O
D-Bus	B-Language
object	O
,	O
and	O
its	O
bus	O
address	O
is	O
used	O
as	O
a	O
unique	O
identifier	O
.	O
</s>
<s>
Devices	O
include	O
abstractions	B-Application
like	O
disk	B-Application
partitions	I-Application
and	O
visible	O
wireless	B-General_Concept
networks	I-General_Concept
.	O
</s>
<s>
The	O
device	O
's	O
functionality	O
is	O
exposed	O
through	O
D-Bus	B-Language
interfaces	O
,	O
and	O
its	O
state	O
accessed	O
through	O
properties	O
,	O
a	O
set	O
of	O
key-value	O
pairs	O
.	O
</s>
<s>
HAL	B-Application
broadcasts	O
hardware	B-Architecture
events	O
as	O
signals	O
on	O
these	O
objects	O
;	O
applications	O
can	O
listen	O
for	O
signals	O
and	O
react	O
to	O
the	O
hardware	B-Architecture
events	O
that	O
they	O
signify	O
—	O
events	O
such	O
as	O
a	O
digital	B-Device
camera	I-Device
being	O
plugged	O
in	O
,	O
an	O
optical	B-Device
disc	I-Device
spinning	O
up	O
or	O
a	O
laptop	O
computer	O
closing	O
its	O
lid	O
.	O
</s>
<s>
On	O
Linux	B-Application
,	O
HAL	B-Application
uses	O
/sys	B-Application
(	O
a	O
virtual	B-Application
file	I-Application
system	I-Application
for	O
Linux	B-Application
systems	O
)	O
to	O
discover	O
hardware	B-Architecture
and	O
listen	O
for	O
kernel	B-Operating_System
hotplug	B-Device
events	O
.	O
</s>
<s>
Some	O
Linux	B-Application
distributions	O
also	O
provide	O
a	O
udev	B-Application
rule	O
to	O
allow	O
the	O
udev	B-Application
daemon	B-Operating_System
to	O
notify	O
HAL	B-Application
whenever	O
new	O
device	B-Application
nodes	I-Application
appear	O
.	O
</s>
<s>
,	O
Linux	B-Application
distributions	O
such	O
as	O
Ubuntu	B-Operating_System
,	O
Debian	O
,	O
and	O
Fedora	O
and	O
on	O
FreeBSD	B-Operating_System
,	O
and	O
projects	O
such	O
as	O
KDE	B-Application
,	O
GNOME	B-Application
and	O
X.org	B-Operating_System
are	O
in	O
the	O
process	O
of	O
deprecating	B-General_Concept
HAL	B-Application
as	O
it	O
has	O
"	O
become	O
a	O
large	O
monolithic	O
unmaintainable	O
mess	O
"	O
.	O
</s>
<s>
The	O
process	O
is	O
largely	O
complete	O
,	O
but	O
some	O
use	O
of	O
HAL	B-Application
remains	O
–	O
Debian	O
squeeze	O
(	O
Feb	O
2011	O
)	O
and	O
Ubuntu	B-Operating_System
version	O
10.04	O
remove	O
HAL	B-Application
from	O
the	O
basic	O
system	O
and	O
boot	O
process	O
.	O
</s>
<s>
In	O
Linux	B-Application
,	O
it	O
is	O
in	O
the	O
process	O
of	O
being	O
merged	O
into	O
udev	B-Application
(	O
main	O
udev	B-Application
,	O
libudev	B-Application
,	O
and	O
udev-extras	O
)	O
and	O
existing	O
udev	B-Application
and	O
kernel	B-Operating_System
functionality	O
.	O
</s>
<s>
The	O
replacement	O
for	O
non-Linux	O
systems	O
such	O
as	O
FreeBSD	B-Operating_System
is	O
devd	O
.	O
</s>
<s>
Initially	O
a	O
new	O
daemon	B-Operating_System
DeviceKit	B-Application
was	O
planned	O
to	O
replace	O
certain	O
aspects	O
of	O
HAL	B-Application
,	O
but	O
in	O
March	O
2009	O
,	O
DeviceKit	B-Application
was	O
deprecated	B-General_Concept
in	O
favor	O
of	O
adding	O
the	O
same	O
code	O
to	O
udev	B-Application
as	O
package	O
,	O
and	O
some	O
functions	O
have	O
now	O
moved	O
to	O
proper	O
.	O
</s>
