0% found this document useful (0 votes)
32 views48 pages

Os - Unit 1

Uploaded by

sujaltlrj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views48 pages

Os - Unit 1

Uploaded by

sujaltlrj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 48

Unit -1

Introduction

Prachi Shah
IT Dept.
BVM
Contents

1. Basics of Operating Systems: Definition & Working


2. Generations of Operating systems
3. Types of Operating Systems (or Operating System zoo)
4. Operating System Concepts
5. System Calls
6. Operating System Structure
What Is An Operating System?
A modern computer consists of:

• One or more processors


• Main memory
• Disks
• Printers
• Various input/output devices

Managing all these components requires a layer of software –


the operating system
Introduction to Operating System
A modern computer is very complex.
◦ Networking
◦ Disks
◦ Video/audio card
◦ ….
Itis impossible for every application programmer to understand
every detail

A layer of computer software is introduced to provide a better,


simpler, cleaner model of the resources and manage them
Architecture of a Computer System

Figure 1-1. Where the operating system fits in


More about Architecture… (Explained)
On top of hardware is OS

Most computers have two modes of operation:


◦ Kernel mode and user mode
◦ OS runs in kernel mode, which has complete access to all hardware
and can execute any instruction
◦ Rest of software runs in user mode, which has limited capability
◦ Shell or GUI is the lowest level of user mode software
 Functions of an Operating System
Two functions:
◦ From top to down: provide application programmers a clean
abstract set of resources instead of hardware ones
◦ From down to top: Manage these hardware resources

 Roles of an Operating System


1. As an Extended Machine
2. As a Resource Manager
1. The Operating System as an Extended Machine
Abstraction:
◦ CPU – process
◦ Storage – files
◦ Memory – address space

4 types of people:
◦ Industrial engineer: design
hardware
◦ Kernel designer
◦ Application programmer: OS’s
Figure 1-2. Operating systems turn ugly user
hardware into beautiful abstractions. ◦ End users
2. The Operating System as a Resource Manager
• Allow multiple programs to run at the same time
• Manage and protect memory, I/O devices, and other resources
• Includes multiplexing (sharing) resources in two different ways:
 In time
 In space
Summary
Operating system
◦ Is a complex software
◦ Runs in kernel mode
◦ Manages hardware
◦ Provide a friendly interface for application programmer
History / Generations of Operating Systems

1. (1945–55) Vacuum Tubes


2. (1955–65) Transistors and Batch Systems
3. (1965–1980) ICs and Multiprogramming
4. (1980–Present) Personal Computers
History of OS
The classification was done on the basis of major changes and increased efficiency that an
operating system has gone through in time.
 In the first generation of the operating system Vacuum tubes and Plugboards were
introduced in the computer system.
 In the second generation of an operating system, transistors and Batch systems are
introduced that perform the task execution in a batch comprised of jobs. In this operating
system, only one task gets executed at a single time.
 The third generation of the operating system leads to the invention of integrated circuits.
Now, the systems are much faster than earlier operating systems. More than two jobs can be
scheduled for the processor at a single time in these operating systems.
 The fourth generation of the operating system was introduced by the use of large-scale
integrated circuits on a silicon plate. Personal computers become general use by the public.
The process of job execution is now much faster
1st: vacuum tubes
Large and slow
Engineers design, build, operate and maintain the
computer
All programming is done with machine language, or by
wiring circuits using cables
Insert plug boards into the computer and operate
The work is mainly numerical calculations
2nd: transistors and batch systems
Also called mainframes
Computers are managed by professional operators
Programmers use punch card to run programs; operators operate
(load compiler, etc ) and collect output to the user
Complains soon come:
◦ Human Operation between computer operation
◦ Lead to batch system
◦ Collect a batch of jobs in the input room, then read them into a magnetic
tape; the same for output
3rd: IC and Multiprogramming
OS/360: a dinosaur stuck in a tar pit
◦ Aims to adapts 1401/7904, covers all trades of life
◦ However, OS/360 introduces several key techniques
 Multi-programming: solve the problem of CPU idling
 Spooling: simultaneous peripheral operation on line
 Whenever a job finishes, OS load a new job from disk to the empty-
partition
2nd: Transistors and Batch Systems

Figure 1-3. An early batch system.


(a) Programmers bring cards to 1401.
(b) 1401 reads batch of jobs onto tape.
(c) Operator carries input tape to 7094.
(d) 7094 does computing.
(e) Operator carries output tape to 1401.
(f) 1401 prints output.
2nd: Transistors and Batch Systems

Figure 1-4. Structure of a typical FMS job.


3rd: ICs and Multiprogramming

Figure 1-5. A multiprogramming system


with three jobs in memory.
3rd: ICs and Multiprogramming
Problems:
◦ 3rd generation OS was well suited for big scientific calculations
and massive data processing
◦ But many programmers complain a lot… for not be able to
debug quickly…. Why?
◦ And the solution to this problem would be….?
◦ Timesharing:
 A variant of multiprogramming
 Provide both fast interactive service but also fits big batch work
3rd: IC and Multiprogramming
A system to be remembered: MULTICS
◦ A machine that would support hundreds of simultaneous
timesharing users– like the electricity system (like a web server
nowadays)
◦ Introduces many brilliant ideas but enjoys no commercial
success
◦ Its step-child is the well-known and time-honored UNIX
◦ System V/ FreeBSD, MINIX, Linux
4th: personal computers
Computers have performance similar to 3 rd generation,
but prices drastically different
CP/M
◦ First disk-based OS
MS-DOS with GUI– Win95/98/me—winNT/xp…
Summary
4generations OS
Develops with hardware and user needs
Multi-user, multi-programming, time-sharing
The Operating System Zoo (Types of OS)

• Mainframe operating systems


• Server operating systems
• Multiprocessor operating systems
• Personal computer operating systems
• Handheld operating systems
• Embedded operating systems
• Sensor node operating systems
• Real-time operating systems
• Smart card operating systems
Types of OS Examples Use

Mainframe operating systems IBM, Hitachi, Amdahl, and Unisys

Server operating systems Red Hat Enterprise Linux, Windows Server, Mac OS X Server Web pages are stored on a server

Multiprocessor operating With high processing speed, act as multiple


Windows NT, Solaris, Digital UNIX, OS/2 & Linux
systems processors into single system

Personal computer operating


Microsoft Windows, macOS, and Linux
systems

Handheld operating systems android and iOS Mobile phones

Embedded operating systems Windows Mobile/CE, Symbian (cell phones) and Linux washing machines, ovens etc.

outdoors, into text things like motion, smoke,


Sensor node operating systems TinyOS
temperature change, precipitation, and so on

Airline traffic control systems, Command Control Systems, Airlines


Real-time operating systems reservation system, Heart Peacemaker, Network Multimedia Systems, Robot
etc.

a card designed to specifically support an electronic purse, debit or credit


Smart card operating systems
application
Operating System Concepts
• Processes
• Address spaces
• Files
• Input / Output
• Protection
• The shell
Processes

 It’s a program in execution.


 Each process has its address space, which is a list of memory locations
from 0 to some maximum; that the process can read and write.
 The address space contains the executable program, the program’s data
and its stack.
 All the information about each process is stored in a table called
process table, which is an array of structures, one for each process
currently in existence.
 The key process management system calls are those dealing with
creation and termination of processes.
Processes

• Shell is a process, also called command interpreter.


• It reads commands from a terminal.
• If a process creates one or more other processes (called child processes), a
process tree is created.

• Communication between related processes is known as interprocess


communication.
Address Spaces

 Main memory is used to hold processes.


 One or more than one program can be in main memory at the same
time.
 Each process has its own address space.
 Maximum amount of address space a process has is less than the main
memory.
 If a process requires more address space than the main memory, is
possible due to virtual memory concept.
 OS keeps part of the address space in main memory and part on disk
and shuttles pieces back and forth between them as needed.
Files
 Major function of the OS is to hide the peculiarities of the disks and
other I/O devices and present the programmer with a nice, clean
abstract model of independent files.
 System calls are provided for various operations (create, remove, read,
write, close, open etc.) on files.
 Directory is a way of grouping file together.
 Directory entries may be either files or other directories.
File system / File hierarchy
Files
• Can be specified by giving path name.
• Top of the directory hierarchy is known as root directory.
• Absolute path names consist of the list of directories that must be
traversed from the root directory to get to the file.
• Relative path starts with current working directory instead of root
directory.
• File descriptor is given for each file when it is opened.
• Mounting is required to access file system of any hard drive / CD /
USB.
• Mount system call allow the file system on the device to be attached
to the root file system wherever the program wants it to be.
Before Mounting After Mounting
Pipes
• A pipe is a sort of pseudofile that can be used
to connect two processes.
• Processes can communicate by writing into/ reading
from the pipe.
Input / Output

 Having I/O subsystem for managing its I/O devices.


 Some of the I/O software is device independent, that is, applies to
many or all I/O devices equally well.
 Other parts of it, such as device drivers, are specific
 to particular I/O devices.
Protection
• Files in UNIX are protected by assigning each one a
9 bit binary protection code.
• the protection code consists of three 3-bit fields, one
for owner, one for other members of the owner’s
group and one for everyone else.
• Each field has a bit for read access, a bit for write
access and a bit for execute access. These 3 bits are
known as rwx bits.
The Shell
• Its called command interpreter.
• It also works as primary interface between a user and
the OS, unless the user is using GUI.
• Many shells exists including sh, csh, ksh, bash.
• Shell is started up when user logs in.
• Shell has terminal as standard input and standard
output.
System calls
System calls is the interface users contact with OS and
hardware
System calls vary from system to system, but the
underlying concepts are similar

count = read(fd, buffer, nbytes);


System Calls

Figure 1-17. The 11 steps in making the system call - read(fd, buffer, nbytes)
System Calls for Process Management

Figure 1-18. Some of the major POSIX system calls.


System Calls for File Management

System Calls for Directory and File Management


Miscellaneous System Calls

Figure 1-18. Some of the major POSIX system calls.


Different Operating Systems Structures

1. Monolithic Systems
2. Layered Systems
3. Microkernels
4. Client-server Model
5. Virtual Machines
6. Exokernels
1. Monolithic Systems – basic structure:

• A main program that invokes the requested service


procedure.
• A set of service procedures that carry out the system calls.
• A set of utility procedures that help the service procedures.
2. Layered Systems

Figure 1-25. Structure of the THE operating system.


3. Microkernels

Figure 1-26. Structure of the MINIX 3 system.


4. Client-Server Model

Figure 1-27. The client-server model over a network.


5. Virtual Machines

Figure 1-29. (a) A type 1 hypervisor. (b) A type 2 hypervisor.


6. Exokernels
 Instead of cloning the actual machine, another strategy is partitioning it (i.e. giving each user a
subset of the resources).
 A program at the bottom layer, running in kernel mode, is called the exokernel.
 Its job is to allocate resources to virtual machines and then check attempts to use them to make sure
no machine is trying to use somebody else's resources.
 Each user-level virtual machine can run its own operating system, except that each one is restricted
to using only the resources it has asked for and been allocated.
 The advantage of the exokernel scheme is that it saves a layer of mapping.
 In the other designs, each virtual machine thinks it has its own disk, with blocks running from 0 to
some maximum, so the virtual machine monitor must maintain tables to remap disk addresses (and
all other resources). With the exokernel, this remapping is not needed.
 The exokernel need only keep track of which virtual machine has been assigned which resource.
 This method still has the advantage of separating the multiprogramming (in the exokernel) from the
user operating system code (in user space), but with less overhead, since all the exokernel has to do
is keep the virtual machines out of each other's hair.

You might also like