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

OS Structure

The document discusses operating system structures and common system components. It describes process management, which involves creating and deleting processes, suspending and resuming processes, and mechanisms for process synchronization and communication. It also describes main memory management, which involves mapping programs to absolute addresses and loading them into memory for CPU execution. Additional components discussed include file management, I/O system management, secondary storage management, and optional components like networking and protection systems.

Uploaded by

Ashwini Ambekar
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)
290 views

OS Structure

The document discusses operating system structures and common system components. It describes process management, which involves creating and deleting processes, suspending and resuming processes, and mechanisms for process synchronization and communication. It also describes main memory management, which involves mapping programs to absolute addresses and loading them into memory for CPU execution. Additional components discussed include file management, I/O system management, secondary storage management, and optional components like networking and protection systems.

Uploaded by

Ashwini Ambekar
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/ 27

Subject:

Subject:Operating
OperatingSystem
System Class:
Class:
TYCM
TYCM

CHAPTER : 2
Operating System Structures
 Operating System Services
 System Calls
 Concept, Types and Uses
 Operating System Structure
 Simple, Layered, Monolithic, Microkernel.
 System Components
 Process Management, Main Memory
Management, File Management, I/O System
management, Secondary storage
management.
1
01
WINTER
Operating System Services
₳ Program execution – system capability to load a program
Template
into memory and to run it.
₳ I/O operations – since user programs cannot execute I/O
operations directly, the operating system must provide some
means to perform I/O.
₳ File-system manipulation – program capability to read,
write, create, and delete files.
₳ Communications – exchange of information between
processes executing either on the same computer or on
different systems tied together by a network. Implemented
via shared memory or message passing.
₳ Error detection – ensure correct computing by detecting
errors in the CPU and memory hardware, in I/O devices, or
in user programs.
2
01
Additional Operating System Services
Cont…

Additional functions exist not for helping the user,


but rather for ensuring efficient system operations.
1. Resource allocation – allocating resources to
multiple users or multiple jobs running at the
same time.
2. Accounting – keep track of and record which
users use how much and what kinds of computer
resources for account billing or for accumulating
usage statistics.
3. Protection – ensuring that all access to system
resources is controlled.

3
System Calls 02
 System calls provide the interface between a running
program and the operating system.
 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++)
 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.
 Push (store) the parameters onto the stack by the program,
and pop off the stack by operating system
4
Passing of Parameters
As A Table 02 Cont…

5
MS-DOS Execution
1. Process Control 02 Cont…

 Process Control
 End, abort process
 Load, execute process
 Create process,
terminate process
 Get process attribute,
set process attribute
 Wait for time
 Wait event, signal event
 Allocate and free
memory

At System Start-up Running a Program


6
Other types of system Calls 02 Cont…

 File Management
 Create, Delete, Open, Close, Read-Write-reposition.
 Get file attribute, set file attribute
 Device Management
 Request device, release device
 Read, write, reposition
 Get device attribute, set device attribute
 Logically attach or detach devices
 Information Maintenance
 Get Time or date, set time or date
 Get system data, set system data E.g. Current user, version no.
of OS, amount of free memory
 Get process, file, or device attribute.
 Set process file or device attribute
7
MS-DOS Simple System Structure 03
 MS-DOS – written to
provide the most
functionality in the least
space
 not divided into modules
 Although MS-DOS has
some structure, its
interfaces and levels of
functionality are not well
separated

Fig: MS-DOS Structure

8
UNIX System Structure 03
WINTER
Cont…

Template

9
Layered Approach 03 Cont…

 Modularization
 Abstract and encapsulated implementation of an OS
 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.
 Ease of Debugging
 Each layer hide certain data structure, operations &
hardware of higher level layer
 Need careful definition and interaction of each layer
 Less efficient because of overhead to system call
 E.g. OS/2, windows NT
10
An Operating System Layer 03 Cont…

11
OS/2 Layer Structure 03 Cont…

12
Microkernel System Structure 03 Cont…

 Moves as much from the kernel into “user” space.


 Remove all non-essential components from kernel
 Provides communication facility and coordination
 All new services are added to user space
 Communication takes place between user modules (Client
Program) and services using message passing.
 Benefits:
- easier to extend a microkernel
- easier to port the operating system to new architectures
- more reliable (less code is running in kernel mode)
- more secure and reliable
 E. g. True64, QNX

13
Windows NT Client-Server
03
Structure
WINTER
Cont…

Template

14
Monolithic Structure 03 Cont…

Most primitive form of the OS, Practically no


structure
Characterized by a collection of procedures that can
call any other procedure
All procedures must have a well-defined interface
Does not allow information hiding (private functions
for procedures)
Services provided by putting parameters in well-
defined places and executing a supervisory call. eg.
CP/M and MS-DOS

15
Monolithic Structure 03 Cont…

Basic structure
 Main program that invokes requested service procedures
 Set of service procedures to carry out system calls
 Set of utility procedures to help the service procedures
User program executes until
 program terminates
 program makes a service request
 a time-out signal occurs
 an external interrupt occurs
Problems with monolithic structure
 Difficult to maintain
 Difficult to take care of concurrency due to multiple users/jobs

16
Monolithic Structure 03
Cont..

17
04
WINTER
Common System Components Cont…

₳ Process Management
₳ Template
Main Memory Management
₳ File Management
₳ I/O System Management
₳ Secondary Management

 Additional Components:
₳ Networking
₳ Protection System
₳ Command-Interpreter System

18
Process Management 04 Cont…

A process is a program in execution. A process needs certain


resources, including CPU time, memory, files, and I/O devices,
to accomplish its task.
E.g. compiler, a word processing program, print command etc.
A program is passive and process is active part of execution.
System and user processes
When a process terminates the OS will reclaim any reusable
resources.
The operating system 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

19
Main-Memory Management 04 Cont…
 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.
 For a program to be executed it must be mapped to absolute
address and loaded into memory
 Instruction must be in memory for the CPU for execution.
 Main memory is a volatile storage device. It loses its contents in
the case of system failure.
 The operating system is responsible for the following activities
in connections with memory management:
 Keep track of which parts of memory are currently being used
and by whom.
 Decide which processes to load when memory space becomes
available.
 Allocate and deallocate memory space as needed.

2
0
File Management 04 Cont…

 A file is a collection of related information defined by its creator.


Commonly, files represent programs (both source and object
forms) and data.
 Most visible component of an OS.
 Files can be store on several type of physical media.
 The operating system is responsible for the following activities in
connections 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.

21
I/O System Management 04 Cont…

The I/O system consists of:


 A buffer system
 Speed mismatch
 Different data transfer sizes
 Copy semantics
 A cache system- Fast memory
 A spool system-holds output for a device
 A general device-driver interface

Drivers for specific hardware devices


only the device driver knows the peculiarities of the
specific device to which it is assigned

22
04
WINTER
Secondary-Storage Management Cont…

 Since main memory (primary storage) is volatile and too


small to accommodate all data and programs permanently,
Template
the computer system must provide secondary storage to
back up main memory.
 Most modern computer systems use disks as the principle
on-line storage medium, for both programs and data.
 The operating system is responsible for the following
activities in connection with disk management:
 Free space management
 Storage allocation
 Disk scheduling
 It is very efficient because of frequent use.
 High speed

23
Networking (Distributed Systems) 04 Cont…

 A distributed system is a collection of


processors that do not share memory or a clock.
Each processor has its own local memory.
 The processors in the system are connected
through a communication network.
 Communication takes place using a protocol.
 A distributed system provides user access to
various system resources.
 Access to a shared resource allows:
 Computation speed-up
 Increased data availability
 Enhanced reliability
.
24
Protection System 04 Cont…

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.

25
Command-Interpreter System 04 Cont…
 One of the most important systems programs for an Operating
system is Command Interpreter.
 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
 Command Interpreter is the interface between the user & the OS
 The program that reads and interprets control statements is called
variously:
 command-line interpreter
 shell (in UNIX)
Its function is to get and execute the next command statement.

26
END

27

You might also like