Operating Systems

Operating Systems#

It is hard to precisely define what exactly an operating system is. Here it suffices to to define an operating system as a software which manages the (hardware) resources of a computer system and is capable of running applications and programs for users.

Note

Strictly speaking this definition just includes the operating system kernel, which is a software encapsulating the hardware and resources of a computer to provide an interface for applications. But usually software vital to operate a computer is also counted as part of an operating system.

Popular examples of operating systems are Android, Windows, macOS and Linux. However there are many many more operating systems. An historical eminent example is the UNIX operating system. Dating back to 1969 is a common ancestor of many others. Various editions, versions and implementations gave rise to the computing landscape of today. An important release is the UNIX System V (five) release from 1979 which motivated first open source re-implementations and the GNU project. This project started to implement all system software under a free license. Later on in 1991 Linus Torvalds created the open source Linux kernel.

In this sense the Linux is an open source clone of UNIX, or an open source implementation of the UNIX standard. Sometimes Linux it is referred to as GNU/Linux.

The Linux kernel#

The Linux kernel is now maintained by the Linux Kernel Organization and is the largest software development project in the world. It is mainly written in the C programming language and over thousand lines of code change every day. The development process is organized via mailing list and heavy use of the git version control system which was developed by Linus Torvalds for exactly that purpose. A hierarchy of kernel maintainers organize the code and decide which changes to the codebase are applied and published. The current kernel and everything about its development can be found on kernel.org.

The Linux kernel has version numbering scheme. For example 5.14.6 is the 6th stable release in the 5.14 kernel. Every few months a new version, i.e. 5.15 is released resulting in subsequent stable releases 5.15.1, 5.15.2 and so on. Some kernels are chosen to be on long term support (LTS) kernels which are guaranteed to receive important updates for usually two years. It is completely legitimate to run an LTS kernel, for example 4.9.282. All in all many different versions of the Linux kernel are considered current and a wide variety is deployed in running systems.

Note

It is even more complicated as many distribution do not run the plain vanilla kernels from kernel.org, but apply a set of custom extensions and patches. The distributions have to maintain these patches and reapply them for every new stable release. A distribution release number might look like 5.13.13-200.fc34.x86_64 or 5.4.0-80-generic. The running kernel release version can be displayed by uname -r.

Multi-user systems#

Following UNIX ideals, Linux is designed to be a multi-user system. Everything is set up in way that multiple users can use the system, even at the same time. Obviously user accounting and permissions are an important topic. Nevertheless Linux has a very simple way of organizing its users.

Users#

First of all users are identified by unique numerical ID, also called uid and they have also (unique) username, say john. On every system there exist a user called root with uid=0. This user account has special privileges and is used by system administrators.

There is some more data associated to each user, for example the login shell, the home directory or a primary group, see below.

Groups#

Moreover user can be member of groups. A group is also identified by a unique numerical ID (gid) and has also a name. Traditionally, for every user there exist a dedicated group (with the same name), with that particular user as the only member. So for example there is a group called john with only john as user. This is often used as the user’s primary group.

Groups are just lists of users (or uids) and every user can be member of multiple groups. However groups cannot be nested.

Note

All (local) users can be viewed by inspecting the file /etc/passwd and all (local) groups are defined in /etc/groups. Information about a particular group or user is best retrieved by running gentenv passwd username or id username and getenv group groupname.