HIGH PERFORMANCE COMPUTING: MODELS, METHODS, & MEANS OPERATING SYSTEMS 1

Similar documents
Operating Systems. High Performance Computing: Concepts, Methods, & Means

Operating System. Operating System Overview. Layers of Computer System. Operating System Objectives. Services Provided by the Operating System

Operating System Overview. Operating System

Chapter 1: Introduction

CS420: Operating Systems

To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Operating Systems Overview. Chapter 2

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter

Operating System Services

CS420: Operating Systems

Operating System Overview. Chapter 2

CS370 Operating Systems

European University of Lefke. Instructor: Dr. Arif SARI

Chapter 1: Introduction

Lecture 1 Introduction (Chapter 1 of Textbook)

CS370 Operating Systems

OPERATING SYSTEMS: Lesson 1: Introduction to Operating Systems

Chapter 1: Introduction. Chapter 1: Introduction

Chapter 1: Introduction

Operating Systems: Internals and Design Principles. Chapter 2 Operating System Overview Seventh Edition By William Stallings

7/20/2008. What Operating Systems Do Computer-System Organization

Chapter 1: Introduction. Operating System Concepts 8 th Edition,

Chapter 1: Introduction. Operating System Concepts 8th Edition,

DM510 Operating Systems. Jacob Aae Mikkelsen

Operating Systems. Lecture Course in Autumn Term 2015 University of Birmingham. Eike Ritter. September 22, 2015

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Course Details. Operating Systems with C/C++ Course Details. What is an Operating System?

Introduction to Operating Systems (Part II)

Introduction to Operating Systems

Operating System. Operating System Overview. Structure of a Computer System. Structure of a Computer System. Structure of a Computer System

Course: Operating Systems Instructor: M Umair. M Umair

Computer System Overview

ELEC 377 Operating Systems. Week 1 Class 2

Chapter 2: Operating-System Structures. Operating System Concepts 8 th Edition

Four Components of a Computer System. Operating System Concepts 7 th Edition, Jan 12, 2005

OPERATING SYSTEMS UNIT - 1

Chapter 3: Processes

Chapter 3: Process Concept

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals

Operating Systems Overview. Chapter 2

Chapter 3: Processes. Operating System Concepts 8 th Edition,

1 PROCESSES PROCESS CONCEPT The Process Process State Process Control Block 5

Processes and More. CSCI 315 Operating Systems Design Department of Computer Science

CSC Operating Systems Fall Lecture - II OS Structures. Tevfik Ko!ar. Louisiana State University. August 27 th, 2009.

Announcements. Computer System Organization. Roadmap. Major OS Components. Processes. Tevfik Ko!ar. CSC Operating Systems Fall 2009

Roadmap. Tevfik Ko!ar. CSC Operating Systems Spring Lecture - III Processes. Louisiana State University. Virtual Machines Processes

Operating Systems Overview

Chapter 3 Processes. Process Concept. Process Concept. Process Concept (Cont.) Process Concept (Cont.) Process Concept (Cont.)

Part V. Process Management. Sadeghi, Cubaleska RUB Course Operating System Security Memory Management and Protection

Introduction. CS3026 Operating Systems Lecture 01

OS Design Approaches. Roadmap. OS Design Approaches. Tevfik Koşar. Operating System Design and Implementation

Chapter 2 Operating System Overview

Chapter 3: Process Concept

Chapter 3: Process Concept

Process Description and Control

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

OS and Computer Architecture. Chapter 3: Operating-System Structures. Common System Components. Process Management

Introduction. TDDI04, K. Arvidsson, IDA, Linköpings universitet Contents. What is an Operating System (OS)?

Last class: OS and Architecture. OS and Computer Architecture

Last class: OS and Architecture. Chapter 3: Operating-System Structures. OS and Computer Architecture. Common System Components

Operating-System Structures

Announcement. Exercise #2 will be out today. Due date is next Monday

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

Operating Systems. Overview. Dr Alun Moon. Computing, Engineering and Information Sciences. 27th September 2011

Four Components of a Computer System

Operating System Architecture. CS3026 Operating Systems Lecture 03

Chapter 3: Processes. Operating System Concepts 9 th Edit9on

CHAPTER 2: PROCESS MANAGEMENT

Module 3: Operating-System Structures

Chapter 3: Processes. Operating System Concepts Essentials 2 nd Edition

CSC 453 Operating Systems

2. The system of... generally ran one job at a time. These were called single stream batch processing.

Module 1. Introduction:

Processes. CS 475, Spring 2018 Concurrent & Distributed Systems

Chapter 3: Process-Concept. Operating System Concepts 8 th Edition,

Process- Concept &Process Scheduling OPERATING SYSTEMS

Chapter 14 Operating Systems

Unit 2 : Computer and Operating System Structure

Chapter 14 Operating Systems

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018

Roadmap. Tevfik Koşar. CSE 421/521 - Operating Systems Fall Lecture - II OS Structures. University at Buffalo. OS Design and Implementation

OS Design Approaches. Roadmap. System Calls. Tevfik Koşar. Operating System Design and Implementation. CSE 421/521 - Operating Systems Fall 2013

UNIX rewritten using C (Dennis Ritchie) UNIX (v7) released (ancestor of most UNIXs).

Operating Systems : Overview

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Module 4: Processes. Process Concept Process Scheduling Operation on Processes Cooperating Processes Interprocess Communication

Chapter 3: Operating-System Structures

CHAPTER 3 - PROCESS CONCEPT

Chapter 13: I/O Systems

Chapter 3: Processes

Operating System Review

CSE 4/521 Introduction to Operating Systems. Lecture 24 I/O Systems (Overview, Application I/O Interface, Kernel I/O Subsystem) Summer 2018

CS30002: Operating Systems. Arobinda Gupta Spring 2017

Overview of Unix / Linux operating systems

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto

CS 471 Operating Systems. Yue Cheng. George Mason University Fall 2017

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

Chapter 5: Processes & Process Concept. Objectives. Process Concept Process Scheduling Operations on Processes. Communication in Client-Server Systems

Computer Fundamentals : Pradeep K. Sinha& Priti Sinha

Transcription:

Prof. Thomas Sterling Center for Computation & Technology Louisiana State University April 5 th, 2011 HIGH PERFORMANCE COMPUTING: MODELS, METHODS, & MEANS OPERATING SYSTEMS 1

This Page Left Intentionally Blank 2

Opening Remarks: Where are We?? The two ends: what we ve covered so far From the top down: User applications Parallel programming methods Algorithms for distributed computing From the bottom up: Enabling device technologies Micro architectures Parallel system architectures Performance as cross cutting theme We re now at the system center: The Operating System It owns the computer It controls the applications It facilitates your needs but limits your access It protects you from others, and they from you 3

Opening Remarks: Where are We Going Next two lectures are on OS Principles Linux components Middleware Practical System Usage (next week) Scheduling Check pointing System Administration Beyond and Beyond You need to know what you don t know Field of HPC beyond this Introduction course Future of HPC over the next decade 4

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 5

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 6

What is an Operating System? Operating System A persistent program that controls the execution of application programs An interface between applications and hardware Primary functionality Exploits the hardware resources of one or more processors Provides a set of services to system users Manages secondary memory and I/O devices Objectives Convenience: Makes the computer more convenient to use Efficiency: Allows computer system resources to be used in an efficient manner Reliability: through protection between jobs Ability to evolve: Permit effective development, testing, and introduction of new system functions without interfering with service Source: William Stallings Operating Systems: Internals and Design Principles (5 th Edition) 7

Layers of Computer System 8

Resources Managed by the OS Processor Main Memory volatile referred to as main memory or primary storage Also physical memory or core I/O modules secondary memory devices communications equipment terminals System bus communication among processors, memory, and I/O modules 9

System bus OS as Resource Manager Memory Operating System Software Computer System I/O Controller I/O Controller I/O Devices Printers, keyboards, digital camera, etc. Programs and Data I/O Controller Processor Processor Storage OS Programs Data 10

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security &Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 11

Operating System Structure Operating system can be examined in various ways : Disassembling system components & their interconnections Services provided by different components of an OS Interfaces that it makes available to users and programmers System Components Process Management Main-Memory Management File Management I/O System Management Secondary Storage Management Networking Protection & Security Systems 12

Operating System Components: Overview Process Management: Creating and deleting user and system processes, suspending and resuming processes, mechanisms for process communication, process synchronization, & deadlock handling Memory Management: managing usage of memory, loading processes into memory, allocation and de-allocation of memory File Management: Creating and deleting files, creating and deleting directories, manipulating files and directories, mapping to secondary storage etc. I/O System Management: buffering, caching, spooling, general device driver interfaces drivers for specific hardware devices Secondary Storage Management: Free space management, storage allocation, disk scheduling Networking: Communication drivers, protocols Protection & Security systems: Controlling access of programs, processes, or users to the resources defined by the computer system. 13

Operating System Services Operating system provides an environment to execute programs. Following are some of the services an Operating System provides : Program execution: ability to load a program into memory and execute the program. Program must be able to end execution normally or abnormally. I/O operations: help in input/output operations to a file or an I/O device. File System Manipulation: read, write, modify, create, delete files by name. Communication: facilitate exchange of information between processes through shared memory or message passing. Error detection and handling: Monitor for potential errors in CPU, memory hardware, I/O devices, external devices, potential errors in user programs such as access to illegal memory location etc. 14

Multiprogramming & Multitasking Multiprogramming needed for efficiency Single user cannot keep CPU and I/O devices busy at all times Multiprogramming organizes jobs (code and data) so CPU always has one to execute A subset of total jobs in system is kept in memory One job selected and run via job scheduling When it has to wait (for I/O for example), OS switches to another job Timesharing (multitasking) is logical extension in which CPU switches jobs so frequently that users can interact with each job while it is running, creating interactive computing Response time should be < 1 second Each user has at least one program executing in memory process If several jobs ready to run at the same time CPU scheduling If processes don t fit in memory, swapping moves them in and out to run Virtual memory allows execution of processes not completely in memory 15

Multiprogramming and Multiprocessing 16

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 17

Process Management A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity. Process needs resources to accomplish its task CPU, memory, I/O, files Initialization data Process is composed of program counter (points into code section) process stack (contains temporary data local variables, return addresses) code section (executable code) data section (contains global variables) Process termination requires reclaim of any reusable resources Single-threaded process has one program counter specifying location of next instruction to execute Process executes instructions sequentially, one at a time, until completion Multi-threaded process has one program counter per thread Typically system has many processes, some user, some operating system running concurrently on one or more CPUs Concurrency by multiplexing the CPUs among the processes / threads 18

Process States As a process executes it changes state between one of the following: New: A process is being created Running: Instructions are being executed Waiting: The process is waiting for some event to occur Ready: Process is waiting to be assigned to a processor Terminated: The process has finished execution 19

Process Control Block Each process in the operating system is represented as a Process Control Block which contains : Process state: current state of the process (new / ready / running / waiting / halted ) Program counter: The address of next instruction to be executed for the process CPU registers: Registers vary in number and type depending on architecture. They include accumulators, index registers, stack pointers, and general purpose registers etc CPU scheduling information: process priority, pointers to scheduling queues and other parameters Memory Management information: value of base and limit registers, page tables, segment tables etc. Accounting information: amount of CPU & real-time used, time limits, job or process numbers I/O Status: list of I/O devices allocated to the process, list of open files etc 20

Process Management Activities The operating system is responsible for the following activities in connection with process management: Creating and deleting both user and system processes Suspending and resuming processes Providing mechanisms for process synchronization Providing mechanisms for process communication Providing mechanisms for deadlock handling 21

Process Scheduling When a process enters the system, they are put into a job queue. The queue consists of all processes in the system. Processes that are residing in the main memory and are ready and waiting to execute are kept in a list called the ready queue (usually a linked list) A ready queue header contains pointers to the first and final PCBs in the list. List of processes waiting for a particular I/O device is called a device queue. (each device has its own queue) A process is initially put into the ready queue where it waits until it is selected for execution. Once a process is assigned to the CPU for execution one of the following could occur: Process could issue an I/O request and be placed in the device queue Process could create new sub-processes and wait for its termination Processes could be removed forcibly from the CPU, as a result of an interrupt and could be put back in the ready queue. 22

Process Schedulers The OS must select for scheduling purposes, processes from various scheduling queues throughout the lifetime of a process. The selection process is carried out by the appropriate scheduler. Often more processes are submitted than can be executed immediately, these processes are spooled to a mass storage device. The long-term scheduler or job-scheduler selects processes from this pool and loads them into memory for execution. The short-term scheduler selects from among the processes that are ready to execute and allocates CPU to one of them. 23

Process Scheduling In general, a process can be described as I/O bound or CPU bound. I/O bound process spends more time doing I/O than doing computations CPU bound process generates I/O requests infrequently and spends more time doing computation. Long term scheduler must schedule a good process mix of I/O bound & CPU-bound processes. Some operating systems, may introduce an additional, intermediate level of scheduling: medium-term scheduler which remove process from memory and reintroduce it into memory at some later time and its execution can be continued where it left off. This scheme is called swapping 24

Processes: Context Switch Switching the CPU to another process requires saving the state of the old process and loading the saved state of the new process, this task is called Context Switch. The context of a process is represented in the PCB of a process; it includes value of CPU registers, process state and memory management information. When a context switch occurs, the kernel saves the context of the old process in its PCB and loads the saved context of the new process scheduled to run. Context switching time is pure overhead, because the system does no useful work while switching. Context switching time is dependent on various factors including; memory speed, number of registers, existence of special instructions, type of machine. 25

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 26

Threads Threads are sometimes called lightweight processes (LWP), are a basic unit of CPU utilization It comprises a threadid, a program counter, a register set, and a stack. A process may have one or more threads of control. User threads are supported above the kernel and implemented by a thread library at the user level. The library provides support for thread creation, scheduling, and management with no support from the kernel. Therefore user threads are generally fast to create and manage Eg: C-threads, UI-threads Kernel threads are supported directly by the operating system Performs thread creation, scheduling, management in kernel space. Kernel threads are generally slower to create and manage due to management overhead of the operating system Eg: Pthreads 27

Multi-threading models Many systems provide support for both kernel and user threads resulting in multithreading models. Three common types of threading implementations are : 28

CPU Scheduling The objective of multiprogramming is to have some process running at all time, in order to maximize CPU utilization. Scheduling is a fundamental operating system function; almost all resources are scheduled before use. CPU being the primary resource; CPU scheduling has significant impact on OS design & operation CPU-I/O Burst Cycle: Process execution consists of a cycle of CPU execution and I/O wait; processes alternate between these two states Process execution begins with a CPU burst; followed by an I/O burst followed by another CPU burst and then another I/O burst and so on The last CPU burst ends with a system request to terminate execution 29

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 30

Memory Management Memory management determines what is in memory and when All needed (accessed) data in memory All needed (executed) instructions in memory in order to execute Address translation tables Optimizing CPU utilization and computer response to users Memory management activities Keeping track of which parts of memory are currently being used and by whom Deciding which processes (or parts thereof) and data to move into and out of memory Allocating and deallocating memory space as needed Virtual to physical address translation 31

Virtual Memory Virtual Memory : Allows programmers to address memory from a logical point of view No hiatus between the execution of successive processes while one process was written out to secondary store and the successor process was read in Virtual Memory & File System : Implements long-term store Information stored in named objects called files Paging : Allows process to be comprised of a number of fixed-size blocks, called pages Virtual address is a page number and an offset within the page Each page may be located any where in main memory Page translation table in memory 32

Translation Lookaside Buffer 33

Paging Diagram 34

Storage Management OS provides uniform, logical view of information storage Abstracts physical properties to logical storage unit - file Each medium is controlled by device (i.e., disk drive, tape drive) Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random) File-System management Files usually organized into directories Access control on most systems to determine who can access what OS activities include Creating and deleting files and directories Primitives to manipulate files and directories Mapping files onto secondary storage Backup files onto stable (non-volatile) storage media 35

Fairness Scheduling and Resource Management Give equal and fair access to resources Differential responsiveness Discriminate among different classes of jobs Efficiency Maximize throughput, minimize response time, and accommodate as many uses as possible 36

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 37

Protection and Security Protection any mechanism for controlling access of processes or users to resources defined by the OS Security defense of the system against internal and external attacks Huge range, including denial-of-service, worms, viruses, identity theft, theft of service Systems generally first distinguish among users, to determine who can do what User identities (user IDs, security IDs) include name and associated number, one per user User ID then associated with all files, processes of that user to determine access control Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file Privilege escalation allows user to change to effective ID with more rights 38

Kernel: OS Kernel Portion of operating system that is in main memory Contains most frequently used functions Also called the nucleus, supervisor, monitor Hardware Features: Memory protection: Do not allow the memory area containing the kernel to be altered Timer: Prevents a job from monopolizing the system Privileged instructions: Certain machine level instructions can only be executed by the kernel Interrupts: Early computer models did not have this capability Memory Protection User program executes in user mode Certain instructions may not be executed Kernel executes in system mode Kernel mode Privileged instructions are executed Protected areas of memory may be accessed 39

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 40

Modern Operating Systems Small operating system core Contains only essential core operating systems functions Many services traditionally included in the operating system are now external subsystems Device drivers File systems Virtual memory manager Windowing system Security services Microkernel architecture Assigns only a few essential functions to the kernel Address spaces/basic memory management Interprocess communication (IPC) Basic scheduling 41

Modern Operating Systems Multithreading Process is divided into threads that can run concurrently Thread Dispatchable unit of work executes sequentially and is interruptable Process is a collection of one or more threads Symmetric multiprocessing (SMP) There are multiple processors These processors share same main memory and I/O facilities All processors can perform the same functions Distributed operating systems Provides the illusion of a single main memory space and single secondary memory space Object-oriented design Used for adding modular extensions to a small kernel Enables programmers to customize an operating system without disrupting system integrity 42

Thread and SMP Management Example: Solaris Multithreaded Architecture 43

Benefits of a Microkernel Organization Uniform interface on request made by a process Don t distinguish between kernel-level and user-level services All services are provided by means of message passing Extensibility Allows the addition of new services Flexibility New features added & existing features can be subtracted Portability Changes needed to port the system affect only the microkernel itself Reliability Modular design Small microkernel can be rigorously tested Distributed system support Message are sent without knowing what the target machine is Object-oriented operating system Uses components with clearly defined interfaces (objects) 44

Monolithic OS vs. Microkernel 45

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 46

Command Interpreter System Command interpreter: is the interface between the user and the operating system Some operating systems include the command interpreter in the kernel while others such as MSDOS and UNIX treat command interpreter as a special program Commands are given to the operating system by a control statement issued by a user (eg: ls, rm, mv). These control statements are interpreted by a command interpreter often known as the shell; whose main function is to get the next command statement and execute it Some operating systems offer graphical interfaces (GUIs) to perform the same operations (Windows Interface, Gnome/KDE in Linux) 47

Demonstrate common commands used to interact with the system Linux Windows DEMO 48

Topics Introduction Operating System Structures & Services Process Management Threads Memory Management Security & Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 49

Brief History of UNIX Initially developed at Bell Labs in late 1960s by a group including Ken Thompson, Dennis Ritchie and Douglas McIlroy Originally named Unics in contrast to Multics, a novel experimental OS at the time The first deployment platform was PDP-7 in 1970 Rewritten in C in 1973 to enable portability to other machines (most notably PDP-11) an unusual strategy as most OS s were written in assembly language Version 6 (version numbers were determined by editions of system manuals), released in 1976, was the first widely available version outside Bell Labs Version 7 (1978) is the ancestor of most modern UNIX systems The most important non-at&t implementation is UNIX BSD, developed at the UC at Berkeley and to run on PDP and VAX By 1982 Bell Labs combined various UNIX variants into a single system, marketed as UNIX System III, which later evolved into System V 50

Traditional UNIX Organization Hardware is surrounded by the operating system software Operating system is called the system kernel Comes with a number of user services and interfaces Shell Components of the C compiler 51

UNIX Kernel Structure Source: Maurice J. Bach The Design of the UNIX Operating System 52

UNIX Process Management Nine process states (see the next slide) Two Running states (kernel and user) Process running in kernel mode cannot be preempted (hence no real-time processing support) Process description User-level context: basic elements of user s program, generated directly from compiled object file Register context: process status information, stored when process is not running System-level context: remaining information, contains static and dynamic part Process control New processes are created via fork() system call, in which kernel: Allocates a slot in the process table, Assigns a unique ID to the new process, Obtains a copy of the parent process image, Increment counters for files owned by the parent, Changes state of the new process to Ready to Run, Returns new process ID to the parent process, and 0 to the child 53

Description of Process States 54

Process State Transition Diagram 55

UNIX Process 56

UNIX Concurrency Mechanisms Pipes Circular buffers allowing two processes to communicate using producer-consumer model Messages Rely on msgsnd and msgrcv primitives Each process has a message queue acting as a mailbox Shared memory Fastest communication method Block of shared memory may be accessed by multiple processes Semaphores Synchronize processes access to resources Signals Inform of the occurrences of asynchronous events 57

Traditional UNIX Scheduling Multilevel feedback using round-robin within each of the priority queues One-second preemption Priority calculation given by (recomputed once per second): 58

Page Replacement Strategy SVR4 two-handed clock policy: Each swappable page has a reference bit in page table entry The bit is cleared when the page is first brought in The bit is set when the page is referenced The fronthand sets the reference bits to zero as it sweeps through the list of pages Sometime later, the backhand checks reference bits; if a bit is zero, the page is added to page-out candidate list 59

UNIX I/O I/O classes in UNIX: Buffered (data pass through system buffers) System buffer caches Managed using three lists: free list, device list and driver I/O queue Follows readers/writers model Serve block-oriented devices (disks, tapes) Character queues Serve character-oriented devices (terminals, printers, ) Use producer-consumer model Unbuffered (typically involving DMA between the I/O module and process I/O area) 60

UNIX File Types Regular Contains arbitrary data stored in zero or more data blocks Treated as stream of bytes by the system Directory Contains list of file names along with pointers to associated nodes (index nodes, or inodes) Organized in hierarchies Special Contains no data, but serves as a mapping to physical devices Each I/O device is associated with a special file Named pipe Implement inter-process communication facility in file system name space Link Provides name aliasing mechanism for files Symbolic link Data file containing the name of file it is linked to 61

Directory Structure and File Layout 62

Modern UNIX Systems System V Release 4 (SVR4) Developed jointly by AT&T and Sun Microsystems Improved, feature-rich and most widespread rewrite of System V Solaris 10 Developed by Sun Microsystems, based on SVR4 4.4BSD Released by Berkeley Software Distribution Used as a basis of a number of commercial UNIX products (e.g. Mac OS X) Linux Discussed in detail later 63

Modern UNIX Kernel Source: U. Vahalia UNIX Internals: The New Frontiers 64

Topics Introduction Operating System Structures &Services Process Management Threads Memory Management Security &Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 65

Linux History Initial version written by Linus Torvalds (Finland) in 1991 Originally intended as a non-commercial replacement for the Minix kernel Since then, a number of contributors continued to improve Linux collaborating over the Internet under Torvalds control: Added many features available in commercial counterparts Optimized the performance Ported to other hardware architectures (Intel x86 and IA-64, IBM Power, MIPS, SPARC, ARM and others) The source code is available and free (protected by the GNU Public License) The current kernel version is 2.6.29 Today Linux can be found on plethora of computing platforms, from embedded microcontrollers and handhelds, through desktops and workstations, to servers and supercomputers 66

Monolithic OS Linux Design All functionality stored mainly in a single block of code All components of the kernel have access to all internal data structures and routines Changes require relinking and frequently a reboot Modular architecture Extensions of kernel functionality (modules) can be loaded and unloaded at runtime (dynamic linking) Can be arranged hierarchically (stackable) Overcomes use and development difficulties associated with monolithic structure 67

Principal Kernel Components Signals System calls Processes and scheduler Virtual memory File systems Network protocols Character device drivers Block device drivers Network device drivers Traps and faults Physical memory Interrupts 68

Topics Introduction Operating System Structures &Services Process Management Threads Memory Management Security &Protection Modern Operating Systems Command-line Interpreter System Unix Linux Introduction Summary Materials for Test 69

Summary Material for the Test OS introduction 7,8,9,10 OS structure, services 12,13,14 Multitasking, Multiprogramming 15,16 Process Management 18 25 Threads 27 29 Memory Management 31, 32 Modern OS 41 45 UNIX 51 62, 64 Linux 67 70

References A. Silberschatz, P. Galvin, G. Gagne "Operating System Concepts (6th edition)" W. Stallings "Operating Systems: Internals and Design Principles (5th Edition)" Maurice Bach "The Design of the UNIX Operating System" Stallings "official" slides based on the book (one pdf per chapter; most useful are sections of chapters 2, 3, 4, 7, 8, 9 and 12): ftp://ftp.prenhall.com/pub/esm/computer_science.s- 041/stallings/Slides/OS5e-PPT-Slides/ Stallings shortened notes on UNIX http://www.box.net/public/tjoikg2scz and Linux: http://www.box.net/public/xg654evf8u J. Moreira et al. paper on BG/L OS design: http://sc06.supercomputing.org/schedule/pdf/pap178.pdf

72