HOME

TheInfoList



OR:

HAL (Hardware Abstraction Layer or rather Hardware Annotation Library) is a
software Software is a set of computer programs and associated documentation and data. This is in contrast to hardware, from which the system is built and which actually performs the work. At the lowest programming level, executable code consists ...
subsystem for
UNIX-like A Unix-like (sometimes referred to as UN*X 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 Unix-li ...
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 acce ...
. HAL is now deprecated on most Linux distributions and on FreeBSD. Functionality is being merged into udev on Linux as of 2008–2010 and devd on FreeBSD. Previously, HAL was built on top of udev. Some other OS-es which don't have an alternative like udev or devd still use HAL. The purpose of the hardware abstraction layer was to allow
desktop application A desktop traditionally refers to: * The surface of a desk (often to distinguish office appliances that fit on a desk, such as photocopiers and printers, from larger equipment covering its own area on the floor) Desktop may refer to various compu ...
s 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 way for two or more computer programs to communicate with each other. It is a type of software Interface (computing), interface, offering a service to other pieces of software. A document or standa ...
, regardless of the type of the underlying hardware. HAL for Linux OS was originally envisioned by Havoc Pennington. It became a
freedesktop.org freedesktop.org (fd.o) is a project to work on interoperability and shared base technology for Free software, free-software desktop environments for the X Window System (X11) and Wayland (display server protocol), Wayland on Linux and other Uni ...
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, first introduced by Paracelsus in the 16th century and later adopted by more recent authors including those of modern fantasy literature. Its characte ...
and
KDE KDE is an international Free software movement, free software community that develops free and open-source software. As a central development hub, it provides tools and resources that allow collaborative work on this kind of software. Well-know ...
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 graphica ...
s. It is
free software Free software or libre software is computer software distributed under terms that allow users to run the software for any purpose as well as to study, change, and distribute it and any adapted versions. Free software is a matter of liberty, no ...
, dual-licensed under both the
GNU General Public License The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the Four Freedoms (Free software), four freedoms to run, study, share, and modify the software. The license was th ...
and the
Academic Free License The Academic Free License (AFL) is a permissive free software license written in 2002 by Lawrence E. Rosen, a former general counsel of the Open Source Initiative (OSI). The license grants similar rights to the BSD, MIT, UoI/NCSA and Apache l ...
. HAL is unrelated to the concept of
Windows NT Windows NT is a proprietary graphical operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems sc ...
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, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
kernel was responsible for providing an abstract interface to the hardware the system ran on. Applications used the system call 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 or peripheral device is an auxiliary device used to put information into and get information out of a computer. The term ''peripheral device'' refers to all hardware components that are attached to a computer and are controlled by the ...
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 road vehicle that carries significantly more passengers than an average car or van. It is most commonly used in public transport, but is also in use for cha ...
have also become
hotplug Hot swapping is the replacement or addition of components to a computer system without stopping, shutting down, or rebooting the system; hot plugging describes the addition of components only. Components which have such functionality are said ...
-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 is a method by which homes, telecommunications networks and business installations avoid the costly process of introducing c ...
s only if they are logged into the video console). Application authors resort to using setuid 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 In computing, D-Bus (short for "Desktop Bus") is a message-oriented middleware mechanism that allows communication between multiple processes running concurrently on the same machine. D-Bus was developed as part of the freedesktop.org project, ...
IPC IPC may refer to: Computing * Infrastructure protection centre or information security operations center * Instructions per cycle or instructions per clock, an aspect of central-processing performance * Inter-process communication, the sharin ...
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 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 being plugged in, an
optical disc In computing and optical disc recording technologies, an optical disc (OD) is a flat, usually circular disc that encodes binary data (bits) in the form of pits and lands on a special material, often aluminum, on one of its flat surfaces. ...
spinning up or a laptop computer closing its lid.


Implementations and obsolescence

On Linux, HAL uses
/sys sysfs is a pseudo file system provided by the Linux kernel that exports information about various kernel subsystems, hardware devices, and associated device drivers from the kernel's device model to user space through virtual files. In addition ...
(a virtual file system for
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
systems) to discover hardware and listen for kernel
hotplug Hot swapping is the replacement or addition of components to a computer system without stopping, shutting down, or rebooting the system; hot plugging describes the addition of components only. Components which have such functionality are said ...
events. Some Linux distributions also provide a udev 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 mostly of free and open-source software. Ubuntu is officially released in three editions: ''Desktop'', ''Server'', and ''Core'' for Internet of things devices and robots. All the ...
,
Debian Debian (), also known as Debian GNU/Linux, is a Linux distribution composed of free and open-source software, developed by the community-supported Debian Project, which was established by Ian Murdock on August 16, 1993. The first version of D ...
, and
Fedora A fedora () is a hat with a soft brim and indented crown.Kilgour, Ruth Edwards (1958). ''A Pageant of Hats Ancient and Modern''. R. M. McBride Company. It is typically creased lengthwise down the crown and "pinched" near the front on both sides ...
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 (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 DeviceKit is a modular hardware abstraction layer designed for use in Linux systems that is designed to simplify device management and replace the current monolithic Linux HAL. DeviceKit includes the ability to enumerate system devices and send ...
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 devfsd is a device manager for the Linux kernel. Primarily, it creates device nodes in the directory when kernel drivers make the underlying hardware accessible. The nodes exist in a virtual device file system named devfs. In systems that suppor ...
*
eudev systemd is a software suite that provides an array of system components for Linux operating systems. Its main aim is to unify service configuration and behavior across Linux distributions; Its primary component is a "system and service manager ...
* udev * 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