Download presentation
Presentation is loading. Please wait.
Published byMargaret Booth Modified over 8 years ago
1
Operating Systems (CS 340 D) Princess Nora University Faculty of Computer & Information Systems Computer science Department
2
(Chapter-1) Introduction
3
Chapter 1 Introduction 1.What Operating Systems Do 2.Computer-System Organization 3.Computer-System Architecture 4.Operating-System Structure 3
4
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. 4
5
5 What is an Operating System?
6
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 6
7
Operating System Functions 7 Process Management Memory Management File Management Device Management Command Interpretation Security
8
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 8
9
Four Components of a Computer System 9
10
The operating system’s Role 1- User View: 10 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)
11
The operating system’s Role (cont.) 2- System View: 11 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.
12
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 12
13
13 Computer-System Organization
14
1.Computer-System Operation 2.Storage Structure 3.I/O Structure 14
15
Computer System Organization Computer-system operation A general-purpose computer system consists of One or more CPU Multiple device controllers that are connected through a common bus RAM connecting to CPU and device controllers through common bus 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.
16
Computer-system operation
17
Computer Startup: bootstrap program is loaded at power-up or reboot Typically stored in ROM, 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. Firmware: Firmware is software that is embedded in a piece of hardware. You can think of firmware simply as "software for hardware.“ Typical examples of devices containing firmware are embedded systems (such as traffic lights, consumer appliances, and digital cameras ) The firmware contained in these devices provides the control program for the device. Firmware is held in non-volatile memory 17 Computer System Organization 1-Computer-system operation(cont..)
18
Interrupt: It generated from either the hardware or the software Hardware sending a signal to the CPU through system bus. Software by executing a special operation called a system call. A trap is a software-generated interrupt caused either by an error or a user request 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. 18 Computer System Organization 1-Computer-system operation(cont..)
19
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 19 Computer System Organization 2-Storage Structure
20
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. 20 Computer System Organization 2-Storage Structure(cont..)
21
Storage Structure (cont.) Typical instruction-execution cycle : 1. Fetches an instruction from memory and stores that instruction in the instruction register. 2. The instruction is decoded and may cause operands to be fetched from memory and stored in some internal register. 3. the instruction on the operands is executed 4. the result may be stored back in memory. 21
22
Storage Structure (cont.) Storing programs and data in RAM permanently is impossible because: RAM is too small to store all needed programs and data permanently. RAM is volatile storage device that loses its contents when power is turned off. 22
23
Storage Hierarchy Storage systems organized in hierarchy Speed Cost size Volatility Caching It is copying information into faster storage system. Caches can be installed to improve performance where a large access-time or transfer-rate disparity exists between two components. The design of a complete memory system must balance all the factors just discussed: It must use only as much expensive memory as necessary while providing as much inexpensive, nonvolatile memory as possible. 23
24
More expensive and faster volatile Non- volatile can be volatile or non volatile 24 Computer System Organization 2-Storage Structure (cont..)
25
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. 25 Computer System Organization 3-I/O Structure
26
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 26 Computer System Organization 3-I/O Structure(cont..)
27
I/O Structure (cont.) Typical I/O operation: (method #1) The device driver loads the appropriate registers within the device controller. The device controller, examines the contents of these registers to determine what action to take (such as “read “a character from the keyboard”). The controller starts the transfer of data from the device to its local buffer. Once the transfer of data is complete, the device controller informs the device driver via an interrupt that it has finished its operation. The device driver then returns control to the operating system, possibly returning the data or a pointer to the data if the operation was a read. This form of interrupt-driven I/O is fine for moving small amounts of data but can produce high overhead when used for bulk data movement such as disk I/O. 27
28
I/O Structure (cont.) Direct memory access I/O operation: (method #2) This method is used to solve the problem of moving bulk data without causing OS overhead >>>> (to improve performance) What is direct memory access (DMA) ? After setting up buffers, pointers, and counters for the I/O device, the device controller 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. 28
29
29 Computer-System Architecture
30
Single-processor systems : one CPU 30 MULTIPROCESSOR SYSTEMS have two or more processors in close communication, sharing the computer bus and some times the clock, memory, and peripheral devices..
31
Computer-System Architecture Single-processor systems It has one CPU capable of executing a general-purpose instruction set, including instructions from user processes. Most systems use a single processor (PDAs through mainframes) Almost all systems have other special-purpose processors The use of special-purpose microprocessors is common and does not turn a single-processor system into a multiprocessor. 31
32
Computer-System Architecture About special-purpose processors : They may come in the form of device-specific processors, such as disk, keyboard controllers Special-purpose processors run a limited instruction set and do not run user processes. 32
33
Computer-System Architecture 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 Multiprocessor systems can cost less than equivalent multiple single-processor systems, because they can share peripherals, mass storage, and power supplies. 3. Increased reliability the failure of one processor will not halt the system, only slow it down. 33
34
MULTIPROCESSOR SYSTEMS TYPES – (CONT.): 34 Computer-System Architecture (cont..) Asymmetric Multiprocessing Symmetric Multiprocessing (SMP) o Each processor is assigned a specific task. o master-slave relationship o A master processor controls the system; It schedules and allocates work to the slave processors. o Each processor performs all tasks within the operating system. (peer =equal rank) o Each processor has its own set of registers & cache o All processors share physical memory.
35
Symmetric Multiprocessing Architecture 35
36
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. 36 Computer-System Architecture (cont..)
37
o Processors were originally developed with only one core. o The core : is the part of the processor that actually performs the reading and executing of the instruction. o Single-core processors can process only one instruction at a time Multi-cores chips. o It is a recent trend in CPU design is to include multiple computing cores on a single chip. 37 Computer-System Architecture (cont..)
38
A Dual-Core Design l Dual-core processor contains two cores (Such as Intel Core Duo). l Multi-core systems are especially suited for server systems such as database and Web servers. 38 o Multi-cores chips can be more efficient than multiple chips with single cores because: 1. on-chip communication is faster than between-chip communication 2.one chip with multiple cores uses significantly less power than multiple single-core chips.
39
39 Operating System Structure
40
n 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. 40
41
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. 41
42
Operating System Structure 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. 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. Eg.: Unix, etc 42
43
Operating System Structure 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 43
44
Thank you End of Chapter 1 44
45
Some Helpful Notes Some terminologies : Usability = ease of use Utilization= efficiency Performance= speed Synchronize = manage the timing System overhead = more work must be performed by the system (e.g. more load) 45
46
Some Helpful Notes (cont.) Load & store operations between RAM & CPU is different from Load & store operations between RAM & storage devices Between RAM & CPU : 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 Between RAM & Storage Devices : The load instruction>>> moves a word from storage device to RAM. The store instruction>>> moves a word from RAM to storage device. 46
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.