Red Hot Cyber

Cybersecurity is about sharing. Recognize the risk, combat it, share your experiences, and encourage others to do better than you.
Search

The History of the Unix Operating System (Part 2)

Tara Lie : 31 January 2023 23:27

Author: Carlo Denza
Original Publication Date: 07/10/2021
Translator: Tara Lie

Star Trek IV – The Voyage Home, directed by Leonard Nimoy (USA, 1986, Paramount Pictures): “The starship ‘U.S.S. Enterprise NCC-1701’ and its crew, led by Admiral James Tiberius Kirk, tasked with the exploration of new worlds and researching new civilisations, is forced to embark on a risky journey back in time. The objective: return to Earth, to 20th-century California, to solve complex energy and environmental issues. The mission entrusted to the crew by Starfllet is to recover and transport two of the last whale specimens to the 23rd century, to try to save their world from a climate catastrophe.   

Having landed on Earth, the Officer and Chief Engineer of the spaceship, Montgomery Scott, struggles with a Macintosh Plus. Scotty tries to give voice commands to the Mac, but nothing happens. He has to resign himself to the uncomfortable and impractical use of the keyboard – the main input method of the time period he finds himself in. The scene plays out as follows:

Vuoi diventare un Ethical Hacker?
Non perdere i nostri corsi e scrivi subito su WhatsApp al numero
375 593 1011  per richiedere informazioni dicendo che hai trovato il numero sulle pagine di Red Hot Cyber

Supporta RHC attraverso:


Ti piacciono gli articoli di Red Hot Cyber? Non aspettare oltre, iscriviti alla newsletter settimanale per non perdere nessun articolo.

Scotty: Computer? Computer?

Computer: *stays silent*

At this point, the medical officer of the Starship Enterprise, McCoy, hands Scotty the mouse. Scotty, believing that he can use it as a microphone for vocal commands, grabs it and says “Hello Computer”.

But nothing happens! The Mac stays cold in its silence until a third character suggests that he should just use the keyboard. At this point, Scotty whispers: “Keyboard?  How quaint!”. 

You have probably already guessed the Unix reference here. The famous operating system of the bitten apple, even that, also conforms to the POSIX standard. By virtue of this, it too has its roots in BSD (Berkeley Software Distribution). Therefore, Mac OS is based on Unix.

There it is – one of the reasons that Mac OS is so popular – has been clarified! 

Summary 

For those who have not read the previous article, here is a brief summary. Unix was created in 1969 by Bell Labs, its creators being K. L. Thompson and D. M. Ritchie. In 1974 the first version was installed at the University of California, Berkeley. Rewritten entirely in C language, Unix’s principle characteristics are: it is general purpose, interactive, multi-user, multi-program and time-sharing.

The advantages for the user are the power and flexibility of a full screen editor and an email system. The Unix virtual machine divides into:

  1. A Shell: Command language interpreter, system programs, editors, compilers and more. Operating system software resources.
  2. The Kernel: the nucleus of the OS. Coordinates the execution of all programs and manages access to all system resources.

Accessing a UNIX system

Access to a UNIX system is done using a program called “login”. The program identifies users by asking them for their username and password. If the authentication is successful, the system runs a shell, as shown in the next figure. 

In the modern UNIX systems (after the mid-1980s), with the introduction of graphical interfaces and windows, accessing the system could also be done through a program called “display manager”. Once again, it requires a username and password. 

If the authentication is successful, the system usually runs a series of programs with a graphical interface called ‘desktop environment’. This then allows the user to run the desired programs, as in the next image.

Modern versions of UNIX provide several alternatives to the  Desktop Environment. Some of the most popular Desktop Environments are: GNOME, KDE, XFCE, UNITY, LXDE

Each UNIX system user belongs to one or more Groups. Every user has a unique login Group, and can be a member of multiple additional Groups. On some systems, membership in certain Groups determines the ability to use some system functionality. 

  • Audio –to use the sound card
  • Video – to use the webcam
  • Dial Out – to use the modem and serial ports
  • DIP – (Dual Inline Package) to use Internet connections via modem

The UNIX file system

The most important structure of a computer system is its data, that is, the information stored and manipulated by programs. The UNIX file system is tasked to collect all the data present on the computer – whether in the form of programs, documents, databases or text files. 

For the most part, the file system runs automatically, although at times it requires maintenance. Although the word ‘file’ usually means an archive or a binder, for PC users it takes on a more specific meaning. In fact, the term ‘file’ is used to refer to a collection of data stored on the PC disk. It could be a program, a spreadsheet, an image, or anything else. 

Each file also has a name by which it is possible to refer to it with. The crucial point is that in a UNIX or UNIX-like system, the definition of ‘file’ takes on a wide range of meanings. Under the UNIX lens, we may also mean any source from which it is possible to read data, or a destination in which data can be written. 

Therefore we refer to not only a data store with ‘file’, like a file on disk, but to any physical device. That’s right, in a UNIX environment even the keyboard (input device), the monitor (output device), and a printer (another output device) are seen as files! This feature gives UNIX and UNIX-like systems a certain flexibility when compared to other OS’s.

Specifically, any program that performs read and write operations using standard input/output can use any input source and any output destination. To summarise:

  1. A file system is a system of organising files for storage on storage devices (hard disks, floppy disks, pen-drives, cd-rom, etc…);
  2. The UNIX file system has a hierarchical tree organisation, at the root of which is a particular directory called ‘root’ and is defined by the character ‘/’; 
  3. A directory is a container of files and other directories.

UNIX contains many files that are organised into directories and subdirectories. The file system originates in a single directory called the ‘root directory’, which is the parent of all the others. 

The root is the basis of the UNIX system and owes its importance to the fact that it contains within it, among other directories, a very important file; the program that constitutes the heart of UNIX – the Kernel. 

In BSD systems this file takes the name “Vmunix”, a term that stands for ‘Virtual Memory Unix’, in reference to the technique of using disk space to simulate large amounts of memory.

The points in the image below read:

  • Some subdirectories of the root are common to all UNIX systems
  • For Linux systems, the names of the directories and their functions are established by the “Filesystem Hierarchy Standard” FHS

Looking at the image above, we should remember that:

  1. The names of files and directories can be made up of any sequence of characters except ‘/’ and the null character.
  2. Each directory contains two special ‘.’s, that correspond to the same directory, and ‘..’ that corresponds to the parent directory. (NB. the parent directory of / (root) is / itself). 
  3. Some subdirectories of root are the same across all UNIX systems.
  4. The names of the directories and their functions in Linux systems are established by the FHS.

Directory Descriptions

Here are some terms used in the UNIX world and beyond:

  1. bin : essential programs used by all users
  2. boot : necessary files for system startup such as the kernel and the dev drivers (special files associated with hardware devices)
  3. etc : configuration files
  4. home : user directory
  5. sbin : essential programs for the administration of the tmp system (temporary files)
  6. var : files that the system writes during execution (log, spool, cache, …Pathname)

The tree structure uniquely identifies an item in the file system by the path from a directory to the file itself. This path is called ‘pathname’. In the pathname, all the directories on the path are separated by the character ‘/’ and the pathname can be either relative or absolute. 

I end this short article by thanking anyone who has managed to read these few pages to the end. And to keep the Star Trek plot accurate – the crew actually decided to return to Earth, not on the USS Enterprise, but with a Sparrowhawk captured by the Klingons in the previous film. My version was more functional for the article…

Tara Lie
Cyber Security analyst from Perth, Western Australia, focused on governance, risk quantification and compliance. Graduate of cyber security and pure mathematics, with a second-major in Italian Studies. Tara has earned a Master's degree in Cyber Security, and has a great passion for quantum-preparedness.