Intro to Computer Systems

Chapter 11: Systems and Software

Operating Systems Basics

The operating system is a piece of software that interacts directly with the hardware. In its most basic form, it provides the channels of communication that allow applications to be developed without constantly having to deal with "raw" hardware. They also manage access to the system's resources so that when multiple applications are running, each one gets its fair share, and the system can still run smoothly and stably.

In addition to basic hardware interfacing and management tasks, operating systems usually also provide additional support services to make certain high-level tasks easier. Such services are usually referred to as Application Programming Interfaces (API).

Operating System Structure

Operating systems are usually designed to have a layered approach to the way in which they run:

An operating system is designed with a layered approach, each offering a higher level of abstraction from the hardware.
An operating system is designed with a layered approach, each offering a higher level of abstraction from the hardware.

The kernel is the "core" of the operating system. This is what provides the rest of the operating system with raw access to the computer's hardware primitives, and performs the scheduling tasks so that these resources are fairly shared between tasks. As it is so critical, great attention is paid to ensure that the kernel software is reliable.

Device drivers are special pieces of software which allow the rest of the operating system to interface with specific pieces of computer hardware in an easy-to-use manner. For example, graphics cards, printers, network adapters, and so on -- each of these require a device driver to "hook into" the rest of the system.

The device drivers are often given the same privileges as the kernel when it comes to accessing computer hardware: this means that the computer's stability is also highly dependent on the device drivers being well-written and bug free.

Most computer crashes these days are the result of poorly written device drivers.

Device drivers are usually written not by the operating system provider, but the manufacturer of the hardware the driver is meant to interface to.

The Application Programming Interface (API) is the "public" part of the operating system, as far as other applications are concerned. The kernel and device drivers facilitate access to the hardware, and the API software uses that access to provide a "higher-level" method for doing useful things.

A simplified example of how high-level calls get broken down into primitives the computer hardware can directly process is shown below. It runs (very basically!) through the processes needed to show an error dialog box on the screen.

application

calls the API:

  • draw an error dialog box with the text "Error!"
API

calculates what's required to draw the dialog box, then calls the device driver:

  • draw a big gray box (window surface)
  • draw a smaller blue box (title bar)
  • render the text "Error" in the system font and display it on screen (error message)
  • draw a box (OK button)
  • render the text "OK" in the system font and display it on screen (OK button text)
device driver

does the necessary raw calculations, and then calls the kernel:

  • can you move this set of data that I've prepared to the graphics card? It's at memory location "X", and the graphics card is at location "Y".
kernel
lots of low level basic logic only a computer (or kernel developer!) could understand

Operating Systems

Much like computer hardware, operating systems are also tailored towards the needs of a particular purpose: some tasks make vastly different demands on a computer system, and there are compromises (for example, trade-offs between speed and stability) that must be considered and taken as part of the operating system's design.

Desktop Operating Systems

The primary design factor in a desktop operating system is to let it interact quickly, easily and seamlessly with the tasks the end-user has to perform. This is a difficult task to get right, as the compromise between ease of use, stability and speed is not an easy one to balance. Desktop operating systems typically have many design features, such as:

The three primary desktop operating systems in use today are Microsoft Windows, Apple MacOS X and Linux. Our discussion of operating systems will focus on the desktop, and we'll discuss these three systems in detail in the next subtopic.

Server Operating Systems

Server operating systems are usually developed with high reliability as the primary design goal. Ease of use is not a critical factor as server computers are usually maintained by qualified computer technicians. The kind of software programs that run on server systems are also designed and built to a high degree of reliability.

Most server systems usually run either Microsoft Windows Server or a variant of UNIX.

UNIX is an operating system family which got its inception in the 1960s while research was taking place into mainframe operating systems. Through various licensing and patent disputes throughout the years, as well as separate upstart developments, the UNIX landscape has become fairly fragmented and it was common for each server manufacturer to develop a variant for its own hardware.

Such fragmentation isn't much of a concern in the server market; servers, and their operating systems and applications are rarely bought separately, but rather as an integrated, complete solution, complete with a service contract from a vendor.

Sometimes these variants even have their own sub-variants; Linux, an open-source Unix work-alike operating system, has been customised into different distributions, each with their own set of objectives (e.g. some are designed for server tasks, some for desktop, some for embedded computing, etc.)

An open-source development model refers to one that relies on open, collaborative development amongst workers, regardless of who they work for. This is in contrast to the closed-source model where the development is performed within a company, and such efforts considered a trade secret.

A vast majority of Unix-related development is now undertaken under an open-source development model.

Specialist Operating Systems

Other computing tasks (most notably embedded systems) can place peculiar, unique demands on an operating system:

Such requirements are usually critical to the core task at hand; factors such as ease-of-use or outright speed/efficiency might be of little importance.

Wikipedia maintains a list of current embedded operating systems.

Virtual Machines

In addition to native application environments (ones which connect directly with the architecture of the operating system), there is also the concept of a virtual machine environment.

A virtual machine's structure is somewhat similar to an operating system, however it relies on the host OS to provide actual interaction with hardware.
A virtual machine's structure is somewhat similar to an operating system, however it relies on the host OS to provide actual interaction with hardware.

The virtual machine has an application environment, but it in itself does not physically exist; it only exists as a concept.

Software is written to target the virtual machine's application environment. Then the virtual machine itself is implemented using the actual computer's operating system and hardware.

When an application is written for a virtual machine, it can run -- unmodified -- on any actual computing hardware that supports that VM.
When an application is written for a virtual machine, it can run -- unmodified -- on any actual piece of computing hardware that supports running that particular VM.

As long as the virtual machine implementations are made available for a number of computer platforms, any software written to run on the virtual machine can be made to run on any such actual machines without modification.

The most common and best-known such virtual machine system is Java, developed by Sun Microsystems. Microsoft's .NET application framework is also based on a virtual machine type structure.