Professional Documents
Culture Documents
Prepared by:
Mdm Nurul Ain Bt Amir Adli
Polytechnic Sultan Idris Shah, Selangor.
COURSE LEARNING OUTCOME
- Credits -
Continuation of previous
slide..
- Credits -
Basic Functions of OS
Organize OS components
Specify the privilege with which each
component executes.
Various OS Structure
1. Monolithic
2. Layered
3. Microkernel
4. Networked / distributed
Various OS Structure
1) Monolithic
The earliest and most common OS
Each component of the OS was contained within the kernel
Communicate directly with any other component
Have unrestricted system access
Operating system become very highly efficient
A Monolithic OS Structure
A Monolithic OS Structure
Various OS Structure
Monolithic - Disadvantage
Disadvantage:
2) Layered
OS become larger and more complex
Layered works by grouping components
that perform similar functions into layers.
Each layer only communicate to its
immediate upper and lower layer.
More modular than monolithic OS
The implementation of each layer can be
modified without requiring any
modification to other layers.
Various OS Structure
Layered
Layered approach overcome monolithic designs by:
Layered - Disadvantage
In layered approach, a user process’s request may need
to pass through many layers before it is serviced.
Performance degrades compare to monolithic, which
require only a single call to service a similar request.
Tend to damage due to erroneous code because all
layers have unrestricted access to the system.
Self Review
3) Microkernel
• Includes only a very small number of services
within the kernel and scalable.
• The services typically include low-level memory
management, inter-process communication and
basic process
• Synchronization to enable processes to
cooperate.
• Most operating system components, such as
process management and device
management, execute outside the kernel with a
lower level of system access.
Various OS Structure
Microkernel
• Microkernel are highly modular, making them
extensible, portable and scalable.
• One or more components can fail, without
causing the OS damage because
microkernel does not rely on each
component to execute.
• The disadvantage of microkernel
architecture is the increased level of inter-
module communication can decrease the
system performance.
• Example: Linux, Windows XP
A Microkernel OS Structure
A Microkernel OS Structure
Self Review
4) Networked
Enables its process to access resources (e.g.,
files) that reside on other independent
computers on a network.
The structure of many networked & distributed
OS based on client/server model.
Network File System (NFS) are an important component of
networked OS.
allowing a user on a client computer to access files over a network
Example: Sun’s Network File System
How client/server works?
How client/server works?
Various OS Structure
Distributed
Is a single OS that manages resources on more than one OS.
Provide the illusion that multiple PC are a single powerful
computer
Hence, a process can access all of the system’s resources
regardless where the location is.
Difficult to implement & require complicated algorithms to
enable process to communicate & share data.
Examples:
MIT’s Chord OS
Amoeba OS from Vrije Universiteit (VU) in Amsterdam.
Various OS Structure
Distributed Operating system
A distributed operating system is the logical
aggregation of operating system software over
a collection of
independent, networked, communicating, and
spatially distributing computational nodes.
Individual system nodes each hold a discrete
software subset of the global aggregate
operating system.
Each node-level software subset is a
composition of two distinct service provider.
Processing is carried out independently in more
than one location, but with shared and
controlled access to some common facilities.
Networked vs Distributed
1. Multitasking
2. Multiprogramming
3. Time sharing
4. Buffering
5. Spooling
6. Caching
1. Multitasking:
- Several processes appear to be running at the same time.
- The type of operating system most people use on their desktop and
laptop computers today.
- Example: Microsoft's Windows and Apple's MacOS platforms.
- For example, it's possible for user to be writing a note in a word
processor while downloading a file from the Internet while printing
the text of an e-mail message.
is a method where multiple tasks (known as processes) share
common processing resources (cth: CPU).
In the case of a computer with a single CPU, only one task is said
to be running at any point in time, meaning that the CPU is
actively executing instructions for that task.
Multitasking solves the problem by scheduling which task may be
the one running at any given time, and when another waiting
task gets a turn.
The act of reassigning a CPU from one task to another one is
called a context switch.
When context switches occur frequently enough the illusion of
parallelism is achieved.
Even on computers with more than one CPU (called
multiprocessor machines), multitasking allows many more tasks to
be run than there are CPUs.
2. Multiprogramming
- The concept of loading many programs at one time to share a
single CPU.
- A technique that allows a single processor to process several
programs residing simultaneously in main memory.
- Only allows each program to use only a preset slice of CPU time.
- Are designed to maximize the CPU usage.
This idea is common in other life situations. A lawyer does not
work for only one client at a time, for example.
While one case is waiting to go to trial or have papers typed,
the lawyer can work on another case.
If he has enough clients, the lawyer will never be idle for lack of
work. (Idle lawyers tend to become politicians, so there is a
certain social value in keeping lawyers busy.)
3. Time sharing
- is the sharing of a computing resource among many users by
means of multiprogramming and multi-tasking.
Advantages:
- allows a large number of users to interact concurrently with a
single computer can lowered the cost of providing computing
capability.
the CPU executes multiple jobs by switching among them, but
the switches occur so frequently that the users can interact with
each program while it is running.
4. Buffering
A memory area that stores data being transferred between two
devices or between a device and an application
The purpose of most buffers is:
to act as a holding area
enabling the CPU to manipulate data before transferring it to a device.
to cope with a speed mismatch between the producer and consumer
of a data stream.
to provide adaptations for devices that have different data-transfer
sizes.
- For example, word processors use a buffer to keep track of changes
to files.
- when you save the file, the word processor updates the disk file with
the contents of the buffer.
- More efficient than accessing the file on the disk each time you
make a change to the file.
Device transfer rates
5. Spooling
Spool is an acronym for Simultaneous Peripheral Operation On-
Line.
Is a buffer that holds output for a device, such as a printer, that
cannot accept interleaved data streams.
A technique developed to speed I/O by collecting in a disk file
either input received from slow input devices, or output going
to slow output devices such as printers.
Spooling minimizes the waiting done by the processes
performing the I/O.
Spooling illustration
6. Caching
A cache is a component that transparently stores data so
that future requests for that data can be served faster.
Caches are small, hence, it is cost efficient as well as the
use of data.
Cache can be found in CPU, Disk and Web.
For CPU cache, it is a small memories on CPU or close to
CPU, it is faster than main memory (RAM). It is managed by
hardware.
For Disk cache, the example is the page cache in main
memory, is managed by software (OS Kernel).
Differences between
spooling, caching, buffering
Differences Buffering Spooling Caching
1. Definition
2. Example
2. Give a situation of
multiprogramming when someone is
using a computer. (2 marks).
Components of OS
1. Kernel
2. Shell
3. File system
a) Kernel
The part of the operating system that resides in the main memory
at all times and performs the most essential tasks, such as
managing memory and handling disk input and output.
b) Shell
Technically known as the command interpreter.
The main function of the command interpreter is to get and
execute the next user-specified command.
Example of commands: create, delete, list, print, copy, execute.
Example of shells in Linux:
Bash shell (Bourne Again Shell)
Csh shell
Ksh shell.
c) File system
A file system is the way in which files are named and where they
are placed logically for storage and retrieval.
For example, Windows, Macintosh and Linux operating systems
all have file systems in which files are placed somewhere in a
hierarchical (tree) structure.
A file is placed in a directory (folder in Windows) or subdirectory
at the desired place in the tree structure.
File systems are used on data storage devices such as:
hard disk drives
floppy disks
flash memory
Self Review
A place where user can enter the input, such as username, and
it will be sent to the database of the server.
Usually in web-based application, such as login page, online
registration form, online shopping, online fund transfer.
What is System Calls?