Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department.

Similar presentations


Presentation on theme: "Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department."— Presentation transcript:

1 Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department

2 Course  Title: Operating Systems  Code : CS 340 D  Prerequisites: CS 212 D  Credits: lecture 3 + 1 lab = 3 Dr. Abeer Mahmoud 2

3 Topics  This course will introduce you to the field of Operating Systems  Main topics which will be covered:  Introduction to Operating systems.  Processes  Threads  CPU Scheduling Process Dr. Abeer Mahmoud 3

4 Topics  Main topics which will be covered (cont..) :  Process Synchronization  Deadlocks  Memory Management  Virtual Memory  File-System Interface  File-System Implementation  I/O Systems  Mass-Storage Structure Dr. Abeer Mahmoud 4

5 Goals  By the end of the course the students should be able to: Explain the objectives and functions of the operating systems. Identify the notion of a process, and a program in execution. Describe the notion of a thread, CPU Scheduling and deadlocks Analyze and evaluate various Scheduling algorithms Explain the function of file systems. Discuss the benefits of various memory-management techniques, including paging and segmentation. Describe the benefits of a virtual memory system and the physical structure of secondary storage devices Dr. Abeer Mahmoud 5

6  Main Text Book: Books and references: “OPERATING SYSTEM CONCEPTS“, by Abraham Silberschatz and Wesley.- Edition, Addison 8 th Peter Galvin, “ OPERATING SYSTEMS: A DESIGN- ORIENTED APPROACH”, by Charles Crowley, The Latest Edition,McGraw-Hill, ISBN: 0256151512. “OPERATING SYSTEMS: DESIGN AND IMPLEMENTATION”, by Andrew S. Tanenbaum, Albert S. Woodhull, 2006. Dr. Abeer Mahmoud 6

7 Resources  Course Blog: http://www. Dr. Abeer Mahmoud 7

8 Marks Distribution - Marks distribution is not final and is subject to change. Percentage from overall grade Grade Assessment Week Assessment method (Write an essay - test - a collective project - a final test...) 15%15 7 th week1 st Med Term 15%15 12 th week2 nd Med Term 10%109 th week quiz 10% 10 week Assignments 2rd, 4 th, 6 th, 8 th and 10 th + Attendance (Lab) 10% 10exam 40 After 15 Final exam (Theory) “Two academic hours“. 100 Total Dr. Abeer Mahmoud 8

9 Course Policy  NO makeup quizzes.  NO midterm makeup exams unless: You must bring a medical excuses from a government hospital. + agree on the excuse from department + agree on the excuse from course coordinator Dr. Abeer Mahmoud 9

10 Course Policy (cont..)  Assignments must be completed individually unless specified otherwise.  If groups are permitted, each student should team up with students from the same tutorial section.  Cheating is forbidden. Both parties will be penalized in Minus. Dr. Abeer Mahmoud 10

11 Course Policy (cont..)  Email Communication: Anonymous emails will be ignored. When you send an email, you should use your PNU account and make sure to put “OS 340D " in the subject line and identify yourself with your group code and Student ID in the email message (body).  Late submissions of any course material is not allowed.  It is your responsibility to check the course’s website regularly for any assignments, announcements, etc.. Dr. Abeer Mahmoud 11

12 Thank you Enjoy the Course & never forget to smile Dr. Abeer Mahmoud 12

13 (Chapter-1) Introduction

14 Chapter 1 Introduction 1.What Operating Systems Do 2.Computer-System Organization 3.Computer-System Architecture 4.Operating-System Structure 5.Operating-System Operations 6.Process Management 7.Memory Management 8.Storage Management Dr. Abeer Mahmoud 14

15 OBJECTIVES :  To describe the basic organization of computer systems.  To provide a grand tour of the major components of operating systems.  To give an overview of the many types of computing environments. Dr. Abeer Mahmoud 15

16 What is an Operating System?  A program that acts as an intermediary between a user of a computer and the computer hardware  Operating system goals:  Execute user programs and make solving user problems easier  Use the computer hardware in an efficient manner Dr. Abeer Mahmoud 16

17 Computer System Structure  Consists of four components 1. Hardware : provides basic computing resources (CPU, memory, I/O devices) 2. Operating system: Controls and coordinates (use, hardware, applications) 3. Application programs : “ define the ways in which the system resources are used to solve the computing problems of the users” ex: (Word processors, compilers, web browsers, database systems, video games) 4. Users : People, machines, other computers Dr. Abeer Mahmoud 17

18 Four Components of a Computer System Dr. Abeer Mahmoud 18

19 The operating system’s Role 1- User View: 19 Dr. Abeer Mahmoud category exampleOS is designed to Single Userpersonal computerease of use Multiple User’smainframe l minicomputer maximize resource utilization Workstations usersconnected to networks or servers compromise between individual usability and resource utilization. Handheld computersSingle user & may connected to networks individual usability and performance per unit of battery life is important as well. Embedded computers If the computers have little or no user view run without user intervention (minimize usability)

20 The operating system’s Role (cont.) 2- System View: 20 Dr. Abeer Mahmoud OS is a resource allocatorOS is a control program Manages all resources (e.g. CPU time, memory space, file-storage space, I/O devices…etc) Decides between conflicting requests of many users access the same mainframe or minicomputer Controls execution of programs to prevent errors It is especially concerned with the operation and control of I/O devices.

21 Operating System Definition  Operating System Definition:  It is a software that manage the computer hardware and provide an environment for application programs to run  “The one program running at all times on the computer” is the kernel.  Everything else is either a  system program  application program Dr. Abeer Mahmoud 21

22 Computer-System Organization 1.Computer-System Operation 2.Storage Structure 3.I/O Structure 22 Dr. Abeer Mahmoud

23 Computer System Organization 1-Computer-system operation  A general-purpose computer system consists of three main components Dr. Abeer Mahmoud 23 3- RAM: connecting to CPU and device controllers through common bus 2- Multiple device controllers: connected through a common bus 1-One or more CPU

24 Dr. Abeer Mahmoud 24  Each device controller is responsible of a specific type of device (e.g. disk drives, audio devices, and video displays).  The CPU and the device controllers can execute concurrently, competing for memory cycles.  So, a memory controller is provided whose function is to synchronize access to the memory. Computer System Organization 1-Computer-system operation(cont..)

25 Computer Startup:  bootstrap program is loaded at power-up or reboot  Typically stored in ROM or EEPROM, generally known as firmware  Initializes all aspects of system  Loads operating system kernel and starts execution ROM : read-only memory,  Once data has been written onto a ROM chip, it cannot be removed and can only be read. EEPROM: electrically erasable programmable read-only memory. EEPROM is a special type of PROM that can be erased by exposing it to an electrical charge. EEPROM retains its contents even when the power is turned off. Dr. Abeer Mahmoud 25 Computer System Organization 1-Computer-system operation(cont..)

26 Interrupt:  It generated from either the hardware or the software  Hardware  sending a signal to the CPU through system bus.  Software  send through a system call. The interrupt is signal that gets the attention of the CPU and is usually generated when I/O is required. For example: hardware interrupts are generated when a key is pressed or when the mouse is moved. Software interrupts are generated by a program when I/O is required. Dr. Abeer Mahmoud 26 Computer System Organization 1-Computer-system operation(cont..)

27  Main memory – only large storage media that the CPU can access directly  Secondary storage – extension of main memory that provides large nonvolatile storage capacity  Magnetic disks – rigid metal or glass platters covered with magnetic recording material  Disk surface is logically divided into tracks, which are subdivided into sectors  The disk controller determines the logical interaction between the device and the computer Dr. Abeer Mahmoud 27 Computer System Organization 2-Storage Structure

28  All forms of memory provide an array of words. Each word has its own address.  Interaction is achieved through a sequence of load or store instructions to specific memory addresses.  The load instruction>>> moves a word from RAM to CPU’s register  The store instruction>>> moves the content of a CPU’s register to RAM  CPU automatically loads instructions from main memory for execution. Dr. Abeer Mahmoud 28 Computer System Organization 2-Storage Structure(cont..)

29 More expensive and faster volatile Non- volatile can be volatile or non volatile Dr. Abeer Mahmoud 29 Computer System Organization 2-Storage Structure (cont..)

30  A large portion of OS code is dedicated to managing I/O, because of:  Its importance to the reliability and performance of a system  The varying nature of the devices. Dr. Abeer Mahmoud 30 Computer System Organization 3-I/O Structure

31  A device controller maintains some local buffer storage and a set of special-purpose registers.  The device controller is responsible for moving the data between the peripheral devices that it controls and its local buffer storage.  Operating systems have a device driver for each device controller. This device driver understands the device controller Dr. Abeer Mahmoud 31 Computer System Organization 3-I/O Structure(cont..)

32 Dr. Abeer Mahmoud 32 Device Controller (DC) Set of special purpose registers + Local buffer storage DC : Responsible for moving data between Peripherals devices that it controls eg: keyboard Device Driver (DD) OS Understand how? Computer System Organization 3-I/O Structure(cont..)

33  (Algorithm #1)  DD loads the appropriate registers within the DC  DC, examines the contents of these registers to determine what action to take (such as “read “a character from the keyboard”).  DC transfers data from the device to its local buffer. When finish informs DD via an interrupt  DD returns control to OS,  This form of interrupt-driven I/O is fine for moving small amounts of data otherwise produce high overhead Dr. Abeer Mahmoud 33 Computer System Organization 3-I/O Structure(cont..)

34 Dr. Abeer Mahmoud 34 Computer System Organization 3-I/O Structure(cont..)  (Algorithm #2 moving large data without overhead)  What is direct memory access (DMA) ?  After setting up buffers, pointers, and counters for the I/O device,  DC transfers an entire block of data directly to or from its own buffer storage to memory, with no intervention by the CPU.  Only one interrupt is generated per block, to tell the device driver that the operation has completed, rather than the one interrupt per byte generated for low-speed devices.  While the device controller is performing these operations, the CPU is available to accomplish other work.

35 Computer-System Architecture  Single-processor systems : one CPU Dr. Abeer Mahmoud 35  MULTIPROCESSOR SYSTEMS  Also known as parallel systems, tightly-coupled systems  have two or more processors in close communication, sharing the computer bus and some times the clock, memory, and peripheral devices.  Advantages include: 1. Increased throughput : more work is performed 2. Economy of scale : cost less 3. Increased reliability : the failure of one processor will not halt the system, only slow it down.

36  MULTIPROCESSOR SYSTEMS – (CONT.):  Two types 1. Asymmetric Multiprocessing  Each processor is assigned a specific task.  master-slave relationship  A master processor controls the system; It schedules and allocates work to the slave processors. 2. Symmetric Multiprocessing (SMP)  Each processor performs all tasks within the operating system.  All CPUs are peers  Each processor has its own set of registers & cache  All processors share physical memory. Dr. Abeer Mahmoud 36 Computer-System Architecture (cont..)

37 Symmetric Multiprocessing Architecture Dr. Abeer Mahmoud 37

38  SMP pros (++):  many processes can run simultaneously —N processes can run if there are N CPUs—without causing a significant deterioration of performance n SMP Cons (--):  OS must carefully control I/O to ensure that the data reach the appropriate processor.  since the CPUs are separate, one may be sitting idle while another is overloaded, resulting in inefficiencies.  All modern operating systems—including Windows, Mac OS X, and Linux—now provide support for SMP. Dr. Abeer Mahmoud 38 Computer-System Architecture (cont..)

39  Multi-cores chips.  It is a recent trend in CPU design is to include multiple computing cores on a single chip.  Processors were originally developed with only one core.  The core is the part of the processor that actually performs the reading and executing of the instruction.  Single-core processors can only process one instruction at a time  Multi-cores chips can be more efficient than multiple chips with single cores because:  on-chip communication is faster than between-chip communication  one chip with multiple cores uses significantly less power than multiple single- core chips. Dr. Abeer Mahmoud 39 Computer-System Architecture (cont..)

40 A Dual-Core Design l Dual-core processor contains two cores (Such as Intel Core Duo). l Multi-core systems are especially well suited for server systems such as database and Web servers. Dr. Abeer Mahmoud 40

41 Operating System Structure 1- Multiprogramming environment:  Single program cannot keep CPU and I/O devices busy at all times  Multiprogramming increases CPU utilization by organizing jobs (code and data) so that the CPU always has one to execute.  Multiprogramming idea is as follows:  The operating system keeps several jobs in memory simultaneously.  One job selected and run via job scheduling.  When it has to wait (for I/O for example), OS switches to another job  Eventually, the first job finishes waiting and gets the CPU back.  As long as at least one job needs to execute, the CPU is never idle.  RAM is too small to accommodate all jobs, the jobs are kept initially on the disk in the job pool.  This pool consists of all processes residing on disk awaiting allocation of main memory. Dr. Abeer Mahmoud 41

42 Memory Layout for Multiprogrammed System Dr. Abeer Mahmoud 42

43 Operating System Structure( cont..) 2-Time sharing (or multitasking) system:  It is a logical extension of multiprogramming.  In time-sharing systems, the CPU executes multiple jobs by switching among them, but the switches occur so frequently that the users can interact with each program while it is running.  Time sharing requires an interactive computer system  The response time should be short ( less than one second) system that provides direct communication between the user and the system. amount of time it takes from when a request was submitted until the first response is produced. Dr. Abeer Mahmoud 43

44  A time-shared operating system allows many users to share the computer simultaneously. each user is given the impression that the entire computer system is dedicated to his use.  Each user has at least one separate program in memory.  A process : is a program loaded into memory and executing Dr. Abeer Mahmoud 44 Operating System Structure( cont..)

45 Thank you End of Chapter 1 Dr. Abeer Mahmoud 45


Download ppt "Operating Systems (CS 340 D) Dr. Abeer Mahmoud Princess Nora University Faculty of Computer & Information Systems Computer science Department."

Similar presentations


Ads by Google