OperatingSystemConcepts 3 OperatingSystemStructures

Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Information Technology Institute

Operating System Fundamentals

© Copyright Information Technology Institute - 2018


Chapter Three
OPERATING SYSTEM
STRUCTURES
© Copyright Information Technology Institute - 2018 2
Table of Content

• System Components
• Operating System Services
• System Calls
• System Structure

© Copyright Information Technology Institute - 2018 3


SYSTEM COMPONENTS

© Copyright Information Technology Institute - 2018 4


System Components

• Process management
• Main memory management
• File system management
• I/O system management
• Secondary storage management
• Networking
• Protection
• Command interpreter
© Copyright Information Technology Institute - 2018 5
Process Management
w2t el execution of program byb2a esmha process, OS bycontrol el execution process de.

• 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.
• The operating system is responsible for the
following activities in connection with process
management.
• Process creation and deletion.
• process suspension and resumption.
• process communication

© Copyright Information Technology Institute - 2018 6


Main-Memory Management

• Memory is a large array of 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 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 de-allocate memory space as needed
© Copyright Information Technology Institute - 2018 7
File Management

• A file is a collection of related information defined by


its creator. Commonly, files represent programs and
data.
• 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 (non-volatile) storage media.

© Copyright Information Technology Institute - 2018 8


I/O System Management

• OS hide particularities of I/O devices


• Device drivers
• Input: retrieve block of data software
• Output: hardware instructions for controller hardware part

Memory spooling : process of transfering data from and to main memory

• I/O subsystem
• Memory management: spooling
• Drivers for specific hardware
© Copyright Information Technology Institute - 2018 9
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.
• 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

© Copyright Information Technology Institute - 2018 10


Networking (Distributed
Systems)
• A distributed system is a collection 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
© Copyright Information Technology Institute - 2018 11
Protection System

• Protection refers to a mechanism for


controlling access by programs, or users to
system resources.
• The protection mechanism must:
• distinguish between authorized and unauthorized
usage.
• specify the controls to be imposed.

© Copyright Information Technology Institute - 2018 12


Command-Interpreter System

• 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

© Copyright Information Technology Institute - 2018 13


Command-Interpreter System Cont’d

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

© Copyright Information Technology Institute - 2018 14


OPERATING SYSTEM
SERVICES

© Copyright Information Technology Institute - 2018 15


Operating System Services

• Program execution
• System capability to load a program 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.
© Copyright Information Technology Institute - 2018 16
Operating System Services Cont’d

• 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.
© Copyright Information Technology Institute - 2018 17
SYSTEM CALLS

© Copyright Information Technology Institute - 2018 18


System Calls

• 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++)

© Copyright Information Technology Institute - 2018 19


Copy Program Example

• Variable initialization
• open ( file1 )
• create ( file2 )
• read ( file1 )
• write ( file2 )
• close ( file1 )
• close ( file2 )
© Copyright Information Technology Institute - 2018 20
Types of System Calls

• Process control
• File management
• Device management
• Information maintenance
• Communications

© Copyright Information Technology Institute - 2018 21


System Calls Types
Process File Device Information Communications
Control Management Management Maintenance IPC

load, execute create file request get time create channel


end, abort delete file release set time delete channel

create open attach get system data send message


terminate close detach set system data receive message

get attributes read / write read get attributes


transfer status
set attributes reposition write set attributes

wait time, get attributes get attributes attach / detach


event, signal set attributes set attributes remote device

allocate memory
free memory

© Copyright Information Technology Institute - 2018 22


Communication Models
ben el processes

Message Passing
OS hwa ely by3ml communication benhom
Shared Memory
wmmkn tb2a fnfc el machine wmmkn tb2a f
network mtnzma bl protocols

lazm on same machine , fast, no


layer for os, overhead because of
comm is slower no os synchronization and it's the
process responsible

© Copyright Information Technology Institute - 2018 23


SYSTEM STRUCTURE

© Copyright Information Technology Institute - 2018 24


OS System Design Structure

• Simple structure

• Layered approach

© Copyright Information Technology Institute - 2018 25


MS-DOS Structure

© Copyright Information Technology Institute - 2018 26


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.
© Copyright Information Technology Institute - 2018 27
Layered Approach Cont’d

• Advantage:
• Modularity
• Debugging
• Modification

• Disadvantage:
• Layering overhead to the system call

© Copyright Information Technology Institute - 2018 28


OS/2 Layer Structure

© Copyright Information Technology Institute - 2018 29


© Copyright Information Technology Institute - 2018 30

You might also like