HAL (software)
Encyclopedia
HAL was a software project providing a hardware abstraction layer for Unix-like
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....

 computer systems.

HAL is now deprecated
Deprecation
In the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded...

 on GNU/Linux systems, with functionality being merged into udev
Udev
udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...

 as of 2008–2010. Previously, HAL was built on top of udev, which was lower level.

It aimed to allow desktop applications to discover and use the hardware
Computer hardware
Personal computer hardware are component devices which are typically installed into or peripheral to a computer case to create a personal computer upon which system software is installed including a firmware interface such as a BIOS and an operating system which supports application software that...

 of the host system through a simple, portable
Software portability
Portability in high-level computer programming is the usability of the same software in different environments. The prerequirement for portability is the generalized abstraction between the application logic and system interfaces...

 and abstract
Abstraction (computer science)
In computer science, abstraction is the process by which data and programs are defined with a representation similar to its pictorial meaning as rooted in the more complex realm of human life and language with their higher need of summarization and categorization , while hiding away the...

 API, regardless of the type of the underlying hardware.

HAL was originally envisioned by Havoc Pennington
Havoc Pennington
Robert Sanford Havoc Pennington is an American computer engineer and entrepreneur.He is known in the free software community due to his work on HAL , GNOME, Metacity, GConf, and D-BUS.- Career :...

 and is now a freedesktop.org
Freedesktop.org
freedesktop.org is a project to work on interoperability and shared base technology for free software desktop environments for the X Window System on Linux and other Unix-like operating systems. It was founded by Havoc Pennington from Red Hat in March 2000.The organisation focuses on the user....

 project, being a key part of the software stack of the GNOME
GNOME
GNOME is a desktop environment and graphical user interface that runs on top of a computer operating system. It is composed entirely of free and open source software...

 and KDE
KDE
KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

 desktop environment
Desktop environment
In graphical computing, a desktop environment commonly refers to a style of graphical user interface derived from the desktop metaphor that is seen on most modern personal computers. These GUIs help the user in easily accessing, configuring, and modifying many important and frequently accessed...

s. It is free software
Free software
Free software, software libre or libre software is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with restrictions that only ensure that further recipients can also do...

, dual-licensed under both the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

 and the Academic Free License
Academic Free License
The Academic Free License is a permissive free software license written in 2002 by Lawrence E. Rosen, the general counsel of the Open Source Initiative ....

.

HAL is unrelated to the earlier concept of Windows NT
Windows NT
Windows NT is a family of operating systems produced by Microsoft, the first version of which was released in July 1993. It was a powerful high-level-language-based, processor-independent, multiprocessing, multiuser operating system with features comparable to Unix. It was intended to complement...

 kernel HALs (also found in current Windows releases), which handle some platform-specific core functionality within the kernel, such as interrupt routing.

Rationale

Traditionally, the operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 kernel was responsible for providing an abstract interface to the hardware the system ran on. Applications used the system call
System call
In computing, a system call is how a program requests a service from an operating system's kernel. This may include hardware related services , creating and executing new processes, and communicating with integral kernel services...

 interface, or performed file I/O
Input/output
In computing, input/output, or I/O, refers to the communication between an information processing system , and the outside world, possibly a human, or another information processing system. Inputs are the signals or data received by the system, and outputs are the signals or data sent from it...

 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
Peripheral
A peripheral is a device attached to a host computer, but not part of it, and is more or less dependent on the host. It expands the host's capabilities, but does not form part of the core computer architecture....

 types now common on both server and desktop computers. Most modern buses
Computer bus
In computer architecture, a bus is a subsystem that transfers data between components inside a computer, or between computers.Early computer buses were literally parallel electrical wires with multiple connections, but the term is now used for any physical arrangement that provides the same...

 have also become hotplug-capable and can have non-trivial topologies
Network topology
Network topology is the layout pattern of interconnections of the various elements of a computer or biological network....

. 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
Wireless network
Wireless network refers to any type of computer network that is not connected by cables of any kind. It is a method by which homes, telecommunications networks and enterprise installations avoid the costly process of introducing cables into a building, or as a connection between various equipment...

s only if they are logged into the video console). Application authors resort to using setuid
Setuid
setuid and setgid are Unix access rights flags that allow users to run an executable with the permissions of the executable's owner or group...

 binaries or run service daemon
Daemon (computer software)
In Unix and other multitasking computer operating systems, a daemon is a computer program that runs as a background process, rather than being under the direct control of an interactive user...

s 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
In computing, D-Bus is a simple inter-process communication open-source system for software applications to communicate with one another. Heavily influenced by KDE2–3's DCOP system, D-Bus has replaced DCOP in the KDE 4 release. An implementation of D-Bus supports most POSIX operating...

 IPC
Inter-process communication
In computing, Inter-process communication is a set of methods for the exchange of data among multiple threads in one or more processes. Processes may be running on one or more computers connected by a network. IPC methods are divided into methods for message passing, synchronization, shared...

 mechanism, which abstracts the hardware behind an object-based
Object-based
In general, object-based indicates that something such as a theory, language, or model is based on the concept of object.In computer science, the term object-based has two different senses:...

 RPC
Remote procedure call
In computer science, a remote procedure call is an inter-process communication that allows a computer program to cause a subroutine or procedure to execute in another address space without the programmer explicitly coding the details for this remote interaction...

 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: listening applications can listen for these to react on hardware events (such as a digital camera
Digital camera
A digital camera is a camera that takes video or still photographs, or both, digitally by recording images via an electronic image sensor. It is the main device used in the field of digital photography...

 being plugged in, an optical disc
Optical disc
In computing and optical disc recording technologies, an optical disc is a flat, usually circular disc which encodes binary data in the form of pits and lands on a special material on one of its flat surfaces...

 spinning up or a laptop computer closing its lid).

Implementations and obsolescence

On Linux, HAL uses the /sys filesystem to discover hardware and listen for kernel hotplug events. Some Linux distributions also provide a udev
Udev
udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...

 rule to allow the udev daemon to notify HAL whenever new device nodes appear.

Deprecated

, GNU/Linux distributions such as Ubuntu
Ubuntu (operating system)
Ubuntu is a computer operating system based on the Debian Linux distribution and distributed as free and open source software. It is named after the Southern African philosophy of Ubuntu...

, Debian
Debian
Debian is a computer operating system composed of software packages released as free and open source software primarily under the GNU General Public License along with other free software licenses. Debian GNU/Linux, which includes the GNU OS tools and Linux kernel, is a popular and influential...

, and Fedora
Fedora (operating system)
Fedora is a RPM-based, general purpose collection of software, including an operating system based on the Linux kernel, developed by the community-supported Fedora Project and sponsored by Red Hat...

, and projects such as KDE, GNOME and X.org
X.Org Server
X.Org Server refers to the X server release packages stewarded by the X.Org Foundation,which is hosted by freedesktop.org, and grants...

 are in the process of deprecating
Deprecation
In the process of authoring computer software, its standards or documentation, deprecation is a status applied to software features to indicate that they should be avoided, typically because they have been superseded...

 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 GNU/Linux, it is in the process of being merged into udev
Udev
udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...

 (main udev, libudev, and udev-extras) and existing udev and kernel functionality. No specific replacement for non-GNU/Linux systems has been identified.

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 a package: udev-extras, and some functions have now moved to udev proper.

See also

  • udev
    Udev
    udev is the device manager for the Linux kernel. Primarily, it manages device nodes in /dev. It is the successor of devfs and hotplug, which means that it handles the /dev directory and all user space actions when adding/removing devices, including firmware load.-History:udev was new in Linux...

     – lower level on which HAL builds, and replacement for HAL, on GNU/Linux systems

External links

  • Official HAL web page
  • HAL at Arch Linux
    Arch Linux
    Arch Linux is an independently developed, Linux-based operating system for i686 and x86-64 computers. It is composed predominantly of free and open source software, and supports community involvement....

    wiki
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK