OPERATING SYSTEMS – 1969 - UNIX stems from a research project of the AT&T – 1976 - UNIX is distributed for free mainly used by Universities – to teach Operating Systems courses A brief history – for Research projects of UNIX – by the end of the 70s AT&T founds a support group to bring UNIX to the market – System III and System V were released – They have been the starting point for a large number of UNIX distributions for servers and workstations

Giorgio Giacinto 2019 Operating Sytems 2 – 1987 - Prof. Tanenbaum (University of Vrije, Amsterdam) developed the OS to teach Operating Systems (http://www.minix3.org) – MINIX is a lightweight version of UNIX that can be executed on PC- MINIX IBM computers (8088 processors). – The source code of MINIX was publicly available, but its modification was subject to the approval by Prof. Tanenbaum

Giorgio Giacinto 2019 Operating Sytems 3 – 1991 - Linus Torvalds (CS student, University of Helsinki) started developing an open-source and free OS based on MINIX – The first kernel was monolithic and tailored to the 80386 processor – Torvalds joined the GNU (GNU’s Not Unix) movement of Richard Stallman to allow other people around the world to develop applications for the OS – The is still released with a GPL (General Public License) license

Giorgio Giacinto 2019 Operating Sytems 4 – Linux kernel – a community of developer is in charge of updating, upgrading, bug- fixing – Linux System – additional components developed either by the community or Linux included from other projects – Linux Distribution – contains the kernel, and specific utilities, administrative and application programs, as well as a personalized GUI tailored to a specific category of users

Giorgio Giacinto 2019 Operating Sytems 5 FreeBSD 11.0 BSD NetBSD 7.0 Family OpenBSD 6.0 BSD (Berkeley Software Distribution) 4.4 SunOS 4.1.4 NextStep 3.3 OS X (now macOS) 10.12

UNIX family Xenix OS timeline GNU complete timeline at Linux 4.7 http://www.levenez.com/unix Research Unix (Bell Labs) 10.5

Commercial Unix (AT&T) UnixWare (Univel/SCO) Solaris (Sun/Oracle) 11.3 System V HP-UX 11iv3 Family AIX (IBM) 7.2

1970 1980 1990 2000 2010 2016

Giorgio Giacinto 2019 Operating Sytems 6 Figure 2.17 Unix Family Tree – The standard UNIX/Linux interface is text-based – called shell – the command interpreter – GUIs (Graphical User Interfaces) used for applications – X Window (originally developed at MIT) is the standard UNIX graphical interface

Giorgio Giacinto 2019 Operating Sytems 7 – The shell provides the interface between the user and the OS – waits for the user to type a command – interprets the command – executes the command – returns the results to the user Shell – Different UNIX/Linux distributions offers different shells – Differences in the syntax of commands – Differences in the behaviour of the commands – sh, ksh, csh, bash, are a few examples of shells – bash is compliant with the POSIX standard (Portable Interface for UNIX)

Giorgio Giacinto 2019 Operating Sytems 8 – When a shell is called – it is initialized – then a prompt character is displayed (typically # or $ or %) – followed by a flashing underscore or rectangle waiting for the user to type a command How the shell – When the user types a command and hots “return” works – the shell parses the input string to extract the tokens – the first name is interpreted as the name of a command or the name of a program and start the execution – the shell then waits until the termination of the command/program – after the command/program termination, the shell displays the prompt and the flashing character

Giorgio Giacinto 2019 Operating Sytems 9 – The command may be followed by other strings – options for the customisation of the output or the behaviour of the command – input data – Example Command the ls command lists the content of a directory – ls arguments displays the list of file names in the current directory – ls displays the list of file names in the directory specified by the argument directory-name – ls –l displays the list of files in the directory specified by the argument directory-name and for each file all the attributes are displayed

Giorgio Giacinto 2019 Operating Sytems 10 – All supported commands with their syntax are included in a manual that can be accessed by the command man – Example man cp Help shows the syntax and the available option for the cp command, that copies the content of a source file into a destination file – The manual follows a standard format – To close the manual, hit the ‘q’ key on the keyboard

Giorgio Giacinto 2019 Operating Sytems 11 – Any command and user program, including the shell, have access to three input and output channels by default – stdin - standard Input (read) Standard – stdout - standard output (write) Input and – stdin - standard error (error messages) – these channels are managed in the same way as files in UNIX Standard – the three standard input and output channel are usually Output associated to the physical terminal: – standard input → keyboard – standard output → monitor – standard error → monitor

Giorgio Giacinto 2019 Operating Sytems 12 – the characters < and > can be used to redirect the input or the output of a command from/to a different file – < in Input and the command reads the input from the file in – > out ouput the command writes the output to the file out redirection – 2> error all error messages are written to the file error – &> all_output all outputs (including the errors) are written to the file all_output

Giorgio Giacinto 2019 Operating Sytems 13 – Example sort < in.txt > out.txt the sort command reads the input data from the file in.txt Input and and writes the output to the file out.txt ouput – ls -l abcd > out.txt 2> err.txt writes the output to the file out.txt and errors to the file redirection err.txt – ls -l &> all_out.txt all outputs are written to the file all_out.txt

Giorgio Giacinto 2019 Operating Sytems 14 – File management cp, ls, df, mkdir, rm, , mkfs,… – Text filtering and searching sort, grep, more,… – Compilers and developer tools Other gcc, g++, make,… commands – Text processing nano, , emacs,… – System administration uname, useradd, userdel, newgrp,…

Giorgio Giacinto 2019 Operating Sytems 15 to switch off shutdown -h now the computer

Giorgio Giacinto 2019 Operating Sytems 16