4 System Services! All of the systems we have discussed have to be accessible to user and user programs! Have to have mechanisms to start programs, request I/O, communicate with other processes and with other computers! Error detection is required (hardware, user programs) Other services needed are:! Resource Allocation! Accounting (time, disk space, pages, etc.)! Protection

5 System Calls! Interface between a running process and the operating system! Generally implemented as an assembly language instruction (INT on INTEL, TRAP on PDP-11, ALine instruction on 68000)! Sometimes a function call (Amiga, NCR32000)! Programming languages provide libraries that wrap these instructions for easy access.! Like most function calls, they take arguments and return a result, it s just the mechanism of the call that is different.

6 System Calls! The system call is identified in one of two ways! One of the parameters (Dos)! Different instruction (Macintosh)! Three general ways are used to pass parameters! Use the registers of the CPU (Amiga, MS-DOS)! Store them in memory and pass the address of the memory in a register (Linux)! Pass them on the stack! Results are passed back in one of two ways:! On the stack! In a register

8 Communication Model! Interprocess Communication! Command interpreter -> child process! other processes need to communicate (Mac publish and subscribe)! Message Model! Operating system provides message passing facility.! In some cases, works over network (sockets)! Shared Memory Model! both processes have access to the same memory! small segments or all of processes memory

9 Systems Program! System calls provide capability, but user must be able to invoke them.! Users view of system defined by system programs, not system calls. No system call to copy a file, but there is a system program.! Programs must be written that the user can invoke that make the system calls! Command interpreter! File System Management (copy, cp, mkdir, rmdir)! Info (date, time, disk space, list directory)! Editors! compilers, project support! communication (web browsers, ftp clients)

10 System Structure! Simple Structure! Limited by hardware! MS-DOS - interfaces and functionality not well separated! Unix is two separate parts!!kernel system call interface (some! modularity)!!systems programs! Layered (OS/2)! Operating system divided into layers! Each layer only uses lower layers (no sibling calls)! Microkernel (Mach)! Minimal kernel (no consensus on what minimal is)! Move as much as possible into system programs

11 Virtualization! Multiprocessing creates the illusion that there is more than one CPU! What if the OS provided an interface that looked exactly like a computer system (virtual CPU, devices, etc.)! IBM VM Operating system (each can run it s own operating system such as CMS or Linux)! Requires more hardware support! Available on PCs (vmware/xen/kvm)! Limits sharing of resources! Perfect for OS research and development! Emulation (Sheepshaver/BOCHS)

13 Virtual Machines (Java)! Portability! virtual machine provides same interface on all hardware! Security! sandbox! Like an OS! class loader! threads! Performance! Just in time compilation

14 Design and Implementation! Mechanisms and Policies! Mechanisms are how! Use timer to protect CPU! Policy is what will be done! timer value (max time process can have CPU)! more flexibility! Implementation! language! efficiency! portability (Linux runs on many architectures)! monitoring capability! sysgen (customization of operating system)

15 What is a process?! An operating system handles a variety of programs in a variety of ways! Batch systems handle jobs! Timesharing systems calls them user programs or tasks.! Job and process are used almost interchangeably.! A process is a program in execution, and all of the resources associated with that executing instance of the program! Memory! Program Counter! Open files, other devices, etc.

18 Process Control Block! One allocated for each process and sometimes for each thread! Repository for information that varies from process to process! Some operating systems have a pre allocated number of them, that is an array (early UNIX)! Some permit dynamic allocation (Amiga OS) Queue Info Process State Schedule Info Process Id Program Counter Registers Memory Info Open File, etc. Accounting Info

19 Context Switch Process 1 Process 2 Int or System Call Save State into PCB Do Accounting Do OS Tasks Select Next Process Restore State from PCB Return from Int

16 Example of Standard API System Call Implementation Typically, a number associated with each system call System call interface maintains a table indexed according to these numbers The system call interface

Lecture Outline Operating Systems Objectives Describe the functions and layers of an operating system List the resources allocated by the operating system and describe the allocation process Explain how

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

S Jerry Breecher 2: OS Structures 1 Structures What Is In This Chapter? System Components System Calls How Components Fit Together Virtual Machine 2: OS Structures 2 SYSTEM COMPONENTS These are the pieces

Process Description and Control 1 Process A program in execution (running) on a computer The entity that can be assigned to and executed on a processor A unit of activity characterized by a at least one

NK YORK COLLEGE OF PENNSYLVANIA HG OK 2 YORK COLLEGE OF PENNSYLVAN OS Services & System Calls James Moscola Department of Physical Sciences York College of Pennsylvania Based on Operating System Concepts,

IT 3123 Hardware and Software Concepts Operating Systems II October 26 Multiprogramming Two or more application programs in memory. Consider one CPU and more than one program. This can be generalized to

Multi-core Programming System Overview Based on slides from Intel Software College and Multi-Core Programming increasing performance through software multi-threading by Shameem Akhter and Jason Roberts,

Operating Systems 4 th Class Lecture 1 Operating Systems Operating systems are essential part of any computer system. Therefore, a course in operating systems is an essential part of any computer science

How do Users and Processes interact with the Operating System? Users interact indirectly through a collection of system programs that make up the operating system interface. The interface could be: A GUI,

An Implementation Of Multiprocessor Linux This document describes the implementation of a simple SMP Linux kernel extension and how to use this to develop SMP Linux kernels for architectures other than

Review from last time CS 537 Lecture 3 OS Structure What HW structures are used by the OS? What is a system call? Michael Swift Remzi Arpaci-Dussea, Michael Swift 1 Remzi Arpaci-Dussea, Michael Swift 2

Processes and Non-Preemptive Scheduling Otto J. Anshus 1 Concurrency and Process Challenge: Physical reality is Concurrent Smart to do concurrent software instead of sequential? At least we want to have

Introduction to Operating Systems Indiana University Chen Yu Perspective of the Computer System Software A general piece of software with common functionalities that support many applications. Example:

Topic 5a Operating System Fundamentals What is an operating system? a computer is comprised of various types of software device drivers (storage, I/O, etc.) process and control software memory management

Chapter 7 OBJECTIVES Operating Systems Define the purpose and functions of an operating system. Understand the components of an operating system. Understand the concept of virtual memory. Understand the

System Calls Programming interface to the services provided by the OS" Typically written in a high-level language (C or C++)" Mostly accessed by programs via a high-level Application Programming Interface

Operating System Tutorial OPERATING SYSTEM TUTORIAL Simply Easy Learning by tutorialspoint.com tutorialspoint.com i ABOUT THE TUTORIAL Operating System Tutorial An operating system (OS) is a collection

Operating System Structures While process management, memory management, file systems, and I/O provide an idea of what an operating system does (its verbs), additional concepts help define what an operating

Virtualization Clothing the Wolf in Wool Virtual Machines Began in 1960s with IBM and MIT Project MAC Also called open shop operating systems Present user with the view of a bare machine Execute most instructions

Operating Systems Lecture 03 February 11, 2013 Goals for Today Interrupts, traps and signals Hardware Protection System Calls Interrupts, Traps, and Signals The occurrence of an event is usually signaled

1 Virtual Machines A virtual machine (VM) is a "completely isolated guest operating system installation within a normal host operating system". Modern virtual machines are implemented with either software

These slides are by Dr. Jaerock Kwon at. The original URL is http://kettering.jrkwon.com/sites/default/files/2011-2/ce-491/lecture/alecture-01.pdf so please use that instead of pointing to this local copy

Chapter 1: Operating System Models 1 2 Operating System Models 2.1 Introduction Over the past several years, a number of trends affecting operating system design are witnessed and foremost among them is

Computers: Tools for an Information Age Chapter 3 Operating Systems: Software in the Background Objectives of Chapter 3 Describe the functions of an Operating System Explain the basics of a personal computer