Raspberry Alpha Omega

Raspberry Pi from start to finish

What is an "operating system"?

Jan 1, 2013 - 4 minute read -

Since deciding to have a go at producing my own operating system for the Raspberry Pi, one thing has been going round and round in my head. What exactly is an "operating system"?

According to the introduction to the Baking Pi tutorials from the University of Cambridge:

An operating system is just a very complicated program. It has the job of organising other programs on a computer, including sharing the computer's time, memory, hardware and other resources.

Although the tutorial themselves, somewhat hyperbolically, refer to every little program which flashes a LED or writes to the screen as an "operating system".

Wikipedia has a page of course:

An operating system (OS) is a collection of software that manages computer hardware resources and provides common services for computer programs. The operating system is a vital component of the system software in a computer system. Application programs usually require an operating system to function.

Webopedia has an old-fashioned-looking line diagram, and the following description:

The operating system is the most important program that runs on a computer. Every general-purpose computer must have an operating system to run other programs. Operating systems perform basic tasks, such as recognizing input from the keyboard, sending output to the display screen, keeping track of files and directories on the disk, and controlling peripheral devices such as disk drives and printers.

Computer Hope has a more commercial view:

An operating system or OS is a software program that enables the computer hardware to communicate and operate with the computer software. Without a computer operating system, a computer and software programs would be useless. In the picture to the right, is an example of Microsoft Windows XP, a popular operating system and what the box may look like if you were to visit a local retail store to purchase it.

All of the above are interesting, but don;t really have much to say about what I am aiming to do. I have in mind to build an absolute minimum operating system, so I really need some way to decide the scope of the project.

How Stuff Works seems to be heading in the right direction with:

Not all computers have operating systems. The computer that controls the microwave oven in your kitchen, for example, doesn't need an operating system. It has one set of tasks to perform, very straightforward input to expect (a numbered keypad and a few pre-set buttons) and simple, never-changing hardware to control. For a computer like this, an operating system would be unnecessary baggage, driving up the development and manufacturing costs significantly and adding complexity where none is required. Instead, the computer in a microwave oven simply runs a single hard-wired program all the time. For other devices, an operating system creates the ability to:

  • serve a variety of purposes
  • interact with users in more complicated ways
  • keep up with needs that change over time

But the closest definition I have found so far is from Google's dictionary:

The software that supports a computer's basic functions, such as scheduling tasks, executing applications, and controlling peripherals

With all this in mind, I propose the following broad features for the CORN operating system:

  • A way of loading and running user programs, initially just programs in the ELIUS language, but maybe others later.
  • A process model to allow multiple programs to be loaded at once.
  • Some form of process switching and scheduling to allow programs to appear to run "at the same time".
  • A simple programmatic interface to the hardware devices, which manages access by multiple programs

Modified by the following constraints:

  • I'm not sure yet about exactly which hardware devices should or might be supported, so the plan is to make the hardware/device layer as "pluggable" as possible.
  • As discussed previously, I also want the operating system to be as testable as possible, so all hardware dependent code should not be "hard coded", but it should be possible to "swap out" any or all devices for test stubs.
  • And, somehow, I want the system to be "communication oriented", whatever that may mean.