Sunteți pe pagina 1din 30

1

TGEN153 Introduction to Operating Systems

Chapter 1

OVERVIEW OF
OPERATING SYSTEM
(PART 2)
Miss Suhailah binti Fauzi

Adapted from:
Abraham Silberschatz, Peter Baer Galvin, Greg Gagne, (2008). Operating System Concepts. John Wiley

2
Lecture Outline
• Overview of OS
1
• Computer System Organization
2
• Computer System Architecture
3
• Operating System Structure
4
• Operating System operations
5
• Computing Environments
6
• Open Source OS
7

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 3


Objectives
 To provide a grand tour of the major operating systems
components

 To provide coverage of basic computer system organization

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 4


OVERVIEW of OS
 An OS is a program ……….?
 Mainframe OS are designed primarily to optimize utilization of hardware.
 Personal Computer (PC) OS support….?
 OS for handheld computers are designed to provide an environment in
which a user can ……?
 Main purposes of operating system:
 To provide an environment for a computer user to execute programs on
computer hardware in a convenient and efficient manner.
 To allocate the separate resources of the computer as needed to solve the
problems. The allocation process should be as fair and efficient as possible.
 As a control program it serves two major functions:
 Supervision of the execution of user programs to prevent errors and
improper use of the computer.
 Management of the operation and control of I/O devices.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 5


OVERVIEW Of OS (cont)
 Before we can explore the details of computer system
operation, we need to know something about system structure.
 We begin by discussing the basic functions of system startup,
I/O and storage.
 We also describe the basic computer architecture that makes it
possible to write a functional OS.
 Because an OS is large and complex, it must be created piece
by piece.
 Each of these pieces should be a well-delineated portion of the
system, with carefully designed inputs, outputs, and functions.
 In this chapter, the general overview of the major components
of an OS are provided.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 6


Computer System Components
 Computer system can be divided into four components:
 Hardware – provides basic computing resources for the system.
 CPU, memory, I/O devices
 Operating system
 Controls and coordinates use of hardware among various applications and
users
 Application programs – define the ways in which the system
resources are used to solve the computing problems of the users
 Word processors, compilers, web browsers, database systems, video games
 Users
 People, machines, other computers
 What is the OS’s role in the overall computer system?

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 7


Computer System Components (cont)

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 8


OS’s Role : User View
 Depends on the point of view
 Users want convenience, ease of use – performance
 Don’t care about resource utilization
 But shared computer such as mainframe or minicomputer must keep all users
happy – share resources and exchange information (maximize resource
utilization)
 Other cases, users of dedicate systems such as workstations have dedicated
resources at their disposal but frequently use shared resources from servers.
 Therefore, their OS is designed to compromised between individual usability and
resource utilization.
 Handheld computers are resource poor, optimized for usability and battery life.
 Some computers have little or no user interface/view, such as embedded
computers in home devices and automobiles may have numeric keypads and
may turn indicator lights on or off to show status.
 OS run without user intervention

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 9


OS Role : System View
 From the computer’s point of view, the OS is the program
most intimately involved with hardware.
 OS is a resource allocator
 Manages all resources.
 Facing numerous and possibly conflicting requests for resources,
OS must decide how to allocate them to specific programs and
users so that it can operate the computer system efficiently and
fairly.
 OS is a control program
 Controls execution of programs to prevent errors and improper
use of the computer
 Concerned with the operation and control of I/O devices

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 10


COMPUTER-SYSTEM
ORGANIZATION
 Before we can explore the details of how computer systems
operate, we need general knowledge of the structure of a
computer system.
 Computer-system operation
 One or more CPUs, device controllers connect through common
bus providing access to shared memory
 CPUs and devices controllers can execute concurrently,
competing for memory cycles
 To ensure orderly access to the shared memory, a memory
controller is provided whose function is to synchronize access to
the memory.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 11


COMPUTER-SYSTEM
ORGANIZATION (cont)
Computer
Modern Computer
A Modern
System
System
A

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 12


Computer System Operation
 Bootstrap program is loaded at power-up or reboot
 Typically it is stored in ROM or EEPROM, generally known as
firmware, within the computer hardware
 It initializes all aspects of the system, from CPU registers to
device controllers to memory contents
 The bootstrap program must know how to load the operating
system and how to start executing that system.
 To accomplish this goal, the bootstrap program must locate and
load into memory the operating system kernel.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 13


Storage Structure
 Storage Structure - The CPU can load instructions only from
memory, so any programs to run must be stored there.
 General-purpose computers run most of their programs from
rewriteable memory, called main memory (also called or RAM).
 Secondary storage – extension of main memory that provides
large nonvolatile storage capacity
 Able to hold large quantities of data permanently.
 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

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 14


Storage Hierarchy
 Storage systems
organized in hierarchy
volatile
 Speed
 Cost
 Volatility

 Caching – copying
information into faster
nonvolatile
storage system; main
memory can be viewed
as a cache for secondary
storage

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 15


I/O Structure
 Storage is only one of many types of I/O devices within a computer. A large
portion of OS code is dedicated to managing I/O, both because of its importance
to the reliability and performance of a system and because of the varying nature
of the devices.
 After I/O starts, control returns to user program only upon I/O completion
 Wait instruction idles the CPU until the next interrupt
 Wait loop (contention for memory access)
 At most one I/O request is outstanding at a time, no simultaneous I/O processing
 After I/O starts, control returns to user program without waiting for I/O
completion
 System call – request to the operating system to allow user to wait for I/O
completion
 Device-status table contains entry for each I/O device indicating its type, address,
and state
 Operating system indexes into I/O device table to determine device status and to
modify table entry to include interrupt

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 16


How a Modern Computer Works

A von Neumann architecture

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 17


COMPUTER-SYSTEM
ARCHITECTURE
 Most systems use a single general-purpose processor (PDAs
through mainframes)
 Most systems have special-purpose processors as well
 One main CPU capable of executing a general-purpose
instruction set, including instruction from user processes
 Device-specific processors, like disks, keyboard, and graphic
controllers
 Multiprocessors systems growing in use and importance
 Also known as parallel systems, tightly-coupled systems.
 Advantages include:
 Increased throughput
 Economy of scale
 Increased reliability – graceful degradation or fault tolerance

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 18


Symmetric Multiprocessing Architecture

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 19


OPERATING SYSTEM STRUCTURE
 Multiprogramming needed for efficiency
 Single user cannot keep CPU and I/O devices busy at all times
 Multiprogramming organizes jobs (code and data) so CPU always has one to execute
 The operating system keeps several jobs in memory simultaneously
 Since, in general main memory 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.
 The set of jobs in memory can be a subset of the jobs kept in the job pool.
 The operating system picks and begins to execute one of the jobs in memory.
 Eventually, the job may have to wait for some task, such as an I/O operation, to
complete.
 In a multiprogrammed system, the operating system simply switches to, and executes,
another job.
 When that job needs to wait, the CPU is switched to another job, and so on.
 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.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 20


OPERATING SYSTEM STRUCTURE
(cont)
 Timesharing (multitasking) is logical extension in which CPU switches jobs so
frequently that users can interact with each job while it is running, creating
interactive computing.
 The user gives instructions to the operating system or to a program directly, using
an input device such as a keyboard or a mouse, and waits for immediate results on
an output device. (Response time should be < 1 second)
 A time-shared operating system allows many users to share the computer
simultaneously. Since each action or command in a time-shared system tends to be
short, only a little CPU time is needed for each user.
 As the system switches rapidly from one user to the next, each user is given the
impression that the entire computer system is dedicated to his use, even though it
is being shared among many users.
 Each user has at least one program executing in memory process
 If several jobs ready to run at the same time  CPU scheduling
 If processes don’t fit in memory, swapping moves them in and out to run
 Virtual memory allows execution of processes not completely in memory

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 21


OPERATING-SYSTEM OPERATIONS
 Modern operating system are interrupt driven by hardware
 If there are no processes to execute, no I/0 devices to service, and no users to whom
to respond, an operating system will sit quietly waiting for something to happen.
 Events are almost always signaled by the occurrence of an interrupt or a trap.
(software-generated interrupted caused either by an error)
 Division by zero, request for operating system service
 Since the operating system and the users share the hardware and software resources
of the computer system, we need to make sure that an error in a user program could
cause problems only for the one program running.
 With sharing, many processes could be adversely affected by a bug in one program.
 For example, if a process gets stuck in an infinite loop, this loop could prevent the
correct operation of many other processes. More subtle errors can occur in a
multiprogramming system, where one erroneous program might modify another
program, the data of another program, or even the operating system itself.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 22


OPERATING SYSTEM OPERATIONS
(cont)
 In order to ensure the proper execution of the operating system, we must
be able to distinguish between the execution of operating-system code
and user defined code.
 The approach taken by most computer systems is to provide hardware
support that allows us to differentiate among various modes of execution.
 Dual-mode operation allows OS to protect itself and other system
components
 User mode and kernel mode (supervisor mode/system mode)
 Mode bit (indicate the current bit, kernel-0, user-1) provided by hardware
 We are able to distinguish between a task that is executed on behalf of the operating
system and one that is executed on behalf of the user.
 When the computer system is executing on behalf of a user application, the system is in
user mode.
 However, when a user application requests a service from the operating system (via a
system call), it must transition from user to kernel mode to fulfill the request.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 23


Transition from User to Kernel Mode
 Timer to prevent infinite loop / process hogging resources
 Set interrupt after specific period
 Operating system decrements counter
 When counter zero generate an interrupt
 Set up before scheduling process to regain control or terminate
program that exceeds allotted time

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 24


COMPUTING ENVIRONMENTS
 So far, we have provided an overview of computer-system organization
and major operating-system components. We conclude with a brief
overview of how these are used in a variety of computing environments.
 Traditional computing
 Blurring over time
 Office environment
 PCs connected to a network.Remote access was awkward, and portability was achieved
by use of laptop computers. Terminals attached to mainframes were prevalent at many
companies as well, with even fewer remote access and portability options.
 Now portals allowing networked and remote systems access to same resources
 Handheld computers can synchronize with PCs to allow very portable use of con1pany
information. Handheld PDAs can also connect to use the company's Web portal (as well
as the myriad other Web resources).
 Home networks
 Used to be single system, then modems
 Now firewalled, networked

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 25


COMPUTING ENVIRONMENTS (Cont.)

 Client-Server Computing
 Many systems now servers, responding to requests generated by
clients
 Compute-server provides an interface to client to request services (i.e.,
database)
 File-server provides interface for clients to store and retrieve files

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 26


COMPUTING ENVIRONMENTS (Cont.)

 Peer-to-Peer Computing (P2P)


 Another model of distributed system
 P2P does not distinguish clients and servers
 Instead all nodes are considered peers
 May each act as client, server or both
 Node must join P2P network
 Registers its service with central lookup service on network, or
 Broadcast request for service and respond to requests for service via
discovery protocol
 Examples include Napster and Gnutella

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 27


COMPUTING ENVIRONMENTS (Cont.)

 Web-Based Computing
 Web has become ubiquitous
 PCs most prevalent devices
 More devices becoming networked to allow web access
 New category of devices to manage web traffic among similar
servers: load balancers
 Use of operating systems like Windows 95, client-side, have
evolved into Linux and Windows XP, which can be clients and
servers

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 28


OPEN-SOURCE OS
 Operating systems made available in source-code format rather than just binary
closed-source, can modified and distributed.
 Examples include GNU/Linux and BSD UNIX (including core of Mac OS X), and
many more.
 Benefits:
 Including a community of interested (and usually unpaid) programmers who contribute to
the code by helping to debug it analyze it/ provide support/ and suggest changes.
 Open-source code is more secure than closed-source code because many more eyes are
viewing the code.
 Certainly open-source code has bugs/ but open-source advocates argue that bugs tend to
be found and fixed faster owing to the number of people using and viewing the code.
 Companies that earn revenue from selling their programs tend to be hesitant to open-
source their code/ but Red Hat/ SUSE1 Sun/ and a myriad of other companies are doing
just that and showing that commercial companies benefit/ rather than suffer/ when they
open-source their code.
 Revenue can be generated through support contracts and the sale of hardware on which
the software runs/ for example.

TGEN153 Introduction to Operating Systems Miss Suhailah Fauzi 29


TGEN153 Introduction to Operating Systems

End of Chapter 1 (Part 2)

THANK YOU
Miss Suhailah binti Fauzi

30

S-ar putea să vă placă și