Hardware abstraction layer

From Free net encyclopedia

A hardware abstraction layer (HAL) is a software abstraction layer between the physical hardware of a computer and the software that runs on that computer. Its function is to hide differences in hardware from most of the operating system kernel, so that most of the kernel-mode code does not need to be changed to run on systems with different hardware. A HAL allows instructions from higher level computer languages to communicate with lower level components, such as directly with hardware.

The Windows NT-based operating systems have a HAL. This allows portability of the Windows NT kernel-mode code to a variety of processors, with different memory management unit architectures, and a variety of systems with different I/O bus architectures; most of that code runs without change on those systems, when compiled for the instruction set for those systems. For example, the SGI Intel x86-based workstations were not IBM PC compatible workstations, but thanks to the HAL, Windows NT was able to run on them.

BSD, Mac OS X, Linux, Solaris, and some other portable operating systems also have a HAL, even if it's not explicitly designated as one.

An "extreme" example of a HAL can be found in the System/38 and AS/400 architecture. Most compilers for those systems generate an abstract machine code for a virtual machine; the Licensed Internal Code, or LIC, for those systems translates this virtual machine code into native code for the processor on which it's running and executes the resulting native code. (The exceptions are compilers that generate the LIC itself; those compilers are not available outside IBM.) This was so successful that operating system software above the LIC layer, and application software, compiled on the original S/38 runs without modifications, and without recompilation, on the latest AS/400 systems, even though the underlying hardware having been changed dramatically; at least 3 different types of processors have been in use.

Hardware abstraction layers are of an even lower level in computer languages than application programming interfaces (API) because they interact directly with hardware instead of a system kernel, therefore HALs require less processing time than APIs. Higher level languages often use HALs and APIs to communicate with lower level components.

Operating systems having a defined HAL are easily portable across different hardware. This is especially important for embedded systems that run on dozens of different microcontrollers.

External links

de:Hardware-Abstraktions-Schicht

es:Capa de abstracción de hardware fr:Hardware abstraction layer ko:하드웨어 추상화 계층 it:Hardware abstraction layer pt:Camada de abstracção de hardware