In a computer architecture, a computer system is usually represented as consisting of several abstraction levels such as:
Programmable logic is often considered part of the hardware, while the logical definitions are also sometimes seen as part of a device's software or firmware. Firmware may include only low-level software, but can also include all software, including an operating system and applications. The software layers can be further divided into hardware abstraction layers, physical and logical device drivers, repositories such as filesystems, operating system kernels, middleware, applications, and others. A distinction can also be made from low-level programming languages like VHDL, machine language, assembly language to a compiled language, interpreter, and script language.4
In the Unix operating system, most types of input and output operations are considered to be streams of bytes read from a device or written to a device. This stream of bytes model is used for file I/O, socket I/O, and terminal I/O in order to provide device independence. In order to read and write to a device at the application level, the program calls a function to open the device, which may be a real device such as a terminal or a virtual device such as a network port or a file in a file system. The device's physical characteristics are mediated by the operating system which in turn presents an abstract interface that allows the programmer to read and write bytes from/to the device. The operating system then performs the actual transformation needed to read and write the stream of bytes to the device.
Most graphics libraries such as OpenGL provide an abstract graphical device model as an interface. The library is responsible for translating the commands provided by the programmer into the specific device commands needed to draw the graphical elements and objects. The specific device commands for a plotter are different from the device commands for a CRT monitor, but the graphics library hides the implementation and device-dependent details by providing an abstract interface which provides a set of primitives that are generally useful for drawing graphical objects.
Hohpe, Gregor (March 9, 2012). Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions (Addison-Wesley Signature Series (Fowler)). Addison-Wesley Professional. ISBN 978-0321200686. 978-0321200686 ↩
Spinellis, Diomidis (2007). "Chapter 17. Another Level of Indirection". Beautiful Code: Leading Programmers Explain How They Think. Sebastopol, CA: O'Reilly and Associates. pp. 279–291. Archived from the original on Mar 6, 2024. http://www.dmst.aueb.gr/dds/pubs/inbook/beautiful_code/html/Spi07g.html ↩
Henney, Kevlin [@kevlinhenney] (September 3, 2012). "@drunkcod Yes, that's my corollary :^)" (Tweet). Archived from the original on Mar 29, 2022 – via Twitter. https://x.com/kevlinhenney/status/242616192949432320 ↩
Tanenbaum, Andrew S. (1979). Structured Computer Organization. Englewood Cliffs, New Jersey: Prentice-Hall. ISBN 0-13-148521-0. 0-13-148521-0 ↩