SlideShare a Scribd company logo
1 of 42
Download to read offline
Operating-System Structures
System Components
Operating System Services
System Calls
System Programs
System Structure
Virtual Machines
System Design and Implementation
System Generation
Common System Components
Process Management
Main Memory Management
File Management
I/O-System Management
Secondary-Storage Management
Networking
Protection System
Command-Interpreter System
Process Management
A process is a program in execution. A process is an active entity.
A process needs certain resources, including CPU time, memory, files,
and I/O devices, to accomplish its task.
Initialization data is also passed for execution of a process.
A program can have many processes as it runs.
System processes execute OS code whereas user processes execute
user code.
OS reclaims reusable resources from the process on its termination.
The OS is responsible for the following activities in connection with
process management:
Process creation and deletion.
process suspension and resumption.
Provision of mechanisms for:
process synchronization
process communication
deadlock handling
Main-Memory Management
Memory is a large array of words or bytes, each with its own address. It is a
repository of quickly accessible data shared by the CPU and I/O devices.
Main memory is a volatile storage device. It loses its contents in the case of
system failure.
The I/O operations implemented via DMA also read and write in memory.
Main-memory is frequently addressed by CPU for accessing instructions and
data from memory during program execution.
Different memory-management techniques are used to keep several
programs in memory for improving CPU utilization and response time.
An appropriate memory-management scheme is used for a specific
hardware design of the system.
The operating system is responsible for the following activities in connection
with memory management:
Keep track of which parts of memory are currently being used and by whom.
Decide which processes to be loaded when memory space becomes available.
Allocate and deallocate memory space as needed.
File Management
A file is a collection of related information defined by its creator. Commonly,
files represent programs (both source and object forms) and data.
Computers can store files on HD, OD or magnetic tape/ drum. Each media
has its own characteristics, device controller and properties such as access
speed, capacity, data-transfer rate, and access-method (random or
sequential).
OS maps files (logical storage units) onto physical media and accesses
these files via the storage devices.
OS manages the mass storage media and the devices that control them and
provides protection to files in multi-user environment.
The operating system is responsible for the following activities in connection
with file management:
File creation and deletion.
Directory creation and deletion.
Support of primitives for manipulating files and directories.
Mapping files onto secondary storage.
File backup on stable (nonvolatile) storage media.
I/O System Management
OS hides the peculiarities of specific hardware of I/O devices
from the user.
The I/O system consists of:
A memory-management component that includes buffereing, caching,
and spooling.
A general device-driver interface.
Drivers for specific hardware devices.
The device-driver knows the peculiarities of the specific
device to which it is assigned.
Interrupt handlers and device drivers are used in the
construction of efficient I/O subsystems.
The I/O subsystem interfaces to other system components,
manages devices, transfers data, and detects I/O completion.
Secondary-Storage Management
Since main memory (primary storage) is volatile and too small to
accommodate all data and programs permanently, the computer
system must provide secondary storage to back up main memory.
Secondary-storage devices are used to store data and programs of
the users.
Application programs (compilers, assemblers, editors, AutoCAD
etc.) are commonly available on CDs, HDs, ODs, Tapes, Drum,
USBs etc.
Most modern computer systems use disks as the principal on-line
storage medium, for both programs and data.
OS uses optimal techniques for secondary-storage management in
order to increase its efficiency.
The operating system is responsible for the following activities in
connection with disk management:
Free space management.
Storage allocation.
Disk scheduling.
Networking (Distributed Systems)
A distributed system is a collection of processors (PCs, workstations,
minicomputers, large and general purpose computer systems) that do not
share memory or a clock. Each processor has its own local memory and
clock.
The processors in the system are connected through communication lines
(high speed buses or networks).
Communication takes place using a protocol (FTP, NFS, TCP/IP) which have
a great effect on the system’s utility and popularity.
The communication network design considers routing, connection strategies,
problems of contention, and security.
Os provides network access using network interface’s device drivers.
A distributed system provides user access to various system resources.
WWW provides a new access method for information sharing using http - for
use in communication between a web server and a web browser.
Access to a shared resource allows:
Computation speed-up.
Increased functionality.
Increased data availability.
Enhanced reliability.
Protection System
Users must be protected during the concurrent execution
of multiple processes.
OS’s authorization is required to utilize the resources (i.e.
files, memory segments, CPU, plotters, printers, tapes).
Different mechanisms are used to provide to different
resources.
Protection refers to a mechanism for controlling access
by programs, processes, or users to both system and
user resources.
The protection mechanism must:
distinguish between authorized and unauthorized usage.
specify the controls to be imposed.
provide a means of enforcement.
Improves reliability by detecting errors at an early
stage.
Command-Interpreter System
Most important system component being an interface between the user
and OS.
In some systems it is in the kernel while in other OSs (MS DOS, UNIX),
it is a special program that runs when a job is initiated or when user
logs-on.
Named as command.com in MSDOS and shell in UNIX. In these
OSs, commands are typed and entered for execution by the user.
In latest OSs, User-friendly interface style has been incorporated to
facilitate the users.
Many commands are given to the operating system by control
statements which deal with:
process creation and management
I/O handling
secondary-storage management
main-memory management
file-system access
protection
networking
Operating System Services
OS services for convenience of the users/programmers:-
Program execution – system capability to load a program into memory, run, and
end it normally or abnormally.
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 approaches.
Error detection – ensures correct computing by detecting errors in the CPU and
memory hardware, in I/O devices, or in user programs.
OS services for ensuring efficient system operations:-
Resource allocation – allocating resources to multiple users or multiple jobs
running at the same time.
Accounting – keep track of which users use how many and which kinds of
computer resources for account billing or for accumulating usage statistics.
Protection – ensuring that all access to system resources is controlled.
System Calls
System calls provide the interface between a process and the OS:
Generally available as assembly-language instructions.
Languages defined to replace assembly language for systems programming allow
system calls to be made directly (e.g., C, C++).
A system call is used to complete a specific task:
Reading input file name
Opening a file
Error message if any
Abnormal termination
Deletion of a file
Prompting a message
Reading data for the file
Writing data to the file or console
Closing the file
Normal termination
Three general methods are used to pass parameters between a running
program and the operating system:
Pass parameters in registers.
Store the parameters in a table in memory, and the table address is passed as a
parameter in a register (used in linux)
Push (store) the parameters onto the stack by the program, and pop off the stack by
OS.
Passing of Parameters as a Table
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 memory, Free memory
File management
Create file, Delete file
Open, Close
Read, Write, Reposition
Get file attributes, Set file attributes
Device management
Request device, Release device
Read, Write, Reposition
Get device attributes, Set device attributes
Logically attach devices, Logically detach devices
Types of System Calls
Information maintenance
Get time or date, Set time or date
Get system data, Set system data
Get process, file, or device attributes, Set process, file, or device
attributes
Communications
Create communication connection, Delete communication
connection
Send messages, Receive messages
Transfer status information
Attach remote devices, Detach remote devices
MS-DOS Execution
At System Start-up Running a Program
UNIX Running Multiple Programs
Communication Models
Message Passing Shared Memory
Communication may take place using either message
passing or shared memory.
System Programs
System programs are user interfaces to system calls and provide a
convenient environment for program development and execution.
Categories of system programs are :-
File Manipulation – used for creating, deleting, renaming, printing, dumping,
listing, and generally manipulating files and directories.
Status Information – ask the system for date, time, available memory/disk, used
memory/disk, number of users etc.
File Modification – text editors to create and modify the content of files stored
on disk or tape.
Programming Language Support – compilers, assemblers, and interpreters for
common programming languages are provided to the user with the OS.
Program Loading and Execution – OS may provide absolute loaders,
relocatable loaders, linkage editors, and debuggers for program loading and
execution.
Communications – provide mechanism for creating virtual connections among
processes, users, and different computer systems which allows message
passing, browse web pages, send e-mail messages, log-in remotely, transfer
files from one machine to another.
Application Programs or System Utilities – many OSs are supplied with
system utilities or application programs (i.e. web browsers, word processors, text
formatters, spreadsheets, database systems) to perform common operations.
System Programs
Most users’ view of the operation system is defined by system programs, not
by the actual system calls.
Command-interpreter is the most important system program and can be
implemented in two ways:-
Schemes of commands implementation are:
 Command interpreter itself contains the code to execute the commands,
jumps to a section of its code that sets up the parameters, and makes the
appropriate system call.
 Advantages: faster execution; easy to use by the programmers.
 Disadvantages: bigger size of the command-interpreter; needs
changes for new commands.
 All commands are implemented through special system programs.
Command file is loaded in the memory and executed.
 Advantages : small size of command interpreter; not changed for
new commands, new commands can be incorporated easily.
 Disadvantages : clumsy task of passing parameters from the
command-interpreter to the system program; slower in loading and
execution; misinterpretation of the command parameters as they are
designed and implemented at different times by different
programmers.
Simple System Structure
(MS-DOS)
MS-DOS was written to
provide the most
functionality in the least
space.
It was not divided into
modules carefully.
Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not well
separated.
UNIX – limited by hardware functionality, the original
UNIX operating system had limited structuring. The UNIX
OS consists of two separable parts:
Systems programs
Systems programs are provided to define the user interface.
The kernel
Consists of everything below the system-call interface and
above the physical hardware.
Separated into a series of interfaces and device drivers.
Different components (file system, CPU scheduling, memory
management and other OS functions) were layered in its
design.
OS may provide smaller modules for much greater control of
computer resources, incorporating changes in the separate
modules easily to enhance functionality and hide information in
different components.
Simple System Structure
(UNIX)
UNIX System Structure
Layered Approach
The operating system is divided into a number of layers (levels),
each built on top of lower layers. The bottom layer (layer 0) is
the hardware; the highest (layer N) is the user interface.
With modularity, layers are selected such that each uses
functions (operations) and services of only lower-level layers.
OS has a greater control over the computer resources and
applications that make use of it.
Provides more freedom to the implementers to make changes
in the inner workings of the system.
Provides information hiding by allowing the programmers to
implement the low-level routines using top-down modular
programming approach.
Layered approach is used for modularization of the OS.
Higher-level layers can invoke lower-level layers.
Less number of layers provide more functionality at each level
while reducing the problems.
Layered Approach
Advantages: modularization makes debugging and
verification much easier; design and implementation
is simplified; each layer hides certain data structures,
operations and hardware details from higher-level
layers.
Disadvantages: level definition and implementation is
very difficult; order of levels for the design of layered
structure is problematical; interaction between layers
and passing of parameters / data is very complex;
less efficient as a system call takes longer time for
execution than a non-layered system.
Examples: Technische Hogeschool Eindhoven (THE)
OS and Venus layer structure.
An Operating System Layer
Level 5: User programs
Level 4: buffering for input and output devices
Level 3: operator-console device driver
Level 2: memory management
Level 1: CPU scheduling
Level 0: hardware
Figure : THE layer structure
Level 6: User programs
Level 5: device drivers and schedulers
Level 4: virtual memory
Level 3: I/O channel
Level 2: CPU scheduling
Level 1: instruction interpreter
Level 0: hardware
Figure : Venus layer structure
Layered Approach
OS/2 provides multitasking and dual mode
operation on more powerful hardware.
OS/2 does not provide direct user access to low-
level facilities like DOS, OS has more control over
the hardware, and has more information about
usage of resources.
Windows NT 4.0 has increased its performance by
moving layers from user space to kernel space and
closely integrating them.
OS/2 Layer Structure
Microkernel System Structure
Larger kernels need more space and are difficult to manage.
Microkernel approach moves all non-essential components from the
kernel and implements them as system-level programs and user-
level programs, moving as much from the kernel into “user” space.
Microkernel provides minimal process memory management and
communication facility.
Microkernel provides communication facility through message-
passing between the client program and various services that are
also running in the user space.
Microkernel provides indirect communication between the client
program and the service.
Benefits:
 easier to extend a microkernel
 fewer changes required in the modification of microkernel
 easier to port the operating system to new architectures
 more reliable (less code is running in kernel mode)
 more secure – if a routine fails, the rest of the OS remains untouched
Windows NT Client-Server Structure
Virtual Machines
The layered approach is taken to its logical conclusion in
the concept of a virtual machine.
The virtual machine concept treats the kernel of the OS
and the hardware though they were all hardware.
System programs treat hardware instructions and system
calls as they were at the same level. Application
programs can also call system programs.
A virtual machine provides an interface identical to the
underlying bare hardware.
The operating system creates the illusion of multiple
processes, each executing on its own processor with its
own (virtual) memory.
Virtual Machines
The resources of the physical computer are shared to create the virtual
machines:
CPU scheduling can create the appearance that users have their
own processor.
Spooling and a file system can provide virtual card readers and
virtual line printers.
A normal user time-sharing terminal serves as the virtual machine
operator’s console.
A virtual machine has virtual memory, virtual disks, virtual printer, virtual
console, virtual processor and virtual communication network.
A user can run any type of software package on his/her virtual machine.
The virtual machine software is concerned with multiprogramming
multiple virtual machines onto a physical machine.
Virtual disks (minidisks) are difficult to implement in a virtual machine.
A lot of effort is required to provide an exact duplicate of the underlying
machine.
Virtual user mode and virtual monitor mode run in the physical user
mode.
Virtual Machines
Advantages
The virtual-machine concept provides complete protection of
system resources since each virtual machine is isolated from all
other virtual machines.
A virtual-machine system is a perfect vehicle for operating-
systems research and development. System development is
done on the virtual machine, instead of on a physical machine
and so does not disrupt normal system operation.
Virtual machines are useful for solving system compatibility
problems.
Disadvantages
No direct sharing of resources as each virtual machine is
isolated from all other virtual machines.
The virtual machine concept is difficult to implement due to the
effort required to provide an exact duplicate to the underlying
machine.
The privileged instructions (needed mainly for I/O) must be
simulated and hence execute more slowly.
System Models
Non-virtual Machine Virtual Machine
Java Virtual Machine
In addition to a language specification and a large API library, Java
also provides a specification for a Java Virtual Machine (JVM).
For each Java class, the Java compiler produces an architecture-
neutral bytecode output (.class) file that will run on any implementation
of the JVM.
JVM consists of:
- class loader
- class verifier
- runtime interpreter
The Java interpreter may be a software module that interprets the
byte-codes one at a time, or it may be a Just-In-Time (JIT) compiler
that turns the architecture-neutral bytecodes into native machine
language for the host computer.
Most implementations of the JVM use a JIT compiler for enhanced
performance.
JVM design provides a secure, efficient, object-oriented, portable, and
architecture-neutral platform on which to run Java programs.
Java Virtual Machine
System Design Goals
System goals and specifications are required to be
defined for the design of OS.
Choice of hardware and type of OS to be decided.
Requirements of OS can be divided in two groups:
Goals desired by users: the system should be
convenient and easy to use; easy to learn; reliable;
safe, and fast.
Goals desired by programmers / designers: easy
to design, implement, maintain and operate; it should
be flexible; reliable; error free, and efficient.
The wide range of systems shows that different
requirements can result in a large variety of solutions for
different environments.
System Mechanisms and Policies
Mechanisms determine how to do something and
policies decide what will be done.
Timer used in the CPU protection is a mechanism and
the time to be set for a particular user is a policy
decision.
Mechanisms and policies should be treated separately
– an important principle. Policies do change from time
to time or place to place but mechanisms rarely
change.
Policy-independent mechanisms are incorporated for
flexibility.
Policy decisions must be made for all resource-
allocation and scheduling problems.
System Implementation
Designed OS is implemented using either assembly language or a high
level language. Both languages can be used in the implementation of
an OS.
Traditionally written in assembly language, operating systems can now
be written in higher-level languages (MCP in ALGOL, MULTICS in PL/1
PRIMOS in FORTRAN, and Unix, OS/2 and Windows in C).
Advantages of using a high level language: code writing is much
faster; more compact; easier to understand; easier to debug; OS is far
easier to port; better data structures and algorithms provide
performance improvements.
Disadvantages of using a high level language: reduced speed, and
increased storage requirements.
The most critical or bottleneck routines (memory manager, CPU
scheduler) can be written in assembly language for obtaining better
performance with small code.
Trace listings of system behaviour (using log file or real time approach)
and analysis program help to identify bottlenecks and inefficiencies.
System Generation (SYSGEN)
As the OSs are designed to run on any of a class of machines at a
variety of sites with a variety of peripheral configurations, the system
must be configured or generated for each specific computer site. This
process is known as SYSGEN.
The SYSGEN program reads from a file or asks the operator for
following information concerning the specific configuration of the
hardware system or probes the hardware directly to determine the
type of components:
CPU type: options for instruction sets; description of each CPU
for multiple CPU systems.
Memory: total memory, available memory - normally determined
by the system.
Devices: total devices, system needs to know the device number,
the device interrupt number, type and model of each device.
Options: Desired options of the OS and parameters values
needed (buffers and their sizes, CPU scheduling algorithm,
maximum number of processes to be supported).
System Generation Approaches
Approaches
The source code of the OS is modified and the OS is completely compiled
to meet requirements of the described system – fully tailored OS (one
extreme).
The system description could cause the creation of tables and the selection
of modules from a precompiled library. These modules would be linked to
form the generated OS. SYSGEN is faster but has more generality that was
actually needed.
A completely table driven system can be constructed. All the code would
always be a part of the system and selection would occur at execution time,
not at a compile or link time – another extreme.
The major differences among these approaches are the size,
generality of the generated system, and the ease of modification as the
hardware configuration changes.
Bootstrap program or Bootstrap loader locates the kernel, loads it into
main memory and starts the execution. So OS is made available for use
by the hardware and users.

More Related Content

What's hot

Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O SystemsWayne Jones Jnr
 
Processor architecture
Processor architectureProcessor architecture
Processor architectureMuuluu
 
Operating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputOperating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputPeter Tröger
 
Бие даалт
Бие даалтБие даалт
Бие даалтMuuluu
 
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001SOLOMONCHINAEMEUCHEA
 
Unit 2 processor&memory-organisation
Unit 2 processor&memory-organisationUnit 2 processor&memory-organisation
Unit 2 processor&memory-organisationPavithra S
 
os assignment -individual presenation.pptx
os assignment -individual presenation.pptxos assignment -individual presenation.pptx
os assignment -individual presenation.pptxEngrAliSarfrazSiddiq
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsDr.YNM
 
Computer Structures
Computer StructuresComputer Structures
Computer Structuresguestfc2f62
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networkingArul Kumar
 

What's hot (18)

Ch2
Ch2Ch2
Ch2
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Processor architecture
Processor architectureProcessor architecture
Processor architecture
 
Ch1 introduction
Ch1   introductionCh1   introduction
Ch1 introduction
 
Unit 6
Unit 6Unit 6
Unit 6
 
I/O Management
I/O ManagementI/O Management
I/O Management
 
Ch8
Ch8Ch8
Ch8
 
Module1
Module1Module1
Module1
 
Co notes3 sem
Co notes3 semCo notes3 sem
Co notes3 sem
 
Operating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / OutputOperating Systems 1 (11/12) - Input / Output
Operating Systems 1 (11/12) - Input / Output
 
Бие даалт
Бие даалтБие даалт
Бие даалт
 
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
HHCJ AMUMARA: COMPUTER STUDIES LECTURE NOTE FOR SS2-001
 
Unit 2 processor&memory-organisation
Unit 2 processor&memory-organisationUnit 2 processor&memory-organisation
Unit 2 processor&memory-organisation
 
os assignment -individual presenation.pptx
os assignment -individual presenation.pptxos assignment -individual presenation.pptx
os assignment -individual presenation.pptx
 
Ch12 io systems
Ch12   io systemsCh12   io systems
Ch12 io systems
 
UNIT-I-RTOS and Concepts
UNIT-I-RTOS and ConceptsUNIT-I-RTOS and Concepts
UNIT-I-RTOS and Concepts
 
Computer Structures
Computer StructuresComputer Structures
Computer Structures
 
Embedded networking
Embedded networkingEmbedded networking
Embedded networking
 

Similar to operating system structure

ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.pptdivyang32
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OSC.U
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mndejenehundaol91
 
installing and optimizing operating system software
installing and optimizing operating system software   installing and optimizing operating system software
installing and optimizing operating system software Jaleto Sunkemo
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating systemDeepikaT13
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxPRABAVATHIH
 
16. Computer Systems Basic Software 2
16. Computer Systems   Basic Software 216. Computer Systems   Basic Software 2
16. Computer Systems Basic Software 2New Era University
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating SystemSoumit Ghosh
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxThamaraiselviAvinuty
 
System components (os)
System components (os)System components (os)
System components (os)snegacmr
 
01 operating systems final
01 operating systems final01 operating systems final
01 operating systems finalAman Garg
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptKirti Verma
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System StructuresCloudbells.com
 
Fundamental concepts and_principles_of_operating_systems (2)
Fundamental concepts and_principles_of_operating_systems (2)Fundamental concepts and_principles_of_operating_systems (2)
Fundamental concepts and_principles_of_operating_systems (2)DanaAlexander13
 

Similar to operating system structure (20)

operating system structure
operating system structureoperating system structure
operating system structure
 
ch3 - operating system structures.ppt
ch3 - operating system structures.pptch3 - operating system structures.ppt
ch3 - operating system structures.ppt
 
Ch3
Ch3Ch3
Ch3
 
Ch3 OS
Ch3 OSCh3 OS
Ch3 OS
 
OSCh3
OSCh3OSCh3
OSCh3
 
OS_Ch3
OS_Ch3OS_Ch3
OS_Ch3
 
Os structure
Os structureOs structure
Os structure
 
chapter 3 opreating system lecture note and its is impaortamt concept for mn
chapter 3 opreating system  lecture note and its is impaortamt concept for mnchapter 3 opreating system  lecture note and its is impaortamt concept for mn
chapter 3 opreating system lecture note and its is impaortamt concept for mn
 
installing and optimizing operating system software
installing and optimizing operating system software   installing and optimizing operating system software
installing and optimizing operating system software
 
Storage management in operating system
Storage management in operating systemStorage management in operating system
Storage management in operating system
 
OS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptxOS UNIT 1 PPT.pptx
OS UNIT 1 PPT.pptx
 
16. Computer Systems Basic Software 2
16. Computer Systems   Basic Software 216. Computer Systems   Basic Software 2
16. Computer Systems Basic Software 2
 
Basics of Operating System
Basics of Operating SystemBasics of Operating System
Basics of Operating System
 
Introduction of operating system
Introduction of operating systemIntroduction of operating system
Introduction of operating system
 
Unit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptxUnit 1-Operating Systems Overview .pptx
Unit 1-Operating Systems Overview .pptx
 
System components (os)
System components (os)System components (os)
System components (os)
 
01 operating systems final
01 operating systems final01 operating systems final
01 operating systems final
 
L-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.pptL-3 BCE OS FINAL.ppt
L-3 BCE OS FINAL.ppt
 
Operating-System Structures
Operating-System StructuresOperating-System Structures
Operating-System Structures
 
Fundamental concepts and_principles_of_operating_systems (2)
Fundamental concepts and_principles_of_operating_systems (2)Fundamental concepts and_principles_of_operating_systems (2)
Fundamental concepts and_principles_of_operating_systems (2)
 

Recently uploaded

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 

Recently uploaded (20)

Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 

operating system structure

  • 1. Operating-System Structures System Components Operating System Services System Calls System Programs System Structure Virtual Machines System Design and Implementation System Generation
  • 2. Common System Components Process Management Main Memory Management File Management I/O-System Management Secondary-Storage Management Networking Protection System Command-Interpreter System
  • 3. Process Management A process is a program in execution. A process is an active entity. A process needs certain resources, including CPU time, memory, files, and I/O devices, to accomplish its task. Initialization data is also passed for execution of a process. A program can have many processes as it runs. System processes execute OS code whereas user processes execute user code. OS reclaims reusable resources from the process on its termination. The OS is responsible for the following activities in connection with process management: Process creation and deletion. process suspension and resumption. Provision of mechanisms for: process synchronization process communication deadlock handling
  • 4. Main-Memory Management Memory is a large array of words or bytes, each with its own address. It is a repository of quickly accessible data shared by the CPU and I/O devices. Main memory is a volatile storage device. It loses its contents in the case of system failure. The I/O operations implemented via DMA also read and write in memory. Main-memory is frequently addressed by CPU for accessing instructions and data from memory during program execution. Different memory-management techniques are used to keep several programs in memory for improving CPU utilization and response time. An appropriate memory-management scheme is used for a specific hardware design of the system. The operating system is responsible for the following activities in connection with memory management: Keep track of which parts of memory are currently being used and by whom. Decide which processes to be loaded when memory space becomes available. Allocate and deallocate memory space as needed.
  • 5. File Management A file is a collection of related information defined by its creator. Commonly, files represent programs (both source and object forms) and data. Computers can store files on HD, OD or magnetic tape/ drum. Each media has its own characteristics, device controller and properties such as access speed, capacity, data-transfer rate, and access-method (random or sequential). OS maps files (logical storage units) onto physical media and accesses these files via the storage devices. OS manages the mass storage media and the devices that control them and provides protection to files in multi-user environment. The operating system is responsible for the following activities in connection with file management: File creation and deletion. Directory creation and deletion. Support of primitives for manipulating files and directories. Mapping files onto secondary storage. File backup on stable (nonvolatile) storage media.
  • 6. I/O System Management OS hides the peculiarities of specific hardware of I/O devices from the user. The I/O system consists of: A memory-management component that includes buffereing, caching, and spooling. A general device-driver interface. Drivers for specific hardware devices. The device-driver knows the peculiarities of the specific device to which it is assigned. Interrupt handlers and device drivers are used in the construction of efficient I/O subsystems. The I/O subsystem interfaces to other system components, manages devices, transfers data, and detects I/O completion.
  • 7. Secondary-Storage Management Since main memory (primary storage) is volatile and too small to accommodate all data and programs permanently, the computer system must provide secondary storage to back up main memory. Secondary-storage devices are used to store data and programs of the users. Application programs (compilers, assemblers, editors, AutoCAD etc.) are commonly available on CDs, HDs, ODs, Tapes, Drum, USBs etc. Most modern computer systems use disks as the principal on-line storage medium, for both programs and data. OS uses optimal techniques for secondary-storage management in order to increase its efficiency. The operating system is responsible for the following activities in connection with disk management: Free space management. Storage allocation. Disk scheduling.
  • 8. Networking (Distributed Systems) A distributed system is a collection of processors (PCs, workstations, minicomputers, large and general purpose computer systems) that do not share memory or a clock. Each processor has its own local memory and clock. The processors in the system are connected through communication lines (high speed buses or networks). Communication takes place using a protocol (FTP, NFS, TCP/IP) which have a great effect on the system’s utility and popularity. The communication network design considers routing, connection strategies, problems of contention, and security. Os provides network access using network interface’s device drivers. A distributed system provides user access to various system resources. WWW provides a new access method for information sharing using http - for use in communication between a web server and a web browser. Access to a shared resource allows: Computation speed-up. Increased functionality. Increased data availability. Enhanced reliability.
  • 9. Protection System Users must be protected during the concurrent execution of multiple processes. OS’s authorization is required to utilize the resources (i.e. files, memory segments, CPU, plotters, printers, tapes). Different mechanisms are used to provide to different resources. Protection refers to a mechanism for controlling access by programs, processes, or users to both system and user resources. The protection mechanism must: distinguish between authorized and unauthorized usage. specify the controls to be imposed. provide a means of enforcement. Improves reliability by detecting errors at an early stage.
  • 10. Command-Interpreter System Most important system component being an interface between the user and OS. In some systems it is in the kernel while in other OSs (MS DOS, UNIX), it is a special program that runs when a job is initiated or when user logs-on. Named as command.com in MSDOS and shell in UNIX. In these OSs, commands are typed and entered for execution by the user. In latest OSs, User-friendly interface style has been incorporated to facilitate the users. Many commands are given to the operating system by control statements which deal with: process creation and management I/O handling secondary-storage management main-memory management file-system access protection networking
  • 11. Operating System Services OS services for convenience of the users/programmers:- Program execution – system capability to load a program into memory, run, and end it normally or abnormally. 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 approaches. Error detection – ensures correct computing by detecting errors in the CPU and memory hardware, in I/O devices, or in user programs. OS services for ensuring efficient system operations:- Resource allocation – allocating resources to multiple users or multiple jobs running at the same time. Accounting – keep track of which users use how many and which kinds of computer resources for account billing or for accumulating usage statistics. Protection – ensuring that all access to system resources is controlled.
  • 12. System Calls System calls provide the interface between a process and the OS: Generally available as assembly-language instructions. Languages defined to replace assembly language for systems programming allow system calls to be made directly (e.g., C, C++). A system call is used to complete a specific task: Reading input file name Opening a file Error message if any Abnormal termination Deletion of a file Prompting a message Reading data for the file Writing data to the file or console Closing the file Normal termination Three general methods are used to pass parameters between a running program and the operating system: Pass parameters in registers. Store the parameters in a table in memory, and the table address is passed as a parameter in a register (used in linux) Push (store) the parameters onto the stack by the program, and pop off the stack by OS.
  • 13. Passing of Parameters as a Table
  • 14. 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 memory, Free memory File management Create file, Delete file Open, Close Read, Write, Reposition Get file attributes, Set file attributes Device management Request device, Release device Read, Write, Reposition Get device attributes, Set device attributes Logically attach devices, Logically detach devices
  • 15. Types of System Calls Information maintenance Get time or date, Set time or date Get system data, Set system data Get process, file, or device attributes, Set process, file, or device attributes Communications Create communication connection, Delete communication connection Send messages, Receive messages Transfer status information Attach remote devices, Detach remote devices
  • 16. MS-DOS Execution At System Start-up Running a Program
  • 18. Communication Models Message Passing Shared Memory Communication may take place using either message passing or shared memory.
  • 19. System Programs System programs are user interfaces to system calls and provide a convenient environment for program development and execution. Categories of system programs are :- File Manipulation – used for creating, deleting, renaming, printing, dumping, listing, and generally manipulating files and directories. Status Information – ask the system for date, time, available memory/disk, used memory/disk, number of users etc. File Modification – text editors to create and modify the content of files stored on disk or tape. Programming Language Support – compilers, assemblers, and interpreters for common programming languages are provided to the user with the OS. Program Loading and Execution – OS may provide absolute loaders, relocatable loaders, linkage editors, and debuggers for program loading and execution. Communications – provide mechanism for creating virtual connections among processes, users, and different computer systems which allows message passing, browse web pages, send e-mail messages, log-in remotely, transfer files from one machine to another. Application Programs or System Utilities – many OSs are supplied with system utilities or application programs (i.e. web browsers, word processors, text formatters, spreadsheets, database systems) to perform common operations.
  • 20. System Programs Most users’ view of the operation system is defined by system programs, not by the actual system calls. Command-interpreter is the most important system program and can be implemented in two ways:- Schemes of commands implementation are:  Command interpreter itself contains the code to execute the commands, jumps to a section of its code that sets up the parameters, and makes the appropriate system call.  Advantages: faster execution; easy to use by the programmers.  Disadvantages: bigger size of the command-interpreter; needs changes for new commands.  All commands are implemented through special system programs. Command file is loaded in the memory and executed.  Advantages : small size of command interpreter; not changed for new commands, new commands can be incorporated easily.  Disadvantages : clumsy task of passing parameters from the command-interpreter to the system program; slower in loading and execution; misinterpretation of the command parameters as they are designed and implemented at different times by different programmers.
  • 21. Simple System Structure (MS-DOS) MS-DOS was written to provide the most functionality in the least space. It was not divided into modules carefully. Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated.
  • 22. UNIX – limited by hardware functionality, the original UNIX operating system had limited structuring. The UNIX OS consists of two separable parts: Systems programs Systems programs are provided to define the user interface. The kernel Consists of everything below the system-call interface and above the physical hardware. Separated into a series of interfaces and device drivers. Different components (file system, CPU scheduling, memory management and other OS functions) were layered in its design. OS may provide smaller modules for much greater control of computer resources, incorporating changes in the separate modules easily to enhance functionality and hide information in different components. Simple System Structure (UNIX)
  • 24. Layered Approach The operating system is divided into a number of layers (levels), each built on top of lower layers. The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface. With modularity, layers are selected such that each uses functions (operations) and services of only lower-level layers. OS has a greater control over the computer resources and applications that make use of it. Provides more freedom to the implementers to make changes in the inner workings of the system. Provides information hiding by allowing the programmers to implement the low-level routines using top-down modular programming approach. Layered approach is used for modularization of the OS. Higher-level layers can invoke lower-level layers. Less number of layers provide more functionality at each level while reducing the problems.
  • 25. Layered Approach Advantages: modularization makes debugging and verification much easier; design and implementation is simplified; each layer hides certain data structures, operations and hardware details from higher-level layers. Disadvantages: level definition and implementation is very difficult; order of levels for the design of layered structure is problematical; interaction between layers and passing of parameters / data is very complex; less efficient as a system call takes longer time for execution than a non-layered system. Examples: Technische Hogeschool Eindhoven (THE) OS and Venus layer structure.
  • 27. Level 5: User programs Level 4: buffering for input and output devices Level 3: operator-console device driver Level 2: memory management Level 1: CPU scheduling Level 0: hardware Figure : THE layer structure Level 6: User programs Level 5: device drivers and schedulers Level 4: virtual memory Level 3: I/O channel Level 2: CPU scheduling Level 1: instruction interpreter Level 0: hardware Figure : Venus layer structure
  • 28. Layered Approach OS/2 provides multitasking and dual mode operation on more powerful hardware. OS/2 does not provide direct user access to low- level facilities like DOS, OS has more control over the hardware, and has more information about usage of resources. Windows NT 4.0 has increased its performance by moving layers from user space to kernel space and closely integrating them.
  • 30. Microkernel System Structure Larger kernels need more space and are difficult to manage. Microkernel approach moves all non-essential components from the kernel and implements them as system-level programs and user- level programs, moving as much from the kernel into “user” space. Microkernel provides minimal process memory management and communication facility. Microkernel provides communication facility through message- passing between the client program and various services that are also running in the user space. Microkernel provides indirect communication between the client program and the service. Benefits:  easier to extend a microkernel  fewer changes required in the modification of microkernel  easier to port the operating system to new architectures  more reliable (less code is running in kernel mode)  more secure – if a routine fails, the rest of the OS remains untouched
  • 32. Virtual Machines The layered approach is taken to its logical conclusion in the concept of a virtual machine. The virtual machine concept treats the kernel of the OS and the hardware though they were all hardware. System programs treat hardware instructions and system calls as they were at the same level. Application programs can also call system programs. A virtual machine provides an interface identical to the underlying bare hardware. The operating system creates the illusion of multiple processes, each executing on its own processor with its own (virtual) memory.
  • 33. Virtual Machines The resources of the physical computer are shared to create the virtual machines: CPU scheduling can create the appearance that users have their own processor. Spooling and a file system can provide virtual card readers and virtual line printers. A normal user time-sharing terminal serves as the virtual machine operator’s console. A virtual machine has virtual memory, virtual disks, virtual printer, virtual console, virtual processor and virtual communication network. A user can run any type of software package on his/her virtual machine. The virtual machine software is concerned with multiprogramming multiple virtual machines onto a physical machine. Virtual disks (minidisks) are difficult to implement in a virtual machine. A lot of effort is required to provide an exact duplicate of the underlying machine. Virtual user mode and virtual monitor mode run in the physical user mode.
  • 34. Virtual Machines Advantages The virtual-machine concept provides complete protection of system resources since each virtual machine is isolated from all other virtual machines. A virtual-machine system is a perfect vehicle for operating- systems research and development. System development is done on the virtual machine, instead of on a physical machine and so does not disrupt normal system operation. Virtual machines are useful for solving system compatibility problems. Disadvantages No direct sharing of resources as each virtual machine is isolated from all other virtual machines. The virtual machine concept is difficult to implement due to the effort required to provide an exact duplicate to the underlying machine. The privileged instructions (needed mainly for I/O) must be simulated and hence execute more slowly.
  • 36. Java Virtual Machine In addition to a language specification and a large API library, Java also provides a specification for a Java Virtual Machine (JVM). For each Java class, the Java compiler produces an architecture- neutral bytecode output (.class) file that will run on any implementation of the JVM. JVM consists of: - class loader - class verifier - runtime interpreter The Java interpreter may be a software module that interprets the byte-codes one at a time, or it may be a Just-In-Time (JIT) compiler that turns the architecture-neutral bytecodes into native machine language for the host computer. Most implementations of the JVM use a JIT compiler for enhanced performance. JVM design provides a secure, efficient, object-oriented, portable, and architecture-neutral platform on which to run Java programs.
  • 38. System Design Goals System goals and specifications are required to be defined for the design of OS. Choice of hardware and type of OS to be decided. Requirements of OS can be divided in two groups: Goals desired by users: the system should be convenient and easy to use; easy to learn; reliable; safe, and fast. Goals desired by programmers / designers: easy to design, implement, maintain and operate; it should be flexible; reliable; error free, and efficient. The wide range of systems shows that different requirements can result in a large variety of solutions for different environments.
  • 39. System Mechanisms and Policies Mechanisms determine how to do something and policies decide what will be done. Timer used in the CPU protection is a mechanism and the time to be set for a particular user is a policy decision. Mechanisms and policies should be treated separately – an important principle. Policies do change from time to time or place to place but mechanisms rarely change. Policy-independent mechanisms are incorporated for flexibility. Policy decisions must be made for all resource- allocation and scheduling problems.
  • 40. System Implementation Designed OS is implemented using either assembly language or a high level language. Both languages can be used in the implementation of an OS. Traditionally written in assembly language, operating systems can now be written in higher-level languages (MCP in ALGOL, MULTICS in PL/1 PRIMOS in FORTRAN, and Unix, OS/2 and Windows in C). Advantages of using a high level language: code writing is much faster; more compact; easier to understand; easier to debug; OS is far easier to port; better data structures and algorithms provide performance improvements. Disadvantages of using a high level language: reduced speed, and increased storage requirements. The most critical or bottleneck routines (memory manager, CPU scheduler) can be written in assembly language for obtaining better performance with small code. Trace listings of system behaviour (using log file or real time approach) and analysis program help to identify bottlenecks and inefficiencies.
  • 41. System Generation (SYSGEN) As the OSs are designed to run on any of a class of machines at a variety of sites with a variety of peripheral configurations, the system must be configured or generated for each specific computer site. This process is known as SYSGEN. The SYSGEN program reads from a file or asks the operator for following information concerning the specific configuration of the hardware system or probes the hardware directly to determine the type of components: CPU type: options for instruction sets; description of each CPU for multiple CPU systems. Memory: total memory, available memory - normally determined by the system. Devices: total devices, system needs to know the device number, the device interrupt number, type and model of each device. Options: Desired options of the OS and parameters values needed (buffers and their sizes, CPU scheduling algorithm, maximum number of processes to be supported).
  • 42. System Generation Approaches Approaches The source code of the OS is modified and the OS is completely compiled to meet requirements of the described system – fully tailored OS (one extreme). The system description could cause the creation of tables and the selection of modules from a precompiled library. These modules would be linked to form the generated OS. SYSGEN is faster but has more generality that was actually needed. A completely table driven system can be constructed. All the code would always be a part of the system and selection would occur at execution time, not at a compile or link time – another extreme. The major differences among these approaches are the size, generality of the generated system, and the ease of modification as the hardware configuration changes. Bootstrap program or Bootstrap loader locates the kernel, loads it into main memory and starts the execution. So OS is made available for use by the hardware and users.