Docsity

unix lecture notes computer, Lecture notes of Computer science

Toggle sidebar
bg1
BCatkan 1 / 34
kernel
kernel
system calls
system calls
shell
shell
library routines
library routines
applications
applications
The OS itself that provides functionality
such as :
●Process Management
●Memory Management
●Scheduling
●Hardware management ...etc.
Programming interface to
communicate with the kernel to
request services.
Set of modules that provide
common functions that are
built on system calls.
Command Interpreter to run
other programs to accomplish
user tasks and/or system
administration tasks.
Application programs that make computers useful :
●Web-browsers,
●Word-processors,
●Spreadsheets,
●Utilities,
●Daemons, ...etc
Ref. : Advanced Programming in the UNIX Environment, 2/e
ISBN-13 : 978-0-321-52594-9
Architecture
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22

Partial preview of the text

Download unix lecture notes computer and more Lecture notes Computer science in PDF only on Docsity!

kernelkernel system callssystem calls shellshell library routineslibrary routines applicationsapplications The OS itself that provides functionality such as : ● (^) Process Management ● (^) Memory Management ● (^) Scheduling ● (^) Hardware management ...etc. Programming interface to communicate with the kernel to request services. Set of modules that provide common functions that are built on system calls. Command Interpreter to run other programs to accomplish user tasks and/or system administration tasks. Application programs that make computers useful : ● (^) Web-browsers, ● (^) Word-processors, ● (^) Spreadsheets, ● (^) Utilities, ● (^) Daemons, ...etc Ref. : Advanced Programming in the UNIX Environment, 2/e ISBN-13 : 978-0-321-52594-

Architecture

Applications can be written ● (^) to make system calls directly, or ● (^) to make use of shell scripts, or ● (^) to make use of library routines. Library routines are supplied ● (^) with programming languages, or ● (^) with application packages, or ● (^) system utilities. Shell is a Command Interpreter that provides a CLI , Command Line Interface. There are various shells available for different tastes : ● (^) sh, Bourne Shell, originally written by Stephen Bourne, re-implementations exist and used as the default shell on Unix systems. ● (^) bash, Bourne Again Shell, is a re-write from Bourne shell. bash is the default shell used on Linux systems. ● (^) ksh, Korn Shell, originally written by David Korn, csh, C Shell, written by Bill Joy, tcsh, TENEX C Shell, written by Ken Greer, are other shells that you can install and use. A Shell Script is an executable text file. It contains an ordered sequence of commands. You can just as well use these commands one-by-one interactively. System start-up, shutdown, and administration tasks are accomplished using shell scripts.

Notes on Architecture

✔ (^) Cloud Computing ✔ (^) Distributed Computing ✔ (^) Virtualization ✔ (^) HPC ✔ (^) IoT ✔ (^) BigData, AI ✔ (^) Application Services ● (^) Web ● (^) E-mail ● (^) Database ➔ (^) Structured ➔ (^) Unstructured ● (^) Productivity

F/L OSS shapes the IT Landscape

✔ (^) Applications ● (^) CRM ● (^) SCM ● (^) ERP ● (^) etc ✔ (^) Multimedia ● (^) Playback ● (^) Editing ● (^) Streaming ✔ (^) Software Development ● (^) Programming Languages ● (^) DevOPS ✔ (^) Desktop ✔ (^) Security/Forensics ✔ (^) Network Services

Free Software licensing recognizes that you have four essential kinds of freedom : ● (^) Freedom 0 : The freedom to run the program for any purpose such as personal, professional, educational, and commercial. ● (^) Freedom 1 : The freedom to study and modify, if needed. ● (^) Freedom 2 : The freedom to redistribute copies (as-is). ● (^) Freedom 3 : The freedom to distribute copies of your modifications along with the original. Note that being open source is not an explicitly stated freedom. It's a prerequisite condition to enjoy Freedom 1 and Freedom 3. Note that Free Software is different from Open Source Software, although the two terms are used interchangeably. We will use the term F/LOSS ( Free/Libre Open Source Software ) to mean both.

Free Software

● (^) All four kinds of freedom must be recognized without exception. ● (^) Availability of source code is a pre-condition. ● (^) Long list of licenses that comply with definition of Free Software. ✔ (^) GNU/GPL, copyleft! ✔ (^) BSD, modified BSD, FreeBSD, non-copyleft. ✔ (^) MIT, Apache v2, MPL, … etc. ● (^) Similar licensing considerations for fonts, and documentation. Read

  1. http://www.gnu.org/licenses/license-list.html
  2. http://www.gnu.org/copyleft/copyleft.html
  3. http://www.gnu.org/licenses/gpl-faq/#WhatIsCompatible
  4. http://www.gnu.org/licenses/gpl-faq/#WhatDoesCompatMean
  5. http://www.gnu.org/philosophy/categories.html

Free Software Licenses

✔ (^) Router ✔ (^) Firewall ✔ (^) Gateway WAN ✔ (^) smtp service ✔ (^) http service ✔ (^) Load Balancing ✔ (^) Infrastructure services : ✔ (^) DHCP ✔ (^) DNS ✔ (^) NTP ✔ (^) SNMP ✔ (^) LDAP ✔ (^) Network storage ✔ (^) Database ✔ (^) Printing Desktop applications ✔ (^) Wordprocessor ✔ (^) Spreadsheet ✔ (^) Presentation ✔ (^) Web-browser ✔ (^) E-mail/Chat client ✔ (^) Audio/Video Editing Advantages ✔ (^) Cost-effective : ✔ (^) Savings on HW/SW cost ✔ (^) Modest HW requirements ✔ (^) HW re-purpose ✔ (^) Low maintenance overhead ✔ (^) Diskless-Client Support ✔ (^) Thin-Client Support ✔ (^) Scalability ✔ (^) Reliability ✔ (^) Availability ✔ (^) Security ✔ (^) Performance ✔ (^) Cloud ✔ (^) Implementation ✔ (^) Operations ✔ (^) Orchestration ✔ (^) Embedded applications ✔ (^) IoT ✔ (^) BigData and AI

Where does UNIX/Linux (and F/L OSS) fit best?

Everywhere!

✔ (^) MultiMedia Streaming ✔ (^) Clustering ✔ (^) HPC (High Performance Computing) ✔ (^) Scientific Research See https://www.scientificlinux.org/ , https://linux.web.cern.ch/rhel/ , and https://linux.web.cern.ch/centos/ for more

Unix/Linux (F/L OSS) Advantages

Visit https://www.turnkeylinux.org/ to see the wide range of virtual machine images made available for quick deployment in any enterprise, small or big. That’s only possible because it’s all F/L OSS and the software license encourages it! Read https://www.turnkeylinux.org/faq for more.

Thin clients and diskless clients

Application Server ✔ (^) Wordprocessor ✔ (^) Spreadsheet ✔ (^) Presentation ✔ (^) Web-browser ✔ (^) E-mail/Chat client ✔ (^) ... ✔ (^) Unix/Linux systems do not have to be installed on local harddisk. ✔ (^) Boot process is about delivering a bootable OS image to the target machine. You may deliver the image on removable media such as a USB stick, optical storage, or across the network. ✔ (^) Booting from optical storage such as CD/DVD is the preferred method in forensic analysis because the image is read-only. ✔ (^) Thin clients and diskless clients boot across the network. ✔ (^) Thin clients have little permanent storage to store some software locally. ✔ (^) Diskless clients do not have any permanent storage option. They get the entire image across the network and use applications that are installed remotely and store data remotely. Thin client with local installation of X server, GUI Diskless client with no local storage Network Boot Server (PXE - Preboot eXecution Environment (Intel only)) ✔ (^) DHCP ✔ (^) DNS (optional) ✔ (^) Bootloader (pxeboot) ✔ (^) TFTP to deliver bootloader ✔ (^) OS image to be delivered. ✔ (^) A protocol to deliver the OS image. ✔ (^) NFS Boot Sequence

  1. NIC locates DHCP server.
  2. DHCP server delivers IP address of the bootloader.
  3. Client retrieves bootloader via TFTP.
  4. Bootloader may offer choice of which OS image to boot into.
  5. Boot server delivers an OS image.
  6. Client mounts network storage to work with.

Unix/Linux (F/L OSS) HPC/Supercomputing, and Clusters

HPC/Supercomputing ✔ (^) Evolved from vector processing into massively parallel processing systems with tens of thousands of tightly coupled processors. ✔ (^) Used in areas which require processing huge amounts of data in parallel in throughput intensive tasks such as scientific research, genetics, astrophysics, weather forecasting, ...etc. ✔ (^) GPGPU : Incorporating GPUs to implement HPC. Read the Wikipedia article at https://en.wikipedia.org/wiki/Gpgpu to start with. ✔ (^) 100% dominance in HPC/Supercomputing. A nice read about supercomputing, what it is, how it came about, ... etc. at https://www.linuxjournal.com/content/linux-and-supercomputers Clusters ✔ (^) Designed to provide low-cost distributed processing using COST, Commercial-Off-The-Shelf, systems. ✔ (^) Either loosely or tightly connected computers. ✔ (^) Each individual computer is called a node. ✔ (^) Nodes are connected to each other through a high-speed LAN. ✔ (^) Each node runs its own OS instance. ✔ (^) Read Linux Clusters Overview at https://computing.llnl.gov/tutorials/linux_clusters/ with brief historical background at Lawrence Livermore National Laboratory. ✔ (^) Visit https://www.llnl.gov/ to have an idea of the scope of LLNL and how serious F/L OSS really is.

Virtualization

✔ (^) Invented by IBM ● (^) First commercial product (entire OS) VM in 1972 ● (^) Many versions,VM/370, VM-HPO, VM/SP, VM-XA, VM/ESA... in parallel to developments in hardware. ● (^) Rebranded as z/VM about two decades ago. ✔ (^) Architecture : ● (^) CP : Control Program. ● (^) Guests ➔ (^) CMS (Native) : C onversational Monitor System. A certain (configurable) amount of resources are allocated to each user. It’s as if each user were given a small PC on an IBM mainframe. Remember, PCs were invented by IBM, too. Single-user, multi-tasking. ➔ (^) Other OS (z/VM, z/OS (formerly MVS), Linux) : Each OS is a stand- alone multi-user multi-tasking OS. ➔ (^) Service guests ● (^) RACF : Remote Access Control Facility. ● (^) RSCS : Remote Spooling and Communication Subsystem. ● (^) SFS : Shared File System.

Virtualization

✔ (^) jails in FreeBSD ✔ (^) zones in Solaris and illumos ✔ (^) Containers in Linux ● (^) LXC ● (^) Docker, et al. ● (^) paved the way to PaaS ➔ (^) run other OS ✔ (^) bhyve in FreeBSD and illumos ✔ (^) kvm in Linux ✔ (^) Xen in Linux and FreeBSD ✔ (^) VirtualBox (Type 2) Proprietary ● (^) Parallels ● (^) Hyper-V ● (^) VMware Products ● (^) ESXi (Type 1), ● (^) Workstation Pro, and Player (Type 2), ● (^) Fusion (Type 2 on Mac OS)

Virtualization

LPAR : Logical Partition, partitioning hardware resources.

OS1 OS2 OS

LPAR LPAR LPAR

● (^) Partition hardware resources. ● (^) Not available on all hardware architectures. ● (^) LPAR in IBM mainframes and POWER systems. ● (^) LDOM in Sun (r.i.p.) SPARC systems. ● (^) MDF (Multi-Domain Facility) in Amdahl/Hitachi systems.

Virtualization - Docker

● (^) Applications are packaged in a docker container to make an image. ● (^) Images are stored in a repository. ● (^) An image has minimalistic software installed, just enough to run the application. ● (^) Images are launched and run by docker which can dynamically download an image from a repository if it’s not found locally. ● (^) Host provides the remaining services like networking, storage,...etc. ● (^) Container orchestration is a hot topic. Kubernetes is the most widely used orchestration platform. ● (^) Rancher is a Kubernetes management platform. ● (^) Openshift is RHEL’s Kubernetes. ● (^) Kubernetes is also referred to as k8s. ● (^) Docker has its own orchestration called swarm. ● (^) Docker is the first to adapt containers for application deployment as such, but is not the only one. ● (^) RancherOS and CoreOS are two minimalistic distros that are made to run docker. Docker container 1 (runtime) Linux Virtual network(s), ... Docker container n (runtime) docker engine Docker repository

Virtualization – hypervisor

● (^) HostOS is the OS that manages hw resources. ● (^) There can be only one actively running OS in Intel architecture (commodity) at any one time. ● (^) Another name for OS is supervisor. ● (^) Hypervisor refers to software that enables a supervisor share its resources with another OS, aka a guest OS. ● (^) The term hypervisor was coined by IBM, remember VM in 1972. ● (^) A Type 1 hypervisor runs on bare metal. It’s the HostOS itself. ● (^) A Type 2 hypervisor runs on top of a Host OS. Guest 1 VM Virtual network(s), ... Guest 2 VM Guest n VM Hypervisor Type 1 (Host OS) HW resources CPU RAM NIC Guest 1 VM Virtual network(s), ... Guest 2 VM Guest n VM Host OS HW resources CPU RAM NIC Hypervisor Type 2 (VirtualBox, Parallels, VMware Workstation)