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

Introduction

An operating system (OS) serves as an intermediary between users and computer hardware, aiming to execute user programs efficiently and conveniently. It consists of four main components: hardware, the operating system itself, application programs, and users. The document also discusses various OS functions, services, system calls, and the evolution of operating systems over time.

Uploaded by

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

Introduction

An operating system (OS) serves as an intermediary between users and computer hardware, aiming to execute user programs efficiently and conveniently. It consists of four main components: hardware, the operating system itself, application programs, and users. The document also discusses various OS functions, services, system calls, and the evolution of operating systems over time.

Uploaded by

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

Chapter 1:

INTRODUCTION
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
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
Operating System Definitions
No universally accepted 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
Kernel – the one program running at all times . Everything else
is either a system program (ships with the operating system) or an
application program.
Computer-System Architecture
 Single-Processor Systems:
 Most systems use a single general-purpose processor (PDAs
through mainframes)
 Most systems have special-purpose processors as well

 Multiprocessor Systems:
 Also known as parallel systems, tightly-coupled systems

 Clustered Systems:
 Multiple systems working together
Symmetric Multiprocessing Architecture
Clustered Systems
Computer-System Architecture
 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
 A subset of total jobs in system is kept in memory
 One job selected and run via job scheduling
 When it has to wait (for I/O for example), OS switches to another job

 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
 Response time should be < 1 second
 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
Memory Layout for Multiprogrammed System
Operating System Services
 User point of View –
 Program execution – system capability to load a
program into memory and to run it.
 I/O operations – since user programs cannot
execute I/O operations directly, the operating
system must provide some means to perform I/O.
 File-system manipulation – program capability to
read, write, create, and delete files.
 Communications – exchange of information between
processes executing either on the same computer
or on different systems tied together by a network.
Implemented via shared memory or message
passing.
 Error detection – ensure correct computing by
detecting errors in the CPU and memory hardware,
in I/O devices, or in user programs.
Operating Systems
Additional Operating System Functions
Additional functions exist not for helping the user, but rather
for ensuring efficient system operations.

• Resource allocation – allocating resources to multiple


users or multiple jobs running at the same time.
• Accounting – keep track of and record which users use
how much and what kinds of computer resources for
account billing or for accumulating usage statistics.
• Protection – ensuring that all access to system resources
is controlled.

Operating Systems
A View of Operating System Services
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


Program 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)
 Why use APIs rather than system calls?

(Note that the system-call names used throughout this text


are generic)
Example of System Calls
 System call sequence to copy the contents of one file to another
file
System Call Implementation
 Typically, a number associated with each system call
 System-call interface maintains a table indexed according to
these numbers
 The system call interface invokes intended system call in OS kernel
and returns status of the system call and any return values
 The caller need know nothing about how the system call is
implemented
 Just needs to obey API and understand what OS will do as a
result call
 Most details of OS interface hidden from programmer by API
 Managed by run-time support library (set of functions built

into libraries included with compiler)


Standard C Library Example
 C program invoking printf() library call, which calls write()
system call
Types of System Calls
 Process control
 end, abort
 load, execute
 create process, terminate process
 get process attributes, set process attributes
 wait for time
 wait event, signal event
 allocate and free memory
 File management
 create file, delete file
 open, close file
 read, write, reposition
 get and set file attributes
Types of System Calls (Cont.)
 Device management
 request device, release device
 read, write, reposition
 get device attributes, set device attributes
 logically attach or detach devices
 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
 transfer status information
 attach and detach remote devices
Evolution of OS
Different generation of computers.
Serial processing.
Simple batch system
multi-programmed batch system, IBSYS ‘60.
Timesharing OS
Parallel systems, Distributed systems, Real
time systems, Embedded systems

You might also like