Oprting System (Lecture) - Chapter-01
Oprting System (Lecture) - Chapter-01
Oprting System (Lecture) - Chapter-01
Introduction
1.1 What is an operating system
1.2 History of operating systems
1.3 The operating system zoo
1.4 Computer hardware review
1.5 Operating system concepts
1.6 System calls
1.7 Operating system structure
1
Introduction
2
What is an Operating System
• It is an extended machine
– Hides the messy details which must be performed
– Presents user with a virtual machine, easier to use
• It is a resource manager
– Each program gets time with the resource
– Each program gets space on the resource
3
History of Operating Systems (1)
4
History of Operating Systems (2)
5
History of Operating Systems (3)
• Multiprogramming system
– three jobs in memory – 3rd generation
7
The Operating System Types
• Mainframe operating systems
• Server operating systems
• Multiprocessor operating systems
• Personal computer operating systems
• Real-time operating systems
• Embedded operating systems
• Smart card operating systems
8
Mainframe operating systems
In this cases, a user sits at a terminal connected to a
mainframe or minicomputer. Other users are accessing
the same computer through other terminals.
These users share resources and may exchange
information.
The operating system in such cases is designed to
maximize resource utilization to assure that all available
CPU time, memory, and I/O are used efficiently and that
no individual user takes more than her fair share
9
Server operating systems
In still other cases, users sit at workstations
connected to networks of other workstations and
servers
.These users have dedicated resources at their
disposal, but they also share resources such as
networking and servers—file compute, and print
servers
. Therefore, their operating system is designed to
compromise between individual usability and
resource utilization
•.
10
Multiprocessor operating systems
Multiple CPUs are interconnected in to a single
system
Depending on how they are connected and
what is shared, they are called parallel systems
or multiprocessors
They require special os for communication and
connectivity among the processors
11
Personal computer operating systems
The user's view of the computer varies according to the interface
being used
Most computer users sit in front of a PC, consisting of a monitor,
keyboard, mouse, and system unit.
Such a system is designed for one user to monopolize its resources
The goal is to maximize the work (or play) that the user is
performing
In this case, the operating system is designed mostly for ease of
use, with some attention paid to performance and none
paid to resource utilization—how various hardware and software
resources are shared
Performance is, of course, important to the user; but rather than
resource utilization, such systems are optimized for the single-user
experience.
12
Real time systems
A real-time system is a computer system that requires not only that the computing
results be "correct" but also that the results be produced within a specified
deadline period
Results produced after the deadline has passed, even if correct, may be of no real
value.
To illustrate, consider an autonomous robot that delivers mail in an office complex.
If its vision-control system identifies a wall after the robot has walked into it,
despite correctly identifying the wall, the system has not met its requirement
In an interactive desktop computer system, it is desirable to provide a quick
response time to the interactive user, but it is not mandatory to do so .Many
traditional operating-system scheduling algorithms must be modified to meet the
stringent timing deadlin
Eg. Robots in factory in product packing, loading and unloading ,missile
explosion
.
.
.
13
…Real time systems
A multimedia system must be able to handle not only conventional
data, such as text files, programs, and word-processing documents,
but also multimedia data.
Multimedia data consist of continuous-media data (audio and video)
as well as conventional data
Continuous-media data—such as frames of video—must be delivered
according to certain time restrictions (for example, 30 frames per
second)
.The demands of handling continuous-media data require significant
changes in operating system
14
Embedded systems
An embedded system is a computing device that is part of a larger
system in which the presence of a computing device is often not
obvious to the user
They are designed for specific purpose and have limitted cpu,ram
They run on computers that control devices like digital
wristwatch,,mobiles,PDA w/c are not thought of as computers
An embedded product uses a microprocessor (or microcontroller) to
do one task and one task only
Are used for many applications in which cost, power consumption
and space are critical
A PC contains or is connected to various embedded products Each
one peripheral has a microcontroller inside it that performs only
one task by loading its application in to the RAM
15
Operating-System Structure
We can view an operating system from several
vantage points.
One view focuses on the services that the system
provides
another, on the interface that it makes available
to users and programmers
• third, on its components and their
interconnections
16
Os structure
(the users)…applications
shells and commands
compilers and interpreters
• :. • system libraries
18
Operating-System Operations(pg 72)
At the very least, we need two separate modes of
operation: user mode and kernel mode (also called
supervisor mode, system mode
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.
Whenever a trap or interrupt occurs, the hardware
switches from user mode to kernel mode
(that is, changes the state of the mode bit to 0). 19
….cont
Thus, whenever the operating
system gains control of the computer, it is in kernel
mode
The dual mode of operation provides us with the
means for protecting the operating system from
errant users—and errant users from one another
The hardware allows privileged instructions to be
executed only in kernel mode. If an attempt is
made to execute a privileged instruction in user
mode, the hardware does not execute the
instruction but rather treats it as illegal and traps it
to the operating system. 20
Systems calls
System calls provide the means for a user
program to ask the operating system to
perform tasks reserved for the operating
system on the user program's behalf
In all forms, it is the method used by a process
to request action by the operating system. A
system call usually takes the form of a trap to
a specific location in the interrupt vector
A system call usually takes the form of a trap
to a specific location in the interrupt vector
21
…cont
Control passes through the interrupt vector to a
service routine in the operating system, and the
mode bit is set to kernel mode
These errors are normally handled by the operating
system If a user program fails in some way—such
as by making an attempt either to execute an
illegal instruction or to access memory that is not
in the user's address space—then the hardware will
trap to the operating system
. The trap transfers control through the interrupt
vector to the operating system, just as
an interrupt does 22
…cont
The system call service routine is a part of the
operating system
.. The kernel examines the interrupting
instruction to determine what system call has
occurred
parameter indicates what type of service the
user program is requesting.
23
System call steps
• Example read system call
1. the read library procedure passes the parameters
to the called function
2.Then comes the actual call to the library
procedure w/c puts
3.Then a trap to the os is executed to shift from
the user mode to kernel and start execute call
4.The kernel examines the call numbers and
dispatches to the correct call handler
24
…system call
5. Once the system call handler completes, the
control returns to the user library space proc next
to the instruction that cause the trap returning the
required values
25
System call for file management
26
Computer Hardware Review (1)
Monitor
Bus
27
Computer Hardware Review (2)
28
Computer Hardware Review (3)
29
Computer Hardware Review (4)
30
Computer Hardware Review (5)
(a) (b)
32
Computer Hardware Review (7)
• A process tree
– A created two child processes, B and C
– B created three child processes, D, E, and F
34
Operating System Concepts (2)
• Before mounting,
– files on floppy are inaccessible
• After mounting floppy on b,
– files on floppy are part of file hierarchy
37
Operating System Concepts (5)
38
Steps in Making a System Call
40
Some System Calls For File Management
41
Some System Calls For Directory Management
42
Some System Calls For Miscellaneous Tasks
43
System Calls (1)
• A stripped down shell:
44
System Calls (2)
46
System Calls (4)
47
System Calls (5)
49
Operating System Structure (2)
51
Operating System Structure (4)
52
Operating System Structure (5)
53
Metric Units
54