HOME

TheInfoList



OR:

HAL (Hardware Abstraction Layer or rather Hardware Annotation Library) is a
software Software consists of computer programs that instruct the Execution (computing), execution of a computer. Software also includes design documents and specifications. The history of software is closely tied to the development of digital comput ...
subsystem for
UNIX-like A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
operating systems providing
hardware abstraction Hardware abstractions are sets of routines in software that provide programs with access to hardware resources through programming interfaces. The programming interface allows all devices in a particular class ''C'' of hardware devices to be acc ...
. HAL is now deprecated on most Linux distributions and on FreeBSD. Functionality is being merged into
udev udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ...
on Linux as of 2008–2010 and devd on FreeBSD. Previously, HAL was built on top of udev. Some other operating systems which don't have an alternative like udev or devd still use HAL. The purpose of the hardware abstraction layer was to allow desktop applications to discover and use the hardware of the host system through a simple,
portable Portable may refer to: General * Portable building, a manufactured structure that is built off site and moved in upon completion of site and utility work * Portable classroom, a temporary building installed on the grounds of a school to provide a ...
and abstract
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
, regardless of the type of the underlying hardware. HAL for Linux OS was originally envisioned by
Havoc Pennington Robert Sanford Havoc Pennington (born c. 1976) is an American computer engineer and entrepreneur. He is known in the free software movement due to his work on HAL, GNOME, Metacity, GConf, and D-Bus. History Havoc Pennington graduated from ...
. It became a freedesktop.org project, and was a key part of the software stack of the
GNOME A gnome () is a mythological creature and diminutive spirit in Renaissance magic and alchemy, introduced by Paracelsus in the 16th century and widely adopted by authors, including those of modern fantasy literature. They are typically depict ...
and
KDE KDE is an international free software community that develops free and open-source software. As a central development hub, it provides tools and resources that enable collaborative work on its projects. Its products include the KDE Plasma gra ...
desktop environment In computing, a desktop environment (DE) is an implementation of the desktop metaphor made of a bundle of programs running on top of a computer operating system that share a common graphical user interface (GUI), sometimes described as a graphi ...
s. It is
free software Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
, dual-licensed under both the
GNU General Public License The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was the first ...
and the Academic Free License. HAL is unrelated to the concept of
Windows NT Windows NT is a Proprietary software, proprietary Graphical user interface, graphical operating system produced by Microsoft as part of its Windows product line, the first version of which, Windows NT 3.1, was released on July 27, 1993. Original ...
kernel HALs, which handle some platform-specific core functionality within the kernel, such as interrupt routing.


Rationale

Traditionally, the
operating system An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ...
kernel was responsible for providing an abstract interface to the hardware the system ran on. Applications used the
system call In computing, a system call (syscall) is the programmatic way in which a computer program requests a service from the operating system on which it is executed. This may include hardware-related services (for example, accessing a hard disk drive ...
interface, or performed file I/O on device nodes in order to communicate with hardware through these abstractions. This sufficed for the simple hardware of early desktop computing. Computer hardware, however, has increased in complexity and the abstractions provided by Unix kernels have not kept pace with the proliferating number of device and
peripheral A peripheral device, or simply peripheral, is an auxiliary hardware device that a computer uses to transfer information externally. A peripheral is a hardware component that is accessible to and controlled by a computer but is not a core compo ...
types now common on both server and desktop computers. Most modern
buses A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a motor vehicle that carries significantly more passengers than an average car or van, but fewer than the average rail transport. It is most commonly used ...
have also become hotplug-capable and can have non-trivial topologies. As a result, devices are discovered or change state in ways which can be difficult to track through the system call interface or Unix IPC. The complexity of doing so forces application authors to re-implement hardware support logic. Some devices also require privileged helper programs to prepare them for use. These must often be invoked in ways that can be awkward to express with the Unix permissions model (for example, allowing users to join
wireless network A wireless network is a computer network that uses wireless data connections between network nodes. Wireless networking allows homes, telecommunications networks, and business installations to avoid the costly process of introducing cables int ...
s only if they are logged into the video console). Application authors resort to using
setuid The Unix and Linux access rights flags setuid and setgid (short for ''set user identity'' and ''set group identity'') allow users to run an executable with the file system permissions of the executable's owner or group respectively and to chang ...
binaries or run service daemons to provide their own access control and privilege separation, potentially introducing security holes each time.


Design

HAL is a single daemon responsible for discovering, enumerating and mediating access to most of the hardware on the host computer. Applications communicate with HAL through the
D-Bus D-Bus (short for "Desktop Bus") is a message-oriented middleware mechanism that allows communication between multiple Process (computing), processes running concurrently on the same machine. D-Bus was developed as part of the freedesktop.org pro ...
IPC mechanism, which abstracts the hardware behind an object-based RPC mechanism. Each logical hardware ''device'' is represented as a D-Bus object, and its bus address is used as a unique identifier. Devices include abstractions like
disk partitions Disk partitioning or disk slicing is the creation of one or more regions on Computer data storage#Secondary storage, secondary storage, so that each region can be managed separately. These regions are called partitions. It is typically the first ...
and visible wireless networks. The device's functionality is exposed through D-Bus ''interfaces'', and its state accessed through ''properties'', a set of key-value pairs. HAL broadcasts hardware events as ''signals'' on these objects; applications can listen for signals and react to the hardware events that they signify—events such as a
digital camera A digital camera, also called a digicam, is a camera that captures photographs in Digital data storage, digital memory. Most cameras produced today are digital, largely replacing those that capture images on photographic film or film stock. Dig ...
being plugged in, an
optical disc An optical disc is a flat, usuallyNon-circular optical discs exist for fashion purposes; see shaped compact disc. disc-shaped object that stores information in the form of physical variations on its surface that can be read with the aid o ...
spinning up or a laptop computer closing its lid.


Implementations and obsolescence

On Linux, HAL uses /sys (a
virtual file system A virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS ...
for
Linux Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
systems) to discover hardware and listen for kernel hotplug events. Some Linux distributions also provide a
udev udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ...
rule to allow the udev daemon to notify HAL whenever new device nodes appear.


Deprecated

, Linux distributions such as
Ubuntu Ubuntu ( ) is a Linux distribution based on Debian and composed primarily of free and open-source software. Developed by the British company Canonical (company), Canonical and a community of contributors under a Meritocracy, meritocratic gover ...
,
Debian Debian () is a free and open-source software, free and open source Linux distribution, developed by the Debian Project, which was established by Ian Murdock in August 1993. Debian is one of the oldest operating systems based on the Linux kerne ...
, and Fedora and on FreeBSD, and projects such as KDE, GNOME and X.org are in the process of deprecating HAL as it has "become a large monolithic unmaintainable mess". The process is largely complete, but some use of HAL remains – Debian squeeze (Feb 2011) and Ubuntu version 10.04 remove HAL from the basic system and boot process. In Linux, it is in the process of being merged into
udev udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ...
(main udev, libudev, and udev-extras) and existing udev and kernel functionality. The replacement for non-Linux systems such as FreeBSD is devd. Initially a new daemon DeviceKit was planned to replace certain aspects of HAL, but in March 2009, DeviceKit was deprecated in favor of adding the same code to udev as package , and some functions have now moved to proper.


See also

* devfsd * eudev *
udev udev (userspace ) is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the directory. At the same time, udev also handles all user space events raised when hardware devices ...
* UPower


References


External links


HAL - Hardware Abstraction Layer
{{Freedesktop.org Applications using D-Bus Free system software Freedesktop.org Human–computer interaction Software using the Academic Free License User interfaces