Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Operating System (OS)

Similar presentations


Presentation on theme: "Introduction to Operating System (OS)"— Presentation transcript:

1 Introduction to Operating System (OS)
Operating Systems Introduction to Operating System (OS)

2 Text books Charles Crowley “Operating System A Design Approach” TMH.
“Operating Systems Concepts: Essentials” by Silberschatz, Galvin, Gagne William Stallings “Operating Systems-Internals and Design Principles Andrew S. Tanenbaum “Operating Systems Design and Implementation”, Third Edition, Prentice Hall Publications 2006 A.S. Tanenbaum, “Modern Operating Systems”, 2nd edition, Prentice Hall India.

3 What is an Operating System?
An Operating System is a program that acts as an interface between a user of a computer and the computer hardware. The purpose of an operating system is to provide an environment in which a user can execute programs. The primary goal of an operating system is thus to make the computer system convenient to use. A secondary goal is to use the computer hardware in an efficient manner.

4 Why Study Operating Systems?
Abstraction — how do you give the users the illusion of infinite resources (CPU time, memory, file space)? System design —tradeoffs between: performance and convenience of these abstractions performance and simplicity of OS functionality in hardware or software Primary intersection point — OS is the point where hardware, software, programming languages, data structures, and algorithms all come together “Operating systems are among the most complex pieces of software yet developed”, William Stallings, 1994

5 Levels in a computer system
User

6 Abstract View of Computer System Components

7 Where does the OS fit in?

8 Dynamic View of System Components

9 User and System View of OS
User perspective : ease of usage is the main consideration. System perspective : efficiency in usage of resources is the main consideration. As a provider of resources - OS must have a policy and a control program to regulate the allocation of resources

10 Two key OS functions Abstract Machine Resource Manager
Hides complex details of the underlying hardware Provides common API to applications and services Simplifies application writing Resource Manager Controls (scheduling, multiplexing, transforming etc.) accesses to shared resources CPU, memory, disks, network, ... Allows for global policies to be implemented Better utilization of computer hardware

11 Operating System Definitions
Resource allocator – manages and allocates resources Control program – controls the execution of user programs and operations of I/O devices Kernel – lies between software and hardware. The one program running at all times (all else being application programs)

12 Providing abstraction via system calls
Application System Calls: read(), open(), write(), mkdir(), kill() ... Operating System Process Mgmt Device Mgmt File System Network Comm. Protection Security CPU Memory Network Video Card Monitor Disk Printer

13 O.S. Components Process management Main memory management
File management I/O system management Secondary storage management Networking Protection system Command interpreter system

14 Process Management A process is a program in execution.
Needs (CPU time, memory, files, and I/O devices). Tasks of Process Management of an OS Create, load, execute, suspend, resume, and terminate processes Process scheduling :Switch system among multiple processes in main memory Provides communication mechanisms so that processes can send (or receive) data to (or from) each other. Process synchronization Control concurrent access to shared data to keep shared data consistent. Allocate/de-allocate resources properly to prevent or avoid deadlock situation

15 Main-Memory Management
Processes must be loaded into main memory to be executed. Tasks of Main Memory Management of OS Keep track of which memory area is used by whom. Decide which processes to load when memory space becomes available. Allocate and de-allocate memory space as needed.

16 File Management A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data. Tasks of File Management File creation and deletion. Directory creation and deletion. Support of primitives for manipulating files and directories. Mapping files onto secondary storage. File backup on stable (nonvolatile) storage media.

17 I/O System Management The I/O system consists of:
A buffer-caching system A general device-driver interface Drivers for specific hardware devices

18 Secondary-Storage Management
Almost everything is stored in the secondary storage. Therefore, secondary storage accesses must be efficient and convenient Tasks of Storage Management Free space management Storage allocation Disk scheduling

19 Networking (Distributed Systems)
A distributed system is a collection of processors that do not share memory or a clock. Each processor has its own local memory. The processors in the system are connected through a communication network. Communication takes place using a protocol. Access to a shared resource allows: Computation speed-up Increased data availability Enhanced reliability

20 Protection System Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources. The protection mechanism must: distinguish between authorized and unauthorized usage. specify the controls to be imposed. provide a means of enforcement.

21 Command-Interpreter System
Many commands are given to the operating system by control statements which deal with: process creation and management I/O handling secondary-storage management main-memory management file-system access protection Networking The program that reads and interprets control statements is called variously: command-line interpreter shell (in UNIX)

22 System Calls Process control File manipulation Device manipulation
end/abort this program load/execute another program create/terminate a process get/set attributes wait specified time wait for event, signal event File manipulation create/open/read/write/close/delete file Device manipulation request/read/write/release device Information get/set time/date

23 Evolution of Operating Systems
Early Systems (1950) Simple Batch Systems (1960) Multiprogrammed Batch Systems (1970) Time-Sharing and Real-Time Systems (1970) Personal/Desktop Computers (1980) Multiprocessor Systems (1980) Networked/Distributed Systems (1980) Web-based Systems (1990)

24 Example of an early computer system
Eniac filled an entire room. Weighed eighty tones and consumed 200 KW of power

25 Simple Batch System The user submit the job on cards or tapes to a program operator, who batches the jobs together sequentially and places the entire batch on an input device, for use by the monitor (program)

26 Operation of Simple Batch Systems
The user submits a job (written on cards or tape) to a computer operator. The computer operator place a batch of several jobs on an input device. A special program, the monitor, manages the execution of each program in the batch.

27 Idea of Simple Batch Systems
Reduce setup time by batching similar jobs. Use Automatic Job Sequencing – automatically transfer control from one job when it finishes to another one.

28 Spooling (1) Problem: Solution: Spooling -
Card reader, Line printer and Tape drives slow (compared to Disk). I/O and CPU could not overlap. Solution: Spooling - Overlap I/O of one job with the computation of another job (using double buffering, DMA, etc). Technique is called SPOOLing: Simultaneous Peripheral Operation On Line.

29 We assumed Uniprogramming until now
I/O operations are exceedingly slow (compared to instruction execution). A program containing even a very small number of I/O operations, will spend most of its time waiting for them. Hence: poor CPU usage when only one program is present in memory. A. Frank - P. Weisberg

30 Memory Layout for Uniprogramming

31 Memory Layout for Batch Multiprogramming
Several jobs are kept in main memory at the same time, and the CPU is multiplexed among them.

32 Multiprogramming (2) A. Frank - P. Weisberg

33 Why Multiprogramming? Advantages Disadvantages
Increases CPU utilization by organizing jobs so that the CPU always has one to execute. User feels that many programs are allotted CPU almost simultaneously. Disadvantages CPU scheduling is required. To accommodate many jobs in memory, memory management is required

34 Time-Sharing System Multiprogramming does not support interaction with users. Time-sharing extends Multiprogramming to handle multiple interactive jobs – it’s Interactive Multiprogramming. Multiple users simultaneously access the system through commands entered at terminals. Processor’s time is shared among multiple users.

35 Batch Multiprogramming vs. Time Sharing
35

36 Example: Embedded system use real time operating system
Real-Time Systems Real-Time (RT) systems are dedicated systems that need to adhere to deadlines , i.e., time constraints. Correctness of the system depends not only on the logical result of computation, but also on the time at which the results are produced. Example: Embedded system use real time operating system An embedded system is a computer systemwith a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. It is embedded as part of a complete device often including hardware and mechanical parts

37 Hard Real-Time Systems
Hard real-time system must meet its deadline. Often used as a control device in a dedicated application: Industrial control Robotics Secondary storage limited or absent, data/program is stored in short term memory, or Read-Only Memory (ROM).

38 Soft Real-Time Systems
Deadlines desirable but not mandatory. Limited utility in industrial control or robotics. Useful in modern applications (multimedia, video conference, virtual reality) requiring advanced operating-system features.

39 Multiprocessor Systems
System with several CPUs in close communication: processors share memory and a clock. communication usually takes place through the shared memory. Also known as parallel systems, tightly-coupled systems. Advantages: Increased throughput Economy Of Scale Increased reliability

40 Multiprogramming vs. Multiprocessing

41 Types of Multiprocessor Systems
Asymmetric Multiprocessing master processor schedules and allocates work to slave processors.

42 Types of Multiprocessor Systems
Symmetric Multiprocessing (SMP) Each processor performs all tasks within operating system. No Master slave relationship. Most modern operating systems support SMP.

43 Distributed Systems Distributed system is collection of loosely coupled processors interconnected by a communications network. Reasons for distributed systems: Resource sharing: sharing and printing files at remote sites. processing information in a distributed database. using remote specialized hardware devices. Computation speedup – load sharing. Reliability – detect and recover from site failure, function transfer, reintegrate failed site. Communication – message passing.

44 Distributed Systems A. Frank - P. Weisberg

45 Distributed Operating Systems (DOS)
Gives the impression there is a single operating system controlling the network. Data Migration – transfer data by transferring entire file, or transferring only those portions of the file necessary for the immediate task. Computation Migration – transfer the computation, rather than the data, across the system. Process Migration – execute an entire process, or parts of it, at different sites.

46 Operating-System Operations
Interrupt driven by hardware Software error or request creates exception or trap Division by zero, request for operating system service 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

47 Transition from User to Kernel Mode
Timer to prevent infinite loop Set interrupt after specific period Operating system decrements counter When counter zero generate an interrupt

48 Multiplexing in Resource management
Time multiplexing time-sharing scheduling a serially-reusable resource among several users Eg CPU or printer Space multiplexing space-sharing dividing a multiple-use resource up among several users Eg Memory, disk space

49 Time-multiplexing the processor

50 Space-multiplexing memory

51 Time-multiplexing I/O devices

52 Space-multiplexing the disk


Download ppt "Introduction to Operating System (OS)"

Similar presentations


Ads by Google