Main Points of the Computer Organization and System Software Module

Similar documents
CSI3131 Final Exam Review

CSc33200: Operating Systems, CS-CCNY, Fall 2003 Jinzhong Niu December 10, Review

QUESTION BANK UNIT I

COMP 3361: Operating Systems 1 Final Exam Winter 2009

CHAPTER NO - 1 : Introduction:

Techno India Batanagar Department of Computer Science & Engineering. Model Questions. Multiple Choice Questions:

CPU Structure and Function

MARUTHI SCHOOL OF BANKING (MSB)

Course Description: This course includes the basic concepts of operating system

Department of Computer applications. [Part I: Medium Answer Type Questions]

MC7204 OPERATING SYSTEMS

Chapter 2 Processes and Threads

Processes The Process Model. Chapter 2. Processes and Threads. Process Termination. Process Creation

INSTITUTE OF AERONAUTICAL ENGINEERING Dundigal, Hyderabad COMPUTER SCIENCE AND ENGINEERING QUESTION BANK OPERATING SYSTEMS

Midterm Exam. October 20th, Thursday NSC

CSE 4/521 Introduction to Operating Systems. Lecture 27 (Final Exam Review) Summer 2018

INSTITUTE OF AERONAUTICAL ENGINEERING (Autonomous) Dundigal, Hyderabad

Processes The Process Model. Chapter 2 Processes and Threads. Process Termination. Process States (1) Process Hierarchies

CSC Operating Systems Spring Lecture - XII Midterm Review. Tevfik Ko!ar. Louisiana State University. March 4 th, 2008.

Subject: Operating System (BTCOC403) Class: S.Y.B.Tech. (Computer Engineering)

Processes Prof. James L. Frankel Harvard University. Version of 6:16 PM 10-Feb-2017 Copyright 2017, 2015 James L. Frankel. All rights reserved.

CSE 421/521 - Operating Systems Fall Lecture - XXV. Final Review. University at Buffalo

INSTITUTE OF AERONAUTICAL ENGINEERING

Final Exam Preparation Questions


I/O Management and Disk Scheduling. Chapter 11

CS 571 Operating Systems. Midterm Review. Angelos Stavrou, George Mason University

To Everyone... iii To Educators... v To Students... vi Acknowledgments... vii Final Words... ix References... x. 1 ADialogueontheBook 1

CSE 120 PRACTICE FINAL EXAM, WINTER 2013

CPU Structure and Function

CLASS: II YEAR / IV SEMESTER CSE SUBJECT CODE AND NAME: CS6401 OPERATING SYSTEMS UNIT I OPERATING SYSTEMS OVERVIEW

Chapter 2 Processes and Threads. Interprocess Communication Race Conditions

UNIT:2. Process Management

William Stallings Computer Organization and Architecture

UNIT- 5. Chapter 12 Processor Structure and Function

CS450/550 Operating Systems

CSE 153 Design of Operating Systems

CS450/550 Operating Systems

Chendu College of Engineering & Technology

I/O Systems and Storage Devices

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING UNIT I

(b) External fragmentation can happen in a virtual memory paging system.

Exam Guide COMPSCI 386

CS370 Operating Systems Midterm Review

Lecture 9: Midterm Review

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

( D ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Semaphore (C) Monitor (D) Shared memory

Chapter-6. SUBJECT:- Operating System TOPICS:- I/O Management. Created by : - Sanjay Patel

2 nd Half. Memory management Disk management Network and Security Virtual machine

PROCESSES & THREADS. Charles Abzug, Ph.D. Department of Computer Science James Madison University Harrisonburg, VA Charles Abzug

Threads. Threads The Thread Model (1) CSCE 351: Operating System Kernels Witawas Srisa-an Chapter 4-5

Operating Systems 2010/2011

Maximum CPU utilization obtained with multiprogramming. CPU I/O Burst Cycle Process execution consists of a cycle of CPU execution and I/O wait

Operating System(16MCA24)

AC59/AT59/AC110/AT110 OPERATING SYSTEMS & SYSTEMS SOFTWARE DEC 2015

Review. Preview. Three Level Scheduler. Scheduler. Process behavior. Effective CPU Scheduler is essential. Process Scheduling

I/O Device Controllers. I/O Systems. I/O Ports & Memory-Mapped I/O. Direct Memory Access (DMA) Operating Systems 10/20/2010. CSC 256/456 Fall

ECE 3055: Final Exam

GLOSSARY. access method The method that is used to find a file, a record, or a set of records. address space The range of addresses available

Operating Systems Comprehensive Exam. Spring Student ID # 3/20/2013

KINGS COLLEGE OF ENGINEERING DEPARTMENT OF INFORMATION TECHNOLOGY QUESTION BANK

CS3733: Operating Systems

Operating Systems Comprehensive Exam. Spring Student ID # 3/16/2006

ASSEMBLY LANGUAGE MACHINE ORGANIZATION

Processing Unit CS206T

PESIT SOUTHCAMPUS. Question Bank

ROEVER ENGINEERING COLLEGE, PERAMBALUR DEPARTMENT OF INFORMATION TECHNOLOGY OPERATING SYSTEMS QUESTION BANK UNIT-I

Chapter 5: CPU Scheduling

Last Class: Synchronization Problems. Need to hold multiple resources to perform task. CS377: Operating Systems. Real-world Examples

Preview. Process Scheduler. Process Scheduling Algorithms for Batch System. Process Scheduling Algorithms for Interactive System

Dr. Rafiq Zakaria Campus. Maulana Azad College of Arts, Science & Commerce, Aurangabad. Department of Computer Science. Academic Year

CS 153 Design of Operating Systems Winter 2016

Major Requirements of an OS

OPERATING SYSTEMS. Sharafat Ibn Mollah Mosharraf TOUCH-N-PASS EXAM CRAM GUIDE SERIES. Students. Special Edition for CSEDU

Computing Science 300 Sample Final Examination

CS350: Final Exam Review

SYED AMMAL ENGINEERING COLLEGE CS6401- OPERATING SYSTEM

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

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

B. the address of the data is supplied by the users C. there is no need for an address i.e. the data is used as an address

Following are a few basic questions that cover the essentials of OS:

( B ) 4. Which is not able to solve the race condition? (A) Test and Set Lock (B) Shared memory (C) Semaphore (D) Monitor

Chapter 14 - Processor Structure and Function

Sample Questions. Amir H. Payberah. Amirkabir University of Technology (Tehran Polytechnic)

SNS COLLEGE OF ENGINEERING

CHAPTER 2: PROCESS MANAGEMENT

Student Name:.. Student ID... Course Code: CSC 227 Course Title: Semester: Fall Exercises Cover Sheet:

Operating Systems: Quiz2 December 15, Class: No. Name:

Virtual File System -Uniform interface for the OS to see different file systems.

Department of Information Technology Operating Systems Question Bank YEAR/SEM:III/V

CIS 21 Final Study Guide. Final covers ch. 1-20, except for 17. Need to know:

Silver Oak Engineering College and technology Information Technology Department

CMPS 111 Spring 2003 Midterm Exam May 8, Name: ID:

Computer System Overview

CSE 120. Fall Lecture 8: Scheduling and Deadlock. Keith Marzullo

Fall COMP3511 Review

Operating System Review Part

Operating Systems (Classroom Practice Booklet Solutions)

The control of I/O devices is a major concern for OS designers

Unit 3 : Process Management

Transcription:

Main Points of the Computer Organization and System Software Module You can find below the topics we have covered during the COSS module. Reading the relevant parts of the textbooks is essential for a good exam result. Revising the exercises and solving exam questions from previous years, see http://www.dcs.bbk.ac.uk/~szabolcs/compsys.html are highly recommended as part of the preparation for the exam. 1

Instruction Sets Machine instruction characteristics: Computer Architecture Elements: operation code, source and result operand references, next instruction reference (often implicit); location of operands: memory, register, I/O device Representation: binary, symbolic (e.g. ADD) Instruction types: data processing (arithmetic and logical), movement (I/O) and storage (memory), program flow control (test and branch) Number of addresses: typically between three and zero; implicit addressing (use of accumulator) Instruction set design: operation repertoire, data types, instruction format (length, no. of addresses), registers (which can be referenced by instructions), addressing modes Types of operands: addresses: immediate, direct, indirect, displacement, stack; numbers: integer or fixed point, floating point, decimal; characters; logical data Types of operations: data transfer: move, store, load, set, push, pop arithmetic: add, subtract, multiply, divide logical: and, not, test, shift, rotate I/O: read, write system control: read or alter control register kernel mode transfer of control: branch, return, skip; procedure call use of stack Assembly language: CPU Structure and Function Processor organization: registers, ALU unit, control unit Interconnection structures: bus; control, address and data lines Register organization: user-visible registers: general purpose, data, address (segment pointers, stack pointer), condition codes/flags (positive, negative, zero, equal) 2

control and status registers: program counter PC, instruction register IR, memory registers MAR and MBR, program status word PSW (flags, interrupts enabled, kernel mode) Instruction cycle: instruction and data fetch and decode, execute, interrupt; indirect cycle for address calculation; data flow involving registers and bus lines Instruction pipelining: overlapping the stages of instruction cycles; prefetching instructions timing diagrams, the effect of dependencies and conditional branching; six-stage pipeline (FI, DI, CO, FO, EI, WO); increased complexity of control logic dealing with branches: loop buffer (high speed memory containing last few instructions), branch prediction (by opcode, dynamically by logging history) Overview of Pentium: register organization, interrupt processing Reduced Instruction Set Computers Instruction execution characteristics: operations (lot of assignments, time-consuming procedure calls), operands (mainly numeric variables) RISC characteristics: register-to-register operations simple addressing modes simple instruction formats (single size) small set of instructions Use of registers: register windows: parameter, local and temporary registers, circular organization with overlaps, pointers keep track of active procedures compiler based optimization: allocation of physical registers to logical registers, graph coloring according to the active use of registers RISC pipelining: re-ordering independent instructions Overview of SPARC 3

Instruction-Level Parallelism and Superscalar Processors Independent and concurrent execution of instructions in different pipelines Dependencies: true data (write-read), procedural, output (write-write) and antidependencies (read-write), resource conflicts Design issues: instruction-level and machine parallelisms instruction issue policies (in-order/out-of-order issue, in-order/out-of-order completion) register renaming to remove output and antidependencies branch prediction superscalar execution: instruction fetch and branch prediction, re-ordering instructions according to dependencies, execution, committing/retiring instructions (re-order according to program logic); speedup (importance of register renaming) Overview of Pentium 4 4

Processes and Threads Processes Operating Systems Definition: program in execution; usage: multiprogramming, pseudo-parallelism; creation; termination; system calls in UNIX and Windows States: running, blocked, ready; possible transitions between states; process switch; modes: kernel and user modes, mode switch Implementation: process table, process control block Threads (aka Lightweight Processes) Refined process model: resource grouping + thread of execution Multithreading: multiple execution in the same process (memory) environment for co-operation by sharing resources Modelling threads: multiple threads inside one process; per process data (address space, open files, global variables, etc.) and per thread data (program counter, registers, stack, state, etc.) Advantages of multithreading: pseudo-parallelism with shared address space and data, less overhead with switching than with processes, better performance for I/Obound applications Examples: 1) word processor with interactive and background threads, 2) multithreaded web server with dispatcher and worker threads Implementations (and their relative advantages): in user space (+: fast context switches, process-specific scheduling algorithms; -: problems with blocking system calls) in kernel (+: easier semantics for blocking system calls; -: costly context switches) Microkernels 5

Scheduling When to schedule: process creation and termination, blocking system calls, interrupts Goals: general (fairness, policy enforcement, balance) batch systems (throughput, turnaround time) interactive systems (response time) real-time systems (meeting deadlines) Preemptive and non-preemptive algorithms Scheduling in batch systems: first-come-first-served (FCFS), shortest-job-first (SJF), shortest-remaining-time-next (SRTN) Scheduling in interactive systems: round-robin scheduling, priority scheduling (multiple queues), shortest-process-next (aging, weighted average), Comparison of the different scheduling algorithms with respect to the scheduling goals; policy versus mechanism Thread scheduling: user space and kernel threads Scheduling in UNIX and in Windows Concurrency Interprocess Communication Race condition between concurrent cooperating processes or threads that share data, examples (spooling directory), consequences Critical-section problem; solution should satisfy 1. mutual exclusion, 2. no assumption on speed of processes, 6

3. progress (no deadlock), 4. bounded waiting (no starvation) Solutions for two processes using busy waiting software: Peterson s solution help from hardware: test-and-set lock (TSL), exchange (swap) Semaphores: definition: integer variable with up and down (or signal and wait) operations, sleep and wake up, queues usage: eliminates busy waiting, but possible starvation and deadlock Monitors (with condition variables) Solutions for classical synchronization problems avoiding busy waiting bounded-buffer (producer consumer) readers writers dining philosophers Interprocess communication (IPC) via message passing as an alternative to shared memory Deadlock Definition: a set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set can cause Examples; usually deadlock may occur when processes are granted exclusive access to resources (hardware or software) Characterization; the four necessary conditions for deadlock to occur: 1. mutual exclusion 2. hold and wait 3. no preemption 4. circular wait Modelling deadlocks one resource of each type: resource allocation graph using process and resource nodes and arrows for indicating requests and allocations 7

multiple resources of each type: allocation and request matrices Methods for handling deadlocks prevention: deny one of the four conditions above mutual exclusion spooling hold and wait request all required resources initially no preemption take resources away circular wait linearly order resources detection and recovery: detect deadlocks and take recovery action (rollback or kill) single instances of resource types: check for cycles in the resource allocation graph multiple instances of resource types: try to satisfy the needs of at least one process avoidance: make sure that the machine reaches only safe states, i.e., that it is guaranteed that there is some scheduling order in which every process can run to completion even if they request their maximum number of resources immediately single instance of resource type: detecting cycles in the resource allocation graph multiple instances of resource type: Banker s algorithm Memory Management Main goal: to allocate (main) memory to processes in an efficient and safe way Cache: elements of design (size, write policy, replacement algorithm) MM without virtual memory: multiprogramming with fixed partitions, swapping; memory allocation algorithms Virtual memory: provides large logical (virtual) address space for programmers only those parts of the program are in main memory that are currently used by a process mapping between logical and physical addresses paging and segmentation Paging: 8

page tables (single- and multilevel), translation lookaside buffers (TLB), inverted page tables page fault handling page replacement algorithms: optimal, not recently used (NRU), FIFO, clock, least recently used (LRU) working set and locality of reference, thrashing design issues: local vs. global allocation, load control, page size, cleaning policy paging in UNIX and Windows Segmentation: two dimensional address space virtual memory is divided into logical units (segments); supports protection and sharing Segmentation with paging I/O System Devices: block and character; communication between device and machine: bus, controller; direct memory access (DMA); Interrupts Principles of I/O software goals: device independence, uniform naming, error handling, buffering programmed I/O: polling, busy waiting interrupt-driven I/O: context switches, interrupts DMA (programmed I/O via the DMA, interrupt on completion) I/O software layers Disks interrupt handlers device drivers: their tasks, uniform interface device-independent I/O software: buffering user-space I/O software: spooling life cycle of an I/O request hardware: cylinders, tracks, sectors efficiency and reliability using RAID schemas: strips, mirroring, block interleaved parity disk scheduling: FCFS, SSF, Elevator algorithm; their performance with respect to access time (seek time + rotational latency) and fairness disk cache 9

File Systems File: contiguous logical address space, attributes (name, size, type, etc.), operations (open, delete, read, write, etc.) Access methods: sequential or random (direct) Directory: hierarchical system for organizing files; tree structure or general directed graph structure, relative and absolute path names, operations (create, delete, open, close, etc.), symbolic and hard links Implementation simplicity, fast and flexible access, efficient use of space contiguous allocation linked list and file allocation table (FAT) i-nodes Directory entry Disk space management: block size, free list Example file systems MS-DOS using FAT UNIX using i-nodes Windows 2000 using master file table (MFT) 10