Presentation is loading. Please wait.

Presentation is loading. Please wait.

Operating Systems (CS 340 D)

Similar presentations


Presentation on theme: "Operating Systems (CS 340 D)"— Presentation transcript:

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

2 (Chapter-1) Introduction

3 Chapter 1 Introduction What Operating Systems Do
Computer-System Organization Computer-System Architecture Operating-System Structure Dr. Abeer Mahmoud

4 To describe the basic organization of computer systems.
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

5 What is an Operating System?
Dr. Abeer Mahmoud

6 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

7 Operating System Functions
Process Management Memory Management File Management Device Management Command Interpretation Security Dr. Abeer Mahmoud

8 Computer System Structure
Consists of four components Hardware : provides basic computing resources (CPU, memory, I/O devices) Operating system: Controls and coordinates (use, hardware, applications) 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) Users : People, machines, other computers Dr. Abeer Mahmoud

9 Four Components of a Computer System
Dr. Abeer Mahmoud

10 The operating system’s Role
1- User View: category example OS is designed to Single User personal computer ease of use Multiple User’s mainframe l minicomputer maximize resource utilization Workstations users connected to networks or servers compromise between individual usability and resource utilization. Handheld computers Single 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) Dr. Abeer Mahmoud

11 The operating system’s Role (cont.)
2- System View: OS is a resource allocator OS 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. Dr. Abeer Mahmoud

12 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

13 Computer-System Organization
Dr. Abeer Mahmoud

14 Computer-System Organization
Computer-System Operation Storage Structure I/O Structure Dr. Abeer Mahmoud

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

16 Computer System Organization 1-Computer-system operation(cont..)
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. Dr. Abeer Mahmoud

17 Computer System Organization 1-Computer-system operation(cont..)
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. Dr. Abeer Mahmoud

18 Computer System Organization 1-Computer-system operation(cont..)
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

19 Operating-System Operations
Interrupt driven by hardware Software error or request creates exception or trap Division by zero, request for operating system service Other process problems include infinite loop, processes modifying each other or the operating system Dual-mode operation allows OS to protect itself and other system components User mode and kernel mode Mode bit provided by hardware Provides ability to distinguish when system is running user code or kernel code Some instructions designated as privileged, only executable in kernel mode System call changes mode to kernel, return from call resets it to user

20 Transition from User to Kernel Mode

21 Computer System Organization 2-Storage Structure
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

22 Computer System Organization 2-Storage Structure(cont..)
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

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

24 Computer System Organization 3-I/O Structure
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

25 Computer System Organization 3-I/O Structure(cont..)
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

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

27 Computer System Organization 3-I/O Structure(cont..)
(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

28 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. Dr. Abeer Mahmoud

29 Computer-System Architecture
Dr. Abeer Mahmoud

30 Computer-System Architecture
Single-processor systems : one CPU 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: Increased throughput : more work is performed Economy of scale : cost less Increased reliability : the failure of one processor will not halt the system, only slow it down. Dr. Abeer Mahmoud

31 Computer-System Architecture (cont..)
MULTIPROCESSOR SYSTEMS – (CONT.): Asymmetric Multiprocessing Symmetric Multiprocessing (SMP) 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. Each processor performs all tasks within the operating system. (peer =equal rank) Each processor has its own set of registers & cache All processors share physical memory. Dr. Abeer Mahmoud

32 Symmetric Multiprocessing Architecture
Dr. Abeer Mahmoud

33 Computer-System Architecture (cont..)
SMP pros (++): many processes can run simultaneously —N processes can run if there are N CPUs— 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

34 Computer-System Architecture (cont..)
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 process only one instruction at a time Multi-cores chips. It is a recent trend in CPU design is to include multiple computing cores on a single chip. Dr. Abeer Mahmoud

35 A Dual-Core Design 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. Dual-core processor contains two cores (Such as Intel Core Duo). Multi-core systems are especially suited for server systems such as database and Web servers. Dr. Abeer Mahmoud

36 Operating System Structure
Dr. Abeer Mahmoud

37 Operating System Structure
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. Dr. Abeer Mahmoud

38 Operating System Structure
Multiprogramming environment 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. Dr. Abeer Mahmoud

39 Operating System Structure
Time sharing (or multitasking) system: Multiple jobs are executed by switching the CPU between them. frequently that the users can interact with each program while it is running. In this, the CPU time is shared by different processes, so it is called as “Time sharing Systems”. Time slice is defined by the OS, for sharing CPU time between processes. CPU is taken away from a running process when the allotted time slice expires. ex: Unix, etc. Dr. Abeer Mahmoud

40 Memory Layout for Multiprogrammed System
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 Thank you End of Chapter 1
Dr. Abeer Mahmoud


Download ppt "Operating Systems (CS 340 D)"

Similar presentations


Ads by Google