May 21, 2002Serguei A. Mokhov, 1 Some Theory Review COMP346/5461 - Operating Systems Revision 1.2 September 30, 2003.

Slides:



Advertisements
Similar presentations
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Advertisements

So far Binary numbers Logic gates Digital circuits process data using gates – Half and full adder Data storage – Electronic memory – Magnetic memory –
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities (e.g. updating shared data) 3. Proper sequencing in case of.
I/O and Networking Fred Kuhns
COMP1214 Systems & Platforms: Operating Systems Concepts Dr. Yvonne Howard – Rikki Prince – 1.
CSC 360- Instructor: K. Wu Overview of Operating Systems.
3.1 Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition Process An operating system executes a variety of programs: Batch system.
Processes Management.
More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
May 23, 2002Serguei A. Mokhov, 1 Synchronization COMP346/ Operating Systems Tutorial 3 Revision 1.2 October 7, 2003.
WHAT IS AN OPERATING SYSTEM? An interface between users and hardware - an environment "architecture ” Allows convenient usage; hides the tedious stuff.
Review: Chapters 1 – Chapter 1: OS is a layer between user and hardware to make life easier for user and use hardware efficiently Control program.
Process Description and Control
1 School of Computing Science Simon Fraser University CMPT 300: Operating Systems I Dr. Mohamed Hefeeda.
5.6 Semaphores Semaphores –Software construct that can be used to enforce mutual exclusion –Contains a protected variable Can be accessed only via wait.
Operating System Support Focus on Architecture
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1: Operating Systems Overview
OPERATING SYSTEM OVERVIEW
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Home: Phones OFF Please Unix Kernel Parminder Singh Kang Home:
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.
Race Conditions CS550 Operating Systems. Review So far, we have discussed Processes and Threads and talked about multithreading and MPI processes by example.
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.
I/O Tanenbaum, ch. 5 p. 329 – 427 Silberschatz, ch. 13 p
Chapter 8 Windows Outline Programming Windows 2000 System structure Processes and threads in Windows 2000 Memory management The Windows 2000 file.
System Calls 1.
3/11/2002CSE Input/Output Input/Output Control Datapath Memory Processor Input Output Memory Input Output Network Control Datapath Processor.
CS 153 Design of Operating Systems Spring 2015 Midterm Review.
LOGO OPERATING SYSTEM Dalia AL-Dabbagh
Operating System Review September 10, 2012Introduction to Computer Security ©2004 Matt Bishop Slide #1-1.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
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,
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
1 CSE451 Architectural Supports for Operating Systems Autumn 2002 Gary Kimura Lecture #2 October 2, 2002.
1: Operating Systems Overview 1 Jerry Breecher Fall, 2004 CLARK UNIVERSITY CS215 OPERATING SYSTEMS OVERVIEW.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
1 Computer Systems II Introduction to Processes. 2 First Two Major Computer System Evolution Steps Led to the idea of multiprogramming (multiple concurrent.
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
CS399 New Beginnings Jonathan Walpole. 2 Concurrent Programming & Synchronization Primitives.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
June 6, 2002Serguei A. Mokhov, 1 Salsa Theory Debrief 2 COMP346 - Operating Systems Tutorial 6 Edition 1.1, June 19, 2002.
CE Operating Systems Lecture 2 Low level hardware support for operating systems.
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.
CSE 153 Design of Operating Systems Winter 2015 Midterm Review.
What is an Operating System? Various systems and their pros and cons –E.g. multi-tasking vs. Batch OS definitions –Resource allocator –Control program.
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.
Lecture 6 Page 1 CS 111 Summer 2013 Concurrency Solutions and Deadlock CS 111 Operating Systems Peter Reiher.
Introduction Contain two or more CPU share common memory and peripherals. Provide greater system throughput. Multiple processor executing simultaneous.
I/O Software CS 537 – Introduction to Operating Systems.
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.
Copyright © Curt Hill More on Operating Systems Continuation of Introduction.
Embedded Real-Time Systems Processing interrupts Lecturer Department University.
CSCI/CMPE 4334 Operating Systems Review: Exam 1 1.
June 20, 2002Serguei A. Mokhov, 1 Drivers, Interrupts, and Trap Explained COMP346/ Operating Systems Tutorial 3.5 Revision.
Tutorial 2: Homework 1 and Project 1
CS 143A Quiz 1 Solution.
CS703 - Advanced Operating Systems
Midterm review: closed book multiple choice chapters 1 to 9
Process Description and Control
CSE 451: Operating Systems Autumn 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 596 Allen Center 1.
CSE 451: Operating Systems Autumn 2001 Lecture 2 Architectural Support for Operating Systems Brian Bershad 310 Sieg Hall 1.
February 5, 2004 Adrienne Noble
CSE 451: Operating Systems Winter 2003 Lecture 2 Architectural Support for Operating Systems Hank Levy 412 Sieg Hall 1.
CS333 Intro to Operating Systems
CSE 153 Design of Operating Systems Winter 2019
CSE 153 Design of Operating Systems Winter 2019
Presentation transcript:

May 21, 2002Serguei A. Mokhov, 1 Some Theory Review COMP346/ Operating Systems Revision 1.2 September 30, 2003

May 21, 2002Serguei A. Mokhov, 2 Topics OS –Need –Multiprogramming vs. Uniprogramming I/O –Interrupts vs. Polling –DMA Programs, Processes and Threads Revisited Synchronous vs. Asynchronous –Message Passing –Trap and Interrupts Common Problems in Multiprogramming –Synchronization –Deadlock –Mutual exclusion, critical sections… –Security

May 21, 2002Serguei A. Mokhov, 3 OS: The Need A typical example: –You have a responsibility of designing a dedicated system to control something (water pumps, conveyor production, etc). –Dedicated implies a single user and a single process dedicated process. Discussion: –Would you still include an OS into the design of such a system? (key things: security and abstraction)

May 21, 2002Serguei A. Mokhov, 4 OS: Multiprogramming vs. Uniprogramming A typical problem: –There a need to have a system where throughput (number of jobs completed within a given time) is the most important factor. –Experiments show, however, that the context switch time is a lot more than a typical execution time of an average process in the mm-OS. Discussion: –Again, as a system designer, would you go with multiprogramming or uniprogramming?

May 21, 2002Serguei A. Mokhov, 5 I/O: Interrupts vs. Polling (1) Polling (sync. I/O): CPU routinely checks devices status via controller: –CPU: Dear device driver (DD), is the device done? –DD: Nope –CPU: Dear device driver (DD), is the device done? –DD: Nope, not yet –CPU: Dear device driver (DD), is the device finally done???? Im kinda wasting my time waiting here! –DD: Patience, it almost done. A couple more cycles…

May 21, 2002Serguei A. Mokhov, 6 I/O: Interrupts vs. Polling (2) Interrupts (asynchronous I/O): CPU: Dear device driver, say the device to do this and that, OK? DD: Sure. [To device]: CPU wants you to do this and that. Let us know when youre done, k? Device: No prob. [starts doing I/O] CPU: [to itself]: oh, I have so much to do! [goes and does smth else] Device: [busy doing I/O an finally finishes]: Hey CPU! CPU: [suddenly interrupted by the Device] What is it? Device: Im done with I/O. I though you might want to know…

May 21, 2002Serguei A. Mokhov, 7 I/O: No DMA Usually its the CPU who does the transfer of the data from a device to the memory and back: –CPU: Hey DD! I need some data for that process. Could you arrange some? –DD: Yep. [To HDD]: Hey HDD,CPU needs some data for that process, do you have it? –HDD: Heres some –DD: Oh cool, CPU, heres some data! –CPU: [gets the data, and places it to the memory and continues with the process] –HDD: Heres some more, I forgot since last time –DD: OK –CPU: What, again data? OK… [takes it from DD and places to the memory of the process]

May 21, 2002Serguei A. Mokhov, 8 I/O: DMA CPU is more free from useless work when it has a friendly DMA (Direct Memory Access) controller: –CPU: DD, I need that data for that process from HDD. It should be between 0x46F46F and 0x46FFFF about this big. [goes and does smth else] –DD: Hey DMA! Wake up, you heard what CPU said… –DMA: Yep. [Contacts HDD, grabs specified block of data, and puts it to the specified place]: CPU: Me done!

May 21, 2002Serguei A. Mokhov, 9 Programs, Processes, and Threads Once again, what are a program, a process and a thread? Which one static, dynamic? What does a process have (consist of)? How threads are different from processes? –What do they consist of?

May 21, 2002Serguei A. Mokhov, 10 Synchronous vs. Asynchronous Message Passing –A typical async example is . The sender doesnt wait for the recipient to get it. –A sync example is a bounded buffer. Sync is needed, so that the sender waits for the receiver to get the message or a part of it before proceeding to the next part. –Side question: why would be advisable to have processes mailboxes for message passing in the kernel space? Problems (hint: size and data loss)? Solutions?

May 21, 2002Serguei A. Mokhov, 11 Synchronous vs. Asynchronous (2) Interrupts –System Call Interface – switch between user and kernel mode – a syscall executes trap – a sync interrupt (which is processed in the kernel as ordinary interrupt) –From devices – async. Why?

May 21, 2002Serguei A. Mokhov, 12 Interrupts and Trap Revisited Neither interrupt nor trap are function calls! Interrupt is an event, or a signal (do not confuse with UNIX signals), notifying the system that something happened. Interrupts are not necessarily used to switch between processes (in scheduling), but cause a context switch. Trap is a software interrupt, it's synchronous, whereas an ordinary interrupt is asynchronous. Trap is a CPU instruction, which is invoked when a user program wants either some service from an OS (system call) or causes an error (division by zero, segmentation fault, page fault, etc.).

May 21, 2002Serguei A. Mokhov, 13 The Big Picture User-running Kernel-running BlockedReady Zombie exit() syscall() - trap wait() SW HW App User mode Kernel mode System Call Interface Bus CPU: add mult mov trap PTRDDHDDDCDDD Common Interface: open, close, read, write MM PM DMA CtlMon CtlPtr CtlCD Ctl int (IRQ) int Ready queue kernel

May 21, 2002Serguei A. Mokhov, 14 Common Problems in Multiprogramming Synchronization (act of communication). Mutual exclusion and critical sections (only one process at a time executing a given section of a code, usually operating on a shared resource). Deadlock (two or more processes waiting for each other on some resources). Context switch overhead. Security (processes must not interfere with other processes, and unauthorized users shouldnt be able to interfere with other users). All the above make the system much harder to implement. Why is multiprogramming is usually still better? (hint: CPU utilization)

May 21, 2002Serguei A. Mokhov, 15 Basic Security Security != Protection OS Protection is needed between: –Processes of one user from others in multiuser environment. –Processes of the same user (isolation). –OS and the users (various resource managers and device drivers vs. application software) –Various components of the OS itself.

May 21, 2002Serguei A. Mokhov, 16 Basic Security (2) OS on the network: The system has to provide CIA N : –Confidentiality –Integrity –Availability –Authentication –Authorization –Access Control Hence, the compilation of the protocols.

May 21, 2002Serguei A. Mokhov, 17 Basic Security (3) Binary privilege model is NOT enough: –Binary in a sense: GOD vs. LAMER –I.e. root (or superuser or monitor) vs. user Exploiting various system vulnerabilities a user can become god. –E.g. buffer overflows in trusted / privileged (falsely) software. –Other bugs. Thus, sandboxing such programs and filtering system calls and having more fine-grained roles and ACLs and permissions.

May 21, 2002Serguei A. Mokhov, 18 Next Tutorial Synchronization Semaphores Your questions, as usual