Professional Documents
Culture Documents
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, FD, MD, 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 FDs, CDs, HDs, Ods 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