OS Concepts An Introduction operating systems. At the end of this module, you should have a basic understanding of what an operating system is, what it.

Slides:



Advertisements
Similar presentations
Computer-System Structures Er.Harsimran Singh
Advertisements

Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 3 Operating System Organization.
Threads, SMP, and Microkernels Chapter 4. Process Resource ownership - process is allocated a virtual address space to hold the process image Scheduling/execution-
Computer Systems/Operating Systems - Class 8
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
CMPT 300: Operating Systems I Dr. Mohamed Hefeeda
Operating Systems High Level View Chapter 1,2. Who is the User? End Users Application Programmers System Programmers Administrators.
OS Spring’03 Introduction Operating Systems Spring 2003.
Advanced OS Chapter 3p2 Sections 3.4 / 3.5. Interrupts These enable software to respond to signals from hardware. The set of instructions to be executed.
1/28/2004CSCI 315 Operating Systems Design1 Operating System Structures & Processes Notice: The slides for this lecture have been largely based on those.
1 Last Class: Introduction Operating system = interface between user & architecture Importance of OS OS history: Change is only constant User-level Applications.
Introduction Operating Systems’ Concepts and Structure Lecture 1 ~ Spring, 2008 ~ Spring, 2008TUCN. Operating Systems. Lecture 1.
OS Organization. OS Requirements Provide resource abstractions –Process abstraction of CPU/memory use Address space Concurrency Thread abstraction of.
Operating System Organization
1 What is an operating system? CSC330Patricia Van Hise.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3 Operating System Organization.
Copyright Arshi Khan1 System Programming Instructor Arshi Khan.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Stack Management Each process/thread has two stacks  Kernel stack  User stack Stack pointer changes when exiting/entering the kernel Q: Why is this necessary?
CSE 451: Operating Systems Autumn 2013 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
System Calls 1.
Operating System A program that controls the execution of application programs An interface between applications and hardware 1.
Protection and the Kernel: Mode, Space, and Context.
Chapter 1. Introduction What is an Operating System? Mainframe Systems
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Windows Operating System Internals - by David A. Solomon and Mark E. Russinovich with Andreas Polze Unit OS6: Device Management 6.1. Principles of I/O.
Chapter 2: Operating-System Structures. 2.2 Silberschatz, Galvin and Gagne ©2005 Operating System Concepts – 7 th Edition, Jan 14, 2005 Operating System.
OS provide a user-friendly environment and manage resources of the computer system. Operating systems manage: –Processes –Memory –Storage –I/O subsystem.
Three fundamental concepts in computer security: Reference Monitors: An access control concept that refers to an abstract machine that mediates all accesses.
Introduction to Operating Systems Chapter 1. cs431 -cotter2 Lecture Objectives Understand the relationship between computing hardware, operating system,
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
Recall: Three I/O Methods Synchronous: Wait for I/O operation to complete. Asynchronous: Post I/O request and switch to other work. DMA (Direct Memory.
Operating Systems ECE344 Ashvin Goel ECE University of Toronto OS-Related Hardware.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 2: Operating-System Structures.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
CE Operating Systems Lecture 3 Overview of OS functions and structure.
Computers Operating System Essentials. Operating Systems PROGRAM HARDWARE OPERATING SYSTEM.
Slide 3-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 3.
Processes Introduction to Operating Systems: Module 3.
Operating System Structure A key concept of operating systems is multiprogramming. –Goal of multiprogramming is to efficiently utilize all of the computing.
We will focus on operating system concepts What does it do? How is it implemented? Apply to Windows, Linux, Unix, Solaris, Mac OS X. Will discuss differences.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Concurrency, Processes, and System calls Benefits and issues of concurrency The basic concept of process System calls.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Processes and Threads.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
1 Process Description and Control Chapter 3. 2 Process A program in execution An instance of a program running on a computer The entity that can be assigned.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Interrupts and Exception Handling. Execution We are quite aware of the Fetch, Execute process of the control unit of the CPU –Fetch and instruction as.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Operating Systems Overview: Using Hardware.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
1 Chapter 2: Operating-System Structures Services Interface provided to users & programmers –System calls (programmer access) –User level access to system.
1.1 Silberschatz, Galvin and Gagne ©2013 Operating System Concepts – 9 th Edition Chapter 1: Introduction What Operating Systems Do √ Computer-System Organization.
Introduction to Operating Systems Concepts
Applied Operating System Concepts
CS 6560: Operating Systems Design
Introduction to Operating System (OS)
OS Organization.
Chapter 15, Exploring the Digital Domain
Module 2: Computer-System Structures
Operating Systems Chapter 5: Input/Output Management
CSE 451: Operating Systems Spring 2012 Module 6 Review of Processes, Kernel Threads, User-Level Threads Ed Lazowska 570 Allen.
Lecture Topics: 11/1 General Operating System Concepts Processes
CSCE 313 – Introduction to UNIx process
Introduction to Operating Systems
Operating Systems: A Modern Perspective, Chapter 3
Outline Operating System Organization Operating System Examples
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment. Phone:
In Today’s Class.. General Kernel Responsibilities Kernel Organization
Presentation transcript:

OS Concepts An Introduction operating systems

At the end of this module, you should have a basic understanding of what an operating system is, what it does, and what the major components of an operating system are. operating systems

Why should I study operating systems? operating systems

Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers Average Salary$71,020$79,300 Average Bonus$ 3,410 $ 3,940 Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers Average Salary$71,020$79,300 Average Bonus$ 3,410 $ 3,940 operating systems

Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers System Mainframe$74,100$80,840 Unix/Linux$76,100$84,100 Windows$71,000$79,300 Based on a 2007 IT Salary Survey Application ProgrammersSystem Programmers System Mainframe$74,100$80,840 Unix/Linux$76,100$84,100 Windows$71,000$79,300 operating systems

operating systems Even as an application programmer, most real commercial applications will require that you Understand OS design issues and tradeoffs Performance Function Space Be able to exploit OS capabilities Multiple Processes Threads Synchronization Communication

What Is An Operating System CPU Operating System Kernel Language Libraries and System Calls API System and Application Programs User operating systems

personal computermainframe system cell phones Music players game controllers

Hardware Device Operating System Executing Program This program has no sense of sharing the system’s resources with other programs. It sees an Abstract Machine that has all of the resources that it needs.

The Abstract Machine Modern computing systems are multi-user, multi-program systems. The fundamental task of an operating system in this environment is to give each running program a logical, abstract machine that contains all of the resources that it needs to do its job. Input/Output devices Memory CPU General purpose registers Status registers Stack Execution Context

Computer System Organization system bus cpu disk controller memory device controller printer device controller keyboard... app

Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... cpu and devices work concurrently

Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... each device controller is in charge of a particular device type

Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... Each device controller has a local buffer

Computer System Operation system bus cpu disk controller memory device controller printer device controller keyboard... device controllers send interrupts to the cpu to tell it that they have finished an operation the cpu told them to do

Interrupts An interrupt causes control to branch to an interrupt service routine through an interrupt vector. The address of the interrupted instruction is saved. Incoming interrupts are disabled while an interrupt is being processed. A trap is a software generated interrupt. An operating system is interrupt driven.

I/O Processing Synchronous I/O 1. A process starts an I/O operation 2. The requesting process waits until the I/O completes requesting process device driver wait interrupt handler hardware data

I/O Processing Asynchronous I/O 1. A process starts an I/O operation 2. An acknowledgement is returned 3. The process continues execution 4. The device interrupts the process when the I/O is complete requesting process device driver interrupt handler hardware data

ProcessesProcesses A process is defined as a program in execution. It includes * The program itself (program segment) * The program’s data (data segment, stack, heap) * Open files * The execution context

For efficiency, modern operating systems allow many processes to be running concurrently. When one process has to wait for something, typically for an I/O operation to complete, the operating systems schedules another process to run. Many programs can be in memory at the same time. The operating system gives each process a slice of time in which to run.

ThreadsThreads A thread, or thread of execution, is the set of instructions being executed in a process. In a single thread system each process has exactly one execution engine (the logical machine). In a multi-thread environment, a process may have many execution engines, one for each thread. Thus, each thread has it’s own runtime stack, registers, and state information, but they all share the same address space in memory (program and data), and the same files. In new multi-core machines, each logical engine may run on a real engine.

ResourcesResources All of the components required for a program to do it’s job are called resources. * memory * cpu time * devices * files * network connection When a process needs to use a resource, it must ask the operating system for the resource before using it. Once a process asks for a resource, it suspends operation and waits until the resource is available.

Responsibilities of the OS 1.Create an abstract machine environment for each running process. 2. Manage the use of the physical components in the system, according to the policies of the system’s administrator or the system designer. * Device management * Process and thread management * Memory Management * File Management

Device Management The OS manages the allocation, isolation, and sharing of devices. * Terminals * Disk Drives * Printers * Networks * Keyboard * etc

Device Drivers Device Independent Part Application Programming Interface Device Driver Interface Vendor Specific Part Vendor Specific Part Vendor Specific Part

Process & Resource Management Schedules the processor so that each thread/process receives an equitable fraction of the available time, and maintains the execution context for each thread (stack, registers, etc) Allocates resources to processes when they are requested and keeps track of resources when a thread is finished with them. Isolates access to resources or allows sharing of resources as required.

Memory Management Maintains a unique address space in memory for each process. Works with the file and/or device managers to provide virtual memory (address space is larger than physical memory).

File Management Works with the device managers to give applications A logical view of storage (byte stream, indexed data, text files, etc), and manage the flow of information between the actual storage device and the program.

Design Issues Performance: The OS must be as efficient as possible, maximizing the use of machine resources by applications. There is some overhead involved in providing OS services. If the overhead gets too large, it negates the value of the service. Exclusive Use of Resources: Each process must have the ability to have exclusive use of the system resources that it uses. A process must not be able to use a resource unless the OS has given it permission. Sharing of resources should also be allowed. * Protection Mechanisms * Security Policies

Processor Modes Modern computing hardware provides multiple modes of operation: User Mode - Cannot execute all machine instructions (e.g. I/O) - Can only access memory allocated to the process Privileged Mode - Executes any instruction in the repertoire - Can access protected memory - Only executes trusted software (The OS kernel)

Trap Instructions User Space User Process Library Code... fork( );... fork( ) { … trap SYS_FORK( )... } Kernel trap table SYS_FORK sys_fork( ) { /* system function */... return; } Expensive!

OS Organization Monolithic Kernels * All OS function resides in the kernel * Fast * difficult to maintain MicroKernels * The trusted OS software is as small as possible - only the essential OS functions * All other code is implemented in user space * Performance the major issue – many kernel calls required

The first king is very reclusive and sits in a small castle with high walls and a few top advisors. The king tells the advisors what to do and they go outside of the small (but well defended) castle and issue orders to the knights, merchants and common-folk. The king never leaves his castle and since only his most trusted advisors are allowed in the king is very safe from attack. However, because each advisor has to pass through several guard points it can sometimes take a little while before the king’s orders can go out or news can come in. The second king is much different. He doesn’t really live in a castle so much as it is a large mansion with beautiful grounds. Strongly defended walls encompass the entire city instead of just the castle. This makes the king and the populace very secure from outside attacks. And since this king is very friendly he goes throughout his city meeting and talking with all of his subjects. Any command he, or his many trusted aides, give are instantly obeyed. This makes his city very efficient. However, should any enemy agents manage to penetrate the outer walls, then they can quite easily assassinate the beloved king. In which case order breaks down and the entire city riots.

The Unix Kernel Trap Table Monolithic Kernel Module Process Mgt Memory Mgt File Mgt Device Mgt Driver Interface Device Driver OS System Call Interface LibrariesUtilitiesAppsShell