0% found this document useful (0 votes)
55 views

1-Introduction To OS

The document provides an overview of operating systems, including definitions, components, roles, and functionality. It discusses what an operating system is, noting it acts as an intermediary between hardware and software. The key roles of an OS are to provide a standard library of resources and coordinate access to resources. The OS provides services like I/O operations, file management, and resource allocation to applications and users. It also covers different types of operating systems and system calls.

Uploaded by

Praneeth Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

1-Introduction To OS

The document provides an overview of operating systems, including definitions, components, roles, and functionality. It discusses what an operating system is, noting it acts as an intermediary between hardware and software. The key roles of an OS are to provide a standard library of resources and coordinate access to resources. The OS provides services like I/O operations, file management, and resource allocation to applications and users. It also covers different types of operating systems and system calls.

Uploaded by

Praneeth Kumar
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

CSE2005 Operating Systems

Introduction and Overview

Questions answered in this lecture:


What is an operating system?
What is the role of an OS?
What is the functionality of an OS?
How have operating systems evolved?
Why study operating systems?
What is an Operating System?
Not easy to define precisely…
Users
compilers
Applications databases
word processors

Operating System
CPU
Hardware memory
I/O devices

OS:
Everything in system that isn’t an application or hardware
OS:
Software that converts hardware into a useful form for
applications
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.
• Make the computer system convenient to
use.
• Use the computer hardware in an
efficient manner.
OS – Good Definition!
• The operating system (sometimes referred to by its
abbreviation OS), is responsible for creating the link
between the material resources, the user and the
applications (word processor, video game, etc.). When a
programme wants to access a material resource, it does
not need to send specific information to the peripheral
device but it simply sends the information to the operating
system, which conveys it to the relevant peripheral via its
driver. If there are no drivers, each programme has to
recognize and take into account the communication with
each type of peripheral!
Operating System Definition
• OS is a resource allocator
• Manages all resources
• Decides between conflicting requests for
efficient and fair resource use
• OS is a control program
• Controls execution of programs to prevent
errors and improper use of the computer
Computer System Structure
• Computer system can be divided into four components
• Hardware – provides basic computing resources
– 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
Four Components of a Computer System
What is the role of the OS?
Role #1: Provide standard Library (I.e., abstract resources)
What is a resource?
• Anything valuable (e.g., CPU, memory, disk)
Advantages of standard library
• Allow applications to reuse common facilities
• Make different devices look the same
• Provide higher-level abstractions
Challenges
• What are the correct abstractions?
• How much of hardware should be exposed?
What is the role of the OS?
Role #2: Resource coordinator (I.e., manager)

Advantages of resource coordinator


• Virtualize resources so multiple users or applications
can share
• Protect applications from one another
• Provide efficient and fair access to resources
Challenges
• What are the correct mechanisms?
• What are the correct policies?
Operating System Services/
Functionality
• One set of operating-system services provides functions that are
helpful to the user:
• User interface - Almost all operating systems have a user interface
(UI)
– Varies between Command-Line (CLI), Graphics User Interface
(GUI), Batch
• Program execution - The system must be able to load a program
into memory and to run that program, end execution, either
normally or abnormally (indicating error)
• I/O operations - A running program may require I/O, which may
involve a file or an I/O device.
• File-system manipulation - The file system is of particular
interest. Obviously, programs need to read and write files and
directories, create and delete them, search them, list file
Information, permission management.
Operating System Services (Cont.)
• One set of operating-system services provides functions that are
helpful to the user (Cont):
• Communications – Processes may exchange
information, on the same computer or between
computers over a network
– Communications may be via shared memory or through
message passing (packets moved by the OS)
• Error detection – OS needs to be constantly aware
of possible errors
– May occur in the CPU and memory hardware, in I/O devices,
in user program
– For each type of error, OS should take the appropriate action
to ensure correct and consistent computing
– Debugging facilities can greatly enhance the user’s and
programmer’s abilities to efficiently use the system
Operating System Services (Cont.)
• Another set of OS functions exists for ensuring the efficient operation of the
system itself via resource sharing
• Resource allocation - When multiple users or multiple jobs running
concurrently, resources must be allocated to each of them
– Many types of resources - Some (such as CPU cycles, main
memory, and file storage) may have special allocation code, others
(such as I/O devices) may have general request and release code.
• Accounting - To keep track of which users use how much and what
kinds of computer resources
• Protection and security - The owners of information stored in a
multiuser or networked computer system may want to control use of
that information, concurrent processes should not interfere with each
other
– Protection involves ensuring that all access to system resources is
controlled
– Security of the system from outsiders requires user authentication,
extends to defending external I/O devices from invalid access
attempts
– If a system is to be protected and secure, precautions must be
instituted throughout it. A chain is only as strong as its weakest link.
KINDS OF OS & PROPERTIES
Properties of the following types of operating systems:
• Batch
• Interactive
• Time sharing
• Real time
• Network
• Parallel
• Distributed
• Clustered
• Handheld
KINDS OF OS & PROPERTIES
Batch. Jobs with similar needs are batched together and run through the
computer as a group by an operator or automatic job sequencer.
Performance is increased by attempting to keep CPU and I/O devices
busy at all times through buffering, off-line operation, spooling, and
multiprogramming. Batch is good for executing large jobs that need little
interaction; it can be submitted and picked up later.

Interactive. This system is composed of many short transactions where


the results of the next transaction may be unpredictable. Response time
needs to be short (seconds) since the user submits and waits for the
result.

Time sharing. This systems uses CPU scheduling and


multiprogramming to provide economical interactive use of a system. The
CPU switches rapidly from one user to another. Instead of having a job
defined by spooled card images, each program reads its next control card
from the terminal, and output is normally printed immediately to the
screen.
KINDS OF OS & PROPERTIES
Real time. Often used in a dedicated application, this system reads information
from sensors and must respond within a fixed amount of time to ensure correct
performance.

Network. Provides operating system features across a network such as file


sharing.

SMP. Used in systems where there are multiple CPU’s each running the same
copy of the operating system. Communication takes place across the system bus.

Distributed. This system distributes computation among several physical


processors. The processors do not share memory or a clock. Instead, each
processor has its own local memory. They communicate with each other through
various communication lines, such as a high-speed bus or local area network.

Clustered. A clustered system combines multiple computers into a single system


to perform computational task distributed across the cluster.

Handheld. A small computer system that performs simple tasks such as


calendars, email, and web browsing. Handheld systems differ from traditional
desktop systems with smaller memory and display screens and slower
processors.
Why study Operating Systems?
Build, modify, or administer an operating system

Understand system performance


• Behavior of OS impacts entire machine
• Challenge to understand large, complex system
• Tune workload performance
• Apply knowledge across many areas
– Computer architecture, programming languages, data
structures and algorithms, and performance modeling
System Calls
• Programming interface to the services provided
by the OS
• Typically written in a high-level language (C or
C++)
• Mostly accessed by programs via a high-level
Application Programming Interface (API)
rather than direct system call use
• Three most common APIs are Win32 API for
Windows, POSIX API for POSIX-based
systems (including virtually all versions of
UNIX, Linux, and Mac OS X), and Java API for
the Java virtual machine (JVM)
Example of System Calls

• System call sequence to copy the contents of one


file to another file
Types of System Calls
• Process control
• create process, terminate process
• end, abort
• load, execute
• get process attributes, set process attributes
• wait for time
• wait event, signal event
• allocate and free memory
• Dump memory if error
• Debugger for determining bugs, single step
execution
• Locks for managing access to shared data between
processes
Types of System Calls

• File management
• create file, delete file
• open, close file
• read, write, reposition
• get and set file attributes
• Device management
• request device, release device
• read, write, reposition
• get device attributes, set device attributes
• logically attach or detach devices
Types of System Calls (Cont.)
• Information maintenance
• get time or date, set time or date
• get system data, set system data
• get and set process, file, or device attributes
• Communications
• create, delete communication connection
• send, receive messages if message passing
model to host name or process name
– From client to server
• Shared-memory model create and gain
access to memory regions
• transfer status information
• attach and detach remote devices
Types of System Calls (Cont.)

• Protection
• Control access to resources
• Get and set permissions
• Allow and deny user access
Examples of Windows and Unix System Calls
Standard C Library Example
• C program invoking printf() library call, which
calls write() system call

You might also like