CPS221 Lecture: Operating System Functions

Size: px
Start display at page:

Download "CPS221 Lecture: Operating System Functions"

Transcription

1 CPS221 Lecture: Operating System Functions Objectives last revised 6/23/10 1. To overview key hardware concepts 2. To iintroduce the process concept 3. To discuss the various kinds of functionality of the OS I. Introduction A. Operating systems play a central role in the operation of most computer systems. In fact, when one speaks of a computer system, one often refers to the operating system - e.g. a Windows machine or a Linux machine or a Macintosh (Only in the latter case does the name say anything about the hardware, and only because MacOS only runs on machines made by Apple). B. In essence, what the operating system does is to create a layer of abstraction around the basic hardware, such that the user does not see the actual underlying machine, but rather a virtual machine that the operating system provides: User Application Programs Operating System Hardware 1. The user and the application programs do not see the hardware directly, but only through the operating system. 2. One benefit of this abstraction is that it hides differences in machines from the user, so that the user can focus on the general solution to his problem, rather than the intricacies of a particular machine it runs on. This facilitates portability of programs. 3. The UNIX operating system has carried this even further. a) Most operating systems are specific to a particular type of CPU and even manufacturer. (e.g. the 80x86 family for Windows; 80x86 made by Apple for MacOS), 1

2 b) UNIX and Unix-like systems (including Linux) have been implemented on many different CPU's. Application programs may, of course, need to be recompiled for a particular hardware architecture, since the machine language is different; but the basic UNIX file system and system services is the same in all cases, so that Unix-like programs are highly portable from machine to machine. C. One way to view an operating system is in terms of four basic interfaces: 1. The interface to the underlying hardware (specific to a particular machine). A modern operating system is responsible for managing five general categories of hardware resources: a) The CPU itself b) Primary memory c) Various sorts of IO devices (1) One user at a time devices like a printer, keyboard, or monitor (2) The file system (3) Networking capabilities 2. The interface to application programs (should look the same whereever a given operating system is implemented) 3. The interface to the user (command language, utilities) 4. The interface to system management capabilities. D. Each of these interfaces provides a "view" of the operating system that is important to certain kinds of people. 1. People who build interfaces for new kinds of hardware devices are, of course, most interested in the operating system's hardware interface. 2. Application programmers are primarily interested in the operating system's program interface - though they also use the user interface in their work. 3. Many users are only interested in the user interface. Indeed, many popular books about particular operating systems deal primarily with this aspect. 2

3 4. More sophisticated users and system managers are also concerned with the administrative interfaces. E. Many operating systems are delivered as three major components: a kernel plus a collection of libraries plus a collection of system programs. 1. The core of the operating system (the operating system proper) provides the first interface, plus some additional functionality we will discuss. 2. The libraries provide the second interface, relying on mechanisms provided by the operating system proper. 3. The system programs provide the latter two, relying on mechanisms provided by the operating system proper and the libraries. 4. Our principle focus in the course will be on the hardware and the application program interface, though we will say a bit about the user and management interfaces. II. The Operating System Proper A. The operating system proper directly controls the hardware. There are a few fundamental hardware concepts that are important to understand at this point. 1. The notion of CPU mode. a) General-purpose CPU s typically operate in one of two modes - kernel and user. (1) This is often specified by a single bit in the CPU s state. (2) When the CPU is in kernel mode (a) Any instruction in its instruction set is legal (b) Any location in its physical memory is accessible (c) Any IO device can be accessed (3) When the CPU is in kernel mode (a) Certain privileged instructions cannot be executed - e.g. the instruction that halts the CPU, or that changes its mode. 3

4 (b) There are restrictions on what locations in physical memory can be accessed, and on the nature of that access (read only or read and write) (c) IO devices generally cannot be accessed. (d) If code executing in user mode attempts to perform some operation it is not allowed to perform, a trap to operating system code occurs. b) This distinction provides the basis for protecting the operating system from user code, and for preventing different users from interfering with each other. (1) User code cannot execute an instruction (like halt) which would interfere with others. (2) User code cannot access physical memory belonging to the operating system or another user. (3) User code cannot access physical devices including files residing on disk. c) Historically, code that was part of the operating system proper was designed to execute with the CPU in kernel mode, while utilities, compilers, and user applications alway execute in user mode. (1) Today, though, a trend in operating system design is to have only certain portions of the operating system (commonly called the kernel) execute in kernel mode, while the rest of the operating system executes in user mode. (2) This reduces the risk of catastrophic failure resulting from an error in operating system code. (3) It also reduces security vulnerabilities - worms, viruses and the like sometimes rely on getting the CPU to execute their own code in kernel mode. d) So what does user code do when it needs to perform an operation that can only be performed in kernel mode? (1) It places a description of what it wants done in some systemspecific place. 4

5 (2) It then executes a special instruction (commonly called a system call) that both changes the CPU to kernel mode and begins executing operating system code that analyzes the user code s request and carries it out if it is permissible. e) Some CPU s provide more than two modes to allow finer-grained specification of access privileges - but we will not discuss this further. 2. A second key notion is the notion of an interrupt or trap. a) The two terms interrupt and trap have distinct technical meanings, but are handled similarly, and the one term interrupt is often used collectively to cover both. (1) An interrupt is an event that is triggered by an external device - e.g. when an IO operation to a device is complete, or when a hardware clock ticks. In the case of an IO interrupt, there is typically some process in the waiting state that is waiting for the operation to complete. (2) A trap is a CPU event that is triggered by the program currently running on the CPU. There are two sources for traps. (a) It may be the result of some kind of fault such as executing an illegal instruction or attempting to access a protected region of memory or an IO device. (b) It may be deliberately triggered by the system call instruction. All CPU architectures include some instruction like this, which the hardware treats as an illegal instruction (thus initiating fault processing), but the OS recognizes as a system call rather than a fault. b) Either sort of event is handled by the hardware in essentially the same way: (1) The hardware saves minimal information about the current state of the system - at least the program counter and its current mode (user or kernel), and sometimes a bit of other information. (Details vary from architecture to architecture). (2) The hardware changes mode to kernel 5

6 (3) The hardware starts executing appropriate OS kernel code. (a) On some hardware architectures, the code that is executed is a dispatcher routine in the OS that analyzes the cause of the interrupt/trap and passes control to the correct handler routine in the OS. (b) On other architectures, this analysis is effectively done by the hardware. (c) In either case, the end result is that the hardware begins executing an appropriate handler routine in the OS. There is one handler for each external device that might cause an interrupt, and one handler for each possible cause for a trap. c) However, what the OS handler routine does depends on the nature of the interrupt or trap. (1) In the case of interrupts from an IO device, the typical actions include: (a) Changing the state of the process waiting for the IO operation to complete from waiting to ready. (b) Possibly initiating a new IO operation on the same device, if there is one waiting. (On a shared device like a disk, one process may request an operation while the device is busy serving another process - in fact, there may be a whole queue of pending requests for a device.) (2) An internal clock tick may result in some process that was waiting a specific period time becoming ready. (3) In the case of traps resulting from a fault, one of the following is done: (a) Initiating appropriate exception processing in the process (b) Terminating the offending process. (4) In the case of a trap resulting from a request for a system service: (a) Prior to initiating the trap, the process will have placed information about what it wants in some appropriate place. 6

7 (b) The system service handler will analyze this information to determine what the process wants and to see if it is legitimate. If it is legitimate, processing will be initiated; if it is not legitimate, the request will be handled as if it were a fault. d) In any case, after processing the interrupt or trap, the OS handler will have to decide whether to resume running the process that was running at the time the trap occurred, or to run some other process - e.g. because a waiting process of higher priority has just become ready, or because the running process has requested an operation for which it must wait. 3. The book also talked about hardware facilities for memory management. Because we talk about these in CPS311, we will discuss neither these facilities nor the memory management functions of an operating system in this course. B. One of the key responsibilities of the operating system is to manage a collection of processes. 1. A process is a program in execution. At any given time, the status of a process includes: a) A region of memory that contains the code that it is executing. plus the values of its variables. b) Its state. At any given time, a process may either by ready to use the CPU, or waiting for some event to occur before it can proceed further c) The contents of the various CPU registers - particularly the program counter, which indicates the location in memory of the instruction the process is about to execute next. d) Note the difference between a program and a process - a process is a program in execution. (1) When a program is running, there is generally a one-to-one correspondence between the program and the process running it. (2) However, it is possible that some programs, when run, may give rise to multiple processes. 7

8 (3) Conversely, a single process may run different programs over the course of its life. e) Actually, it is possible on newer systems for a process to be decomposed into a set of threads, each of which has its own set of register values and state, though all share the same memory. We will ignore this for now, but come back to it later. 2. At any given time, a system may running several types of processes. a) Some processes are providing service directly to users - e.g command interpreters, application programs, utilities. Example: as I am writing this, at least three processes I am aware of are currently running on my computer - one running my word processor, my program, and a web browser. b) Some processes may be server processes providing services to other computers on the network. c) Others processes are providing operating system functions that the user may not be consciously aware of. 3. The kernel provides a number of services concerned with the management of processes - e.g. services that create processes, allow processes to terminate (either normally or in error) and (sometimes) that allow processes to communicate with or control other processes. C. Another major task of the operating system is resource allocation. There is a sense in which the various processes on the system are in competition for various system resources, and it is the kernel's task to apportion them appropriately. 1. One such resource is the CPU. a) On a one-cpu system, only one process can actually be executing on the CPU at a time. (If the system has multiple CPU s or is multicore, the number may be greater than one but still typically much less than the number of processes in existence). b) If there are multiple processes that could use the CPU, the operating system must determine which process gets it, and for how long. 2. Memory is another resource to be allocated. Each process needs one or more regions of memory to hold its code and data. 8

9 3. Another resource to be managed is the various IO devices. a) One user at a time devices b) The file system c) Network connections. D. Another kernel task is providing support services needed by processes. These include: 1. Support for IO operations, so that application programs can be shielded from hardware-specific details. This can be very sophisticated on windowing systems, where a single physical display is shared by multiple processes through individual windows that can overlap one in various ways. 2. File system management (directory structures, etc.) 3. Networking to other systems. 4. Of course, the operating system should also guarantee processes protection from interference by other processes. E. The heart of the operating system is a collection of routines that are normally entered as a result of hardware interrupts or traps. 1. Most of the time the CPU is executing code on behalf of a user process. 2. The operating system contains a collection of handlers. The execution of one of these is triggered by an external interrupt, or a fault or a system service request by the currently running program. 3. In either case, after servicing the event, the OS handler code resumes the running of some user process. III. Libraries - the API A. All operating systems provide a collection of routines that can be used by application programs - commonly called the API. B. An operating system API includes routines that correspond directly to the various system services, but provide a more straightforward interface. 9

10 Example: On Unix systems, each of the system service calls is given a number, which is specified (together with other parameters) when the system service is invoked. For each system service, the API also defines a routine that takes the correct number of arguments and supplies the service number. For example, the function read() with three arguments executes a trap with code 3 - which corresponds to the read system service. C. Typically, an API also provides a large number of routines that provide more general support application programs (including things like mathematical functions as well system type operations.) 1. For example, there is a family of IEEE standards for Unix and Unixlike API s known as POSIX (Portable Operating System Interface [for Unix] a) Most versions of Unix (including MacOSX) fully support POSIX. b) Linux mostly supports POSIX c) Microsoft provides an add-on for some versions of Windows that provides full support for the POSIX API. 2. Both Windows and MacOS include extensive libraries as part of the OS distributiion D. There is a somewhat blurry line between API libraries and middleware. The term middleware refers to an add-on API that facilitates cooperation between processes, possibly running on multiple machines. PROJECT APPLICATIONS MIDDLEWARE OPERATING SYSTEM 10

11 1. Examples: Microsoft.NET, web servers, Object-request brokers, remote procedure call facilities, etc. 2. In practice, the line is often drawn between the API furnished by the operating system, per-se, and that furnished by add-on software - so we get a situation that looks like this: IV. System Programs A. Operating Systems also include a collection of system programs thar can be run when needed. (When such a program is running it gives rise to a process that the kernel manages like other processes.) B. One important kind of system program is the program that provides the user interface to the rest of the system. 1. This can take on of two forms a) A command interpreter that reads textual commands and performs them. DEMO: Shell b) A graphical user interface 2. Systems often provide several interfaces like this that the user can choose from. a) On both the Macintosh and Windows, the normal user interface is via a GUI. b) But on both systems, it is possible to access a command-line interface (as was just demonstrated on a Macintosh). c) On Unix/Unix-like systems, the system can be configured to start up with either a command-line or a GUI interface, but it is always possible to access a command-line when running a GUI interface. d) In the Unix world, the command line is known as the shell, and Unix or Unix-like systems often include a number of different shells that the user can choose from. (1) Both our Linux machines and Mac OSX have the following shells 11

12 (a) The Bourne shell (named after its developer Steven Bourne) - (known by the name sh) (b) A GNU-variant known as the Bourne again shell (bash) (c) The Korn shell (ksh) (d) The C-Shell - a shell with syntax that resembles the C programming language (csh) (e) A variant of the C Shell (tcsh) (f) The Z shell (zsh) (2) Unix shells have many of the features of a programming language, making it possible to create shell scripts in which the primitive operations are actually the execution of various programs 3. The user interface (whether a GUI or a command line) allows the user to perform various file system operations (e.g examining directories, moving, renaming, or deleting files) as well as to run programs. a) In a GUI, these capabilities are typically part of the GUI. b) With a shell, they may be built into the shell, or provided by system programs that the shell runs. Example: to delete a file on a Unix-like system, one uses the shell command rm, which runs a program known as rm. C. Other system programs support the user interface or provide other utility or administrative services. Example: Show /Applications/Utilities on a Macintosh - describe/demo a few programs Example: Show System Preferences on the Macintosh - describe/demo a few panes 12

CPS221 Lecture: Operating System Functions

CPS221 Lecture: Operating System Functions CPS221 Lecture: Operating System Functions Objectives 1. To overview key hardware concepts 2. To introduce the process concept 3. To discuss the various kinds of functionality of the OS last revised 8/25/11

More information

CPS221 Lecture: Operating System Protection

CPS221 Lecture: Operating System Protection Objectives CPS221 Lecture: Operating System Protection last revised 9/5/12 1. To explain the use of two CPU modes as the basis for protecting privileged instructions and memory 2. To introduce basic protection

More information

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview Today CSCI 4061 Introduction to s Instructor: Abhishek Chandra OS Evolution Unix Overview Unix Structure Shells and Utilities Calls and APIs 2 Evolution How did the OS evolve? Dependent on hardware and

More information

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview

Today. Operating System Evolution. CSCI 4061 Introduction to Operating Systems. Gen 1: Mono-programming ( ) OS Evolution Unix Overview Today CSCI 4061 Introduction to s Instructor: Abhishek Chandra OS Evolution Unix Overview Unix Structure Shells and Utilities Calls and APIs 2 Evolution How did the OS evolve? Generation 1: Mono-programming

More information

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services

TDDI04, K. Arvidsson, IDA, Linköpings universitet Operating System Structures. Operating System Structures Overview. Operating System Services TDDI04 Concurrent Programming, Operating Systems, and Real-time Operating Systems Operating System Structures [SGG7] Chapter 2 Copyright Notice: The lecture notes are mainly based on Silberschatz s, Galvin

More information

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams.

The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. The Slide does not contain all the information and cannot be treated as a study material for Operating System. Please refer the text book for exams. Operating System Services User Operating System Interface

More information

Operating System Services

Operating System Services CSE325 Principles of Operating Systems Operating System Services David Duggan dduggan@sandia.gov January 22, 2013 Reading Assignment 3 Chapter 3, due 01/29 1/23/13 CSE325 - OS Services 2 What Categories

More information

CPS221 Lecture: Threads

CPS221 Lecture: Threads Objectives CPS221 Lecture: Threads 1. To introduce threads in the context of processes 2. To introduce UML Activity Diagrams last revised 9/5/12 Materials: 1. Diagram showing state of memory for a process

More information

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture Last Class: OS and Computer Architecture System bus Network card CPU, memory, I/O devices, network card, system bus Lecture 4, page 1 Last Class: OS and Computer Architecture OS Service Protection Interrupts

More information

ELEC 377 Operating Systems. Week 1 Class 2

ELEC 377 Operating Systems. Week 1 Class 2 Operating Systems Week 1 Class 2 Labs vs. Assignments The only work to turn in are the labs. In some of the handouts I refer to the labs as assignments. There are no assignments separate from the labs.

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System

More information

Operating Systems Overview. Chapter 2

Operating Systems Overview. Chapter 2 Operating Systems Overview Chapter 2 Operating System A program that controls the execution of application programs An interface between the user and hardware Masks the details of the hardware Layers and

More information

What is UNIX? A Little Bit about UNIX and User Interfaces. Adapted from Practical Unix and Programming Hunter College

What is UNIX? A Little Bit about UNIX and User Interfaces. Adapted from Practical Unix and Programming Hunter College What is UNIX? A Little Bit about UNIX and User Interfaces Adapted from Practical Unix and Programming Hunter College Copyright 2006 Stewart Weiss What is UNIX? It is a multi-user, multi-tasking operating

More information

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing

Operating Systems 3. Operating Systems. Content. What is an Operating System? What is an Operating System? Resource Abstraction and Sharing Content 3 Operating Systems The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail. How to log into (and out

More information

Operating Systems. Copyleft 2005, Binnur Kurt

Operating Systems. Copyleft 2005, Binnur Kurt 3 Operating Systems Copyleft 2005, Binnur Kurt Content The concept of an operating system. The internal architecture of an operating system. The architecture of the Linux operating system in more detail.

More information

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation

Multiprogramming. Evolution of OS. Today. Comp 104: Operating Systems Concepts 28/01/2013. Processes Management Scheduling & Resource Allocation Comp 104: Operating Systems Concepts Management Scheduling & Resource Allocation Today OS evolution Introduction to processes OS structure 1 2 Evolution of OS Largely driven by desire to do something useful

More information

Definition: An operating system is the software that manages resources

Definition: An operating system is the software that manages resources 13-1 Operating Systems 13-1 Definition: An operating system is the software that manages resources in a computer. Resources A resource is (usually) hardware that needs to be accessed. There are rules for

More information

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

Lecture Topics. Announcements. Today: Operating System Overview (Stallings, chapter , ) Next: Processes (Stallings, chapter Lecture Topics Today: Operating System Overview (Stallings, chapter 2.1-2.4, 2.8-2.10) Next: Processes (Stallings, chapter 3.1-3.6) 1 Announcements Consulting hours posted Self-Study Exercise #3 posted

More information

13-2 EE 4770 Lecture Transparency. Formatted 8:18, 13 March 1998 from lsli

13-2 EE 4770 Lecture Transparency. Formatted 8:18, 13 March 1998 from lsli 13-1 13-1 Operating Systems Definition: An operating system is the software that manages resources in a computer. Resources A resource is (usually) hardware that needs to be accessed. There are rules for

More information

Lecture 2 - Fundamental Concepts

Lecture 2 - Fundamental Concepts Lecture 2 - Fundamental Concepts Instructor : Bibhas Ghoshal (bibhas.ghoshal@iiita.ac.in) Autumn Semester, 2015 Bibhas Ghoshal IOSY 332C & IOPS 332C: OS Autumn Semester, 2015 1 / 43 Lecture Outline Operating

More information

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues

Chapter 4: Threads. Chapter 4: Threads. Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues 4.2 Silberschatz, Galvin

More information

Lecture 2: September 9

Lecture 2: September 9 CMPSCI 377 Operating Systems Fall 2010 Lecture 2: September 9 Lecturer: Prashant Shenoy TA: Antony Partensky & Tim Wood 2.1 OS & Computer Architecture The operating system is the interface between a user

More information

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

Ricardo Rocha. Department of Computer Science Faculty of Sciences University of Porto Ricardo Rocha Department of Computer Science Faculty of Sciences University of Porto Slides based on the book Operating System Concepts, 9th Edition, Abraham Silberschatz, Peter B. Galvin and Greg Gagne,

More information

Process Description and Control

Process Description and Control Process Description and Control 1 Process:the concept Process = a program in execution Example processes: OS kernel OS shell Program executing after compilation www-browser Process management by OS : Allocate

More information

CS 390 Chapter 2 Homework Solutions

CS 390 Chapter 2 Homework Solutions CS 390 Chapter 2 Homework Solutions 2.1 What is the purpose of... System calls are used by user-level programs to request a service from the operating system. 2.5 What is the purpose of... The purpose

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures 2.1 Silberschatz, Galvin and Gagne 2009 Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System

More information

Chapter 2 Operating-System Structures

Chapter 2 Operating-System Structures This chapter will discuss the following concepts: 2.1 Operating System Services 2.2 User Operating System Interface 2.3 System Calls 2.4 System Programs 2.5 Operating System Design and Implementation 2.6

More information

Operating Systems CS3502 Spring 2018

Operating Systems CS3502 Spring 2018 Operating Systems CS3502 Spring 2018 Presented by Dr. Guoliang Liu Department of Computer Science College of Computing and Software Engineering Kennesaw State University Computer Systems See Appendix G

More information

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Objectives To introduce the notion of a

More information

Unit 2 : Computer and Operating System Structure

Unit 2 : Computer and Operating System Structure Unit 2 : Computer and Operating System Structure Lesson 1 : Interrupts and I/O Structure 1.1. Learning Objectives On completion of this lesson you will know : what interrupt is the causes of occurring

More information

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on

Chapter 2: Operating-System Structures. Operating System Concepts 9 th Edit9on Chapter 2: Operating-System Structures Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Objectives To describe the services an operating system provides to users, processes, and

More information

CS420: Operating Systems. OS Services & System Calls

CS420: Operating Systems. OS Services & System Calls OS Services & System Calls James Moscola Department of Engineering & Computer Science York College of Pennsylvania Based on Operating System Concepts, 9th Edition by Silberschatz, Galvin, Gagne Operating

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls (important!) Types of System Calls (important!) System

More information

Operating System Structure

Operating System Structure Operating System Structure Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission Recap: Memory Hierarchy Fast, Expensive Slow, Inexpensive 2 Recap Architectural support

More information

Lecture 2 Operating System Structures (chapter 2)

Lecture 2 Operating System Structures (chapter 2) Bilkent University Department of Computer Engineering CS342 Operating Systems Lecture 2 Operating System Structures (chapter 2) Dr. İbrahim Körpeoğlu http://www.cs.bilkent.edu.tr/~korpe 1 References The

More information

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

Chapter 2: Operating-System Structures. Operating System Concepts Essentials 8 th Edition Chapter 2: Operating-System Structures Operating System Concepts Essentials 8 th Edition Silberschatz, Galvin and Gagne 2011 Chapter 2: Operating-System Structures Operating System Services User Operating

More information

Processes and Threads. Processes and Threads. Processes (2) Processes (1)

Processes and Threads. Processes and Threads. Processes (2) Processes (1) Processes and Threads (Topic 2-1) 2 홍성수 Processes and Threads Question: What is a process and why is it useful? Why? With many things happening at once in a system, need some way of separating them all

More information

Chapter 2: Operating-System Structures

Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Silberschatz, Galvin and Gagne 2009 Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System

More information

Chapter 2: Operating-System

Chapter 2: Operating-System Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services! User Operating System Interface! System Calls! Types of System Calls! System Programs! Operating

More information

Chap2: Operating-System Structures

Chap2: Operating-System Structures Chap2: Operating-System Structures Objectives: services OS provides to users, processes, and other systems structuring an operating system how operating systems are designed and customized and how they

More information

AMSC/CMSC 662 Computer Organization and Programming for Scientific Computing Fall 2011 Operating Systems Dianne P. O Leary c 2011

AMSC/CMSC 662 Computer Organization and Programming for Scientific Computing Fall 2011 Operating Systems Dianne P. O Leary c 2011 AMSC/CMSC 662 Computer Organization and Programming for Scientific Computing Fall 2011 Operating Systems Dianne P. O Leary c 2011 1 Operating Systems Notes taken from How Operating Systems Work by Curt

More information

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts

CSCI 2132 Software Development. Lecture 3: Unix Shells and Other Basic Concepts CSCI 2132 Software Development Lecture 3: Unix Shells and Other Basic Concepts Instructor: Vlado Keselj Faculty of Computer Science Dalhousie University 10-Sep-2018 (3) CSCI 2132 1 Introduction to UNIX

More information

Operating System Structure

Operating System Structure Operating System Structure Heechul Yun Disclaimer: some slides are adopted from the book authors slides with permission Recap OS needs to understand architecture Hardware (CPU, memory, disk) trends and

More information

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services

Chapter 2: Operating-System Structures. Chapter 2: Operating-System Structures. Objectives. Operating System Services Chapter 2: Operating-System Structures Chapter 2: Operating-System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs Operating System

More information

Chapter 4: Threads. Chapter 4: Threads

Chapter 4: Threads. Chapter 4: Threads Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples

More information

Chapter 3 Process Description and Control

Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles Chapter 3 Process Description and Control Seventh Edition By William Stallings Operating Systems: Internals and Design Principles The concept of process

More information

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 General Info 3 lecture hours each week 2 assignments (2*5%=10%) 1 project

More information

(Refer Slide Time: 1:26)

(Refer Slide Time: 1:26) Information Security-3 Prof. V Kamakoti Department of Computer science and Engineering Indian Institute of Technology Madras Basics of Unix and Network Administration Operating Systems Introduction Mod01,

More information

EECS 3221 Operating System Fundamentals

EECS 3221 Operating System Fundamentals General Info EECS 3221 Operating System Fundamentals Instructor: Prof. Hui Jiang Email: hj@cse.yorku.ca Web: http://www.eecs.yorku.ca/course/3221 3 lecture hours each week 2 assignments (2*5%=10%) 1 project

More information

CS370 Operating Systems

CS370 Operating Systems CS370 Operating Systems Colorado State University Yashwant K Malaiya Fall 2016 Lecture 5 Slides based on Text by Silberschatz, Galvin, Gagne Various sources 1 1 User Operating System Interface - CLI CLI

More information

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle

Operating Systems. Operating System Structure. Lecture 2 Michael O Boyle Operating Systems Operating System Structure Lecture 2 Michael O Boyle 1 Overview Architecture impact User operating interaction User vs kernel Syscall Operating System structure Layers Examples 2 Lower-level

More information

Chapter 2: System Structures

Chapter 2: System Structures Chapter 2: Operating System Structures Operating System Services System Calls Chapter 2: System Structures System Programs Operating System Design and Implementation Operating System Structure Virtual

More information

UNIX 2 OPERATING SYSTEM

UNIX 2 OPERATING SYSTEM UNIX 2 OPERATING SYSTEM hapter SYS-ED/ OMPUTER EDUATION TEHNIQUES, IN. Objectives You will learn: Process management in Solaris. omponents of the operating system. Flow of control within the operating

More information

An Overview of the BLITZ System

An Overview of the BLITZ System An Overview of the BLITZ System Harry H. Porter III Department of Computer Science Portland State University Introduction The BLITZ System is a collection of software designed to support a university-level

More information

Chapter 2: System Structures. Operating System Concepts 9 th Edition

Chapter 2: System Structures. Operating System Concepts 9 th Edition Chapter 2: System Structures Silberschatz, Galvin and Gagne 2013 Chapter 2: System Structures Operating System Services User Operating System Interface System Calls Types of System Calls System Programs

More information

OPERATING SYSTEMS UNIT - 1

OPERATING SYSTEMS UNIT - 1 OPERATING SYSTEMS UNIT - 1 Syllabus UNIT I FUNDAMENTALS Introduction: Mainframe systems Desktop Systems Multiprocessor Systems Distributed Systems Clustered Systems Real Time Systems Handheld Systems -

More information

Operating System Architecture. CS3026 Operating Systems Lecture 03

Operating System Architecture. CS3026 Operating Systems Lecture 03 Operating System Architecture CS3026 Operating Systems Lecture 03 The Role of an Operating System Service provider Provide a set of services to system users Resource allocator Exploit the hardware resources

More information

Problem Set: Processes

Problem Set: Processes Lecture Notes on Operating Systems Problem Set: Processes 1. Answer yes/no, and provide a brief explanation. (a) Can two processes be concurrently executing the same program executable? (b) Can two running

More information

Operating Systems 2010/2011

Operating Systems 2010/2011 Operating Systems 2010/2011 Introduction Johan Lukkien 1 Agenda OS: place in the system Some common notions Motivation & OS tasks Extra-functional requirements Course overview Read chapters 1 + 2 2 A computer

More information

Chapter 4: Multithreaded Programming

Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Silberschatz, Galvin and Gagne 2013 Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading

More information

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and

What are some common categories of system calls? What are common ways of structuring an OS? What are the principles behind OS design and What are the services provided by an OS? What are system calls? What are some common categories of system calls? What are the principles behind OS design and implementation? What are common ways of structuring

More information

3.1 Introduction. Computers perform operations concurrently

3.1 Introduction. Computers perform operations concurrently PROCESS CONCEPTS 1 3.1 Introduction Computers perform operations concurrently For example, compiling a program, sending a file to a printer, rendering a Web page, playing music and receiving e-mail Processes

More information

Unix/Linux: History and Philosophy

Unix/Linux: History and Philosophy Unix/Linux: History and Philosophy History and Background Multics project Unix Linux Multiplexed Information and Computing Service Collaborative venture between General Electric, Bell Telephone Labs, and

More information

Chapter 4: Threads. Operating System Concepts 9 th Edit9on

Chapter 4: Threads. Operating System Concepts 9 th Edit9on Chapter 4: Threads Operating System Concepts 9 th Edit9on Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads 1. Overview 2. Multicore Programming 3. Multithreading Models 4. Thread Libraries 5. Implicit

More information

Chapter 4: Threads. Operating System Concepts 9 th Edition

Chapter 4: Threads. Operating System Concepts 9 th Edition Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples

More information

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services

Objectives. Chapter 2: Operating-System Structures. 2.1 Operating System Services Objectives Chapter 2: Operating-System Structures To describe the services an operating system provides to users, processes, and other systems To discuss the various ways of structuring an operating system

More information

Chapter 4: Multithreaded Programming

Chapter 4: Multithreaded Programming Chapter 4: Multithreaded Programming Silberschatz, Galvin and Gagne 2013! Chapter 4: Multithreaded Programming Overview Multicore Programming Multithreading Models Threading Issues Operating System Examples

More information

Reserves time on a paper sign-up sheet. Programmer runs his own program. Relays or vacuum tube hardware. Plug board or punch card input.

Reserves time on a paper sign-up sheet. Programmer runs his own program. Relays or vacuum tube hardware. Plug board or punch card input. Introduction & Ch1 Two Roles of an Operating System Extended Machine or virtual machine Device drivers, Processes, File systems, Networking protocols. Resource Manager Allocates and enforces Memory, Disk

More information

OPERATING SYSTEM. Chapter 4: Threads

OPERATING SYSTEM. Chapter 4: Threads OPERATING SYSTEM Chapter 4: Threads Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples Objectives To

More information

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University

Che-Wei Chang Department of Computer Science and Information Engineering, Chang Gung University Che-Wei Chang chewei@mail.cgu.edu.tw Department of Computer Science and Information Engineering, Chang Gung University l Chapter 10: File System l Chapter 11: Implementing File-Systems l Chapter 12: Mass-Storage

More information

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure

OS structure. Process management. Major OS components. CSE 451: Operating Systems Spring Module 3 Operating System Components and Structure CSE 451: Operating Systems Spring 2012 Module 3 Operating System Components and Structure Ed Lazowska lazowska@cs.washington.edu Allen Center 570 The OS sits between application programs and the it mediates

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA Sanghoon Han(sanghoon.han@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu Announcement (1) Please come

More information

Chapter 3 Process Description and Control

Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles Chapter 3 Process Description and Control Seventh Edition By William Stallings Process Control Block Structure of Process Images in Virtual Memory How

More information

Process Time. Steven M. Bellovin January 25,

Process Time. Steven M. Bellovin January 25, Multiprogramming Computers don t really run multiple programs simultaneously; it just appears that way Each process runs to completion, but intermixed with other processes Process 1 6 ticks Process 2 Process

More information

Operating-System Structures

Operating-System Structures Recap Chapter 2: Operating-System Structures Presented By: Dr. El-Sayed M. El-Alfy Note: Most of the slides are compiled from the textbook and its complementary resources From: OS by Tanenbaum, 2008 March

More information

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc.

Appendix A GLOSSARY. SYS-ED/ Computer Education Techniques, Inc. Appendix A GLOSSARY SYS-ED/ Computer Education Techniques, Inc. $# Number of arguments passed to a script. $@ Holds the arguments; unlike $* it has the capability for separating the arguments. $* Holds

More information

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS

by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS by I.-C. Lin, Dept. CS, NCTU. Textbook: Operating System Concepts 8ed CHAPTER 13: I/O SYSTEMS Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests

More information

Chapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition,

Chapter 4: Multithreaded Programming. Operating System Concepts 8 th Edition, Chapter 4: Multithreaded Programming, Silberschatz, Galvin and Gagne 2009 Chapter 4: Multithreaded Programming Overview Multithreading Models Thread Libraries Threading Issues 4.2 Silberschatz, Galvin

More information

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture)

EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) EI 338: Computer Systems Engineering (Operating Systems & Computer Architecture) Dept. of Computer Science & Engineering Chentao Wu wuct@cs.sjtu.edu.cn Download lectures ftp://public.sjtu.edu.cn User:

More information

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group

Operating Systems (2INC0) 2018/19. Introduction (01) Dr. Tanir Ozcelebi. Courtesy of Prof. Dr. Johan Lukkien. System Architecture and Networking Group Operating Systems (2INC0) 20/19 Introduction (01) Dr. Courtesy of Prof. Dr. Johan Lukkien System Architecture and Networking Group Course Overview Introduction to operating systems Processes, threads and

More information

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - VII CPU Scheduling - II. Louisiana State University

Roadmap. Tevfik Ko!ar. CSC Operating Systems Fall Lecture - VII CPU Scheduling - II. Louisiana State University CSC 4103 - Operating Systems Fall 2009 Lecture - VII CPU Scheduling - II Tevfik Ko!ar Louisiana State University September 14 th, 2009 1 Roadmap Multilevel Feedback Queues Estimating CPU bursts Project

More information

Roadmap. Multilevel Queue Scheduling. Multilevel Queue. Example of Multilevel Feedback Queue. Multilevel Feedback Queue. Tevfik Ko!

Roadmap. Multilevel Queue Scheduling. Multilevel Queue. Example of Multilevel Feedback Queue. Multilevel Feedback Queue. Tevfik Ko! CSC 4103 - Operating Systems Fall 2009 Lecture - VII CPU Scheduling - II Roadmap Multilevel Feedback Queues Estimating CPU bursts Project Discussion System Calls Virtual Machines Tevfik Ko!ar Louisiana

More information

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey

Process Concepts. CSC400 - Operating Systems. 3. Process Concepts. J. Sumey CSC400 - Operating Systems 3. Process Concepts J. Sumey Overview Concurrency Processes & Process States Process Accounting Interrupts & Interrupt Processing Interprocess Communication CSC400 - Process

More information

Hardware OS & OS- Application interface

Hardware OS & OS- Application interface CS 4410 Operating Systems Hardware OS & OS- Application interface Summer 2013 Cornell University 1 Today How my device becomes useful for the user? HW-OS interface Device controller Device driver Interrupts

More information

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture Last 2 Classes: Introduction to Operating Systems & C++ tutorial User apps OS Virtual machine interface hardware physical machine interface An operating system is the interface between the user and the

More information

Introduction to PC Operating Systems

Introduction to PC Operating Systems Introduction to PC Operating Systems Operating System Concepts 8th Edition Written by: Abraham Silberschatz, Peter Baer Galvin and Greg Gagne John Wiley & Sons, Inc. ISBN: 978-0-470-12872-5 Chapter 2 Operating-System

More information

Operating Systems. Operating Systems

Operating Systems. Operating Systems The operating system defines our computing experience. It is the first software we see when we turn on the computer, and the last software we see when the computer is turned off. It's the software that

More information

Distributed Systems Operation System Support

Distributed Systems Operation System Support Hajussüsteemid MTAT.08.009 Distributed Systems Operation System Support slides are adopted from: lecture: Operating System(OS) support (years 2016, 2017) book: Distributed Systems: Concepts and Design,

More information

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

CSE 4/521 Introduction to Operating Systems. Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018 CSE 4/521 Introduction to Operating Systems Lecture 29 Windows 7 (History, Design Principles, System Components, Programmer Interface) Summer 2018 Overview Objective: To explore the principles upon which

More information

Introduction to Linux

Introduction to Linux Introduction to Linux Prof. Jin-Soo Kim( jinsookim@skku.edu) TA - Kisik Jeong (kisik@csl.skku.edu) Computer Systems Laboratory Sungkyunkwan University http://csl.skku.edu What is Linux? A Unix-like operating

More information

CSE506: Operating Systems CSE 506: Operating Systems

CSE506: Operating Systems CSE 506: Operating Systems CSE 506: Operating Systems What Software Expects of the OS What Software Expects of the OS Shell Memory Address Space for Process System Calls System Services Launching Program Executables Shell Gives

More information

! Software ( kernel ) that runs at all times. ! OS performs two unrelated functions: Maria Hybinette, UGA. user! 1! Maria Hybinette, UGA. user! n!

! Software ( kernel ) that runs at all times. ! OS performs two unrelated functions: Maria Hybinette, UGA. user! 1! Maria Hybinette, UGA. user! n! Review: What is An Operating System?! Software ( ) that runs at all times CSCI 6730 / 4730 Operating Systems Structures & System Design» Really, the part of the that runs in (or need to).» But note - there

More information

Module 1. Introduction:

Module 1. Introduction: Module 1 Introduction: Operating system is the most fundamental of all the system programs. It is a layer of software on top of the hardware which constitutes the system and manages all parts of the system.

More information

Chapter 4: Threads. Operating System Concepts 9 th Edition

Chapter 4: Threads. Operating System Concepts 9 th Edition Chapter 4: Threads Silberschatz, Galvin and Gagne 2013 Chapter 4: Threads Overview Multicore Programming Multithreading Models Thread Libraries Implicit Threading Threading Issues Operating System Examples

More information

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy

Operating Systems. Designed and Presented by Dr. Ayman Elshenawy Elsefy Operating Systems Designed and Presented by Dr. Ayman Elshenawy Elsefy Dept. of Systems & Computer Eng.. AL-AZHAR University Website : eaymanelshenawy.wordpress.com Email : eaymanelshenawy@yahoo.com Reference

More information

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

Announcement. Exercise #2 will be out today. Due date is next Monday Announcement Exercise #2 will be out today Due date is next Monday Major OS Developments 2 Evolution of Operating Systems Generations include: Serial Processing Simple Batch Systems Multiprogrammed Batch

More information

Overview of Operating Systems

Overview of Operating Systems Lecture Outline Overview of Operating Systems Instructor: Dr. Tongping Liu Thank Dr. Dakai Zhu and Dr. Palden Lama for providing their slides. 1 2 Lecture Outline Von Neumann Architecture 3 This describes

More information

Threads. CS3026 Operating Systems Lecture 06

Threads. CS3026 Operating Systems Lecture 06 Threads CS3026 Operating Systems Lecture 06 Multithreading Multithreading is the ability of an operating system to support multiple threads of execution within a single process Processes have at least

More information

OS Structure. Hardware protection & privilege levels Control transfer to and from the operating system

OS Structure. Hardware protection & privilege levels Control transfer to and from the operating system OS Structure Topics Hardware protection & privilege levels Control transfer to and from the operating system Learning Objectives: Explain what hardware protection boundaries are. Explain how applications

More information

CS307: Operating Systems

CS307: Operating Systems CS307: Operating Systems Chentao Wu 吴晨涛 Associate Professor Dept. of Computer Science and Engineering Shanghai Jiao Tong University SEIEE Building 3-513 wuct@cs.sjtu.edu.cn Download Lectures ftp://public.sjtu.edu.cn

More information