Anda di halaman 1dari 14

2.

Operating-System Structures

2.1 SYSTEM
COMPONENTS

1.Process 2.Main 3.File


4.I/O
5.Secondary
6.
7.Protectio 8.Comman
manageme
manageme System Storage Networking n
dnt
memory nt
manageme
system interpreter
Manageme
nt
management
system
nt

2.1.1 Process Management

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.

Creating and deleting both user and system


processes

Suspending and resuming processes

Providing mechanisms for :


Process synchronization
Process communication
Deadlock handling

2.1.2 Main-Memory Management

Main 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 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.
Deciding which processes are to be loaded into
memory when memory space becomes available.
Allocating and deallocating memory space as needed.

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

The operating system is responsible for the following


activities in connection with file management:

Creating and deleting files

Creating and deleting directories

Supporting primitives for manipulating files and


directories

Mapping files onto secondary storage

Backing up files on stable (nonvolatile) storage media

2.1.4 I/O System Management

The I/O subsystem consists of

A memory-management component that includes


buffering, caching, and spooling

A general device-driver interface

Drivers for specific hardware devices

2.1.5 Secondary-Storage Management


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

2.1.6 Networking(Distributed system)

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
2.1.7 Protection Systems

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.

2.1.8 Command-line interpreter

When a new job is started in a system, a program that reads


and interprets control statements is executed automatically.

This program is called the control-card interpreter or the


command-line interpreter, and is often known as the shell.

Its function is simple: To get the next command statement


and execute it.

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

2.2 Operating System Services

2.2.1
Program
Execution

2.2.2 I/O
Operations

2.2.3 File
2.2.5 Error
2.2.4
system
detection
manipulation Communication

2.2.1 Program Execution


The system must be able to load a program into memory and
to run that program.
The program must be able to end its execution, either
normally or abnormally (indicating error).
2.2.2 I/O Operations
A running program may require I/O. This I/O may involve a
file or an I/O device.
Users cannot control the I/O devices directly in order to meet
efficiency and protection.
2.2.3 File system manipulation
Program capabilities to read, write, create, and delete files.

2.2.4 Communications
Processes may exchange information, on the same
computer or
between computers over a network
Communications may be via shared memory or through
message
passing (packets moved by the OS)
2.2.5 Error detection
The operating system constantly needs to be aware of
possible errors.
Errors may occur in the CPU and memory hardware, in I/O
devices, and in the user program.
For each type of error, the operating system should take
the
appropriate action to ensure correct and consistent
computing.

2.3 SYSTEM CALLS


System

calls provide the interface, between a process


and the operating system.
These calls are generally available as assemblylanguage instructions.
Languages defined to replace assembly language,
allow
system calls to be made directly. (e.g., C, C++)
Three general methods are used to pass parameters
to OS.
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.

Fig :Passing of parameters as a table

2.3 System
calls
2.3.3 Device 2.3.4
2.3.2 File
managemen managemen Information
t
t
maintenance
2.3.1 Process control

2.3.1
Process
control

2.3.5
Communicati
ons

End, abort : to halt process execution either normally


(end) or abnormally (abort).

Load, execute : to load and execute another program.

Create process and terminate process

get process attributes ,set process attributes : To control


jobs execution

wait for time, wait event, signal event :To create new job
it is necessary to wait until the running job get complete

Allocate and free memory: system calls for dump


memory.

2.3.2 File management


create file, delete file
open, close
read, write, reposition
get file attributes, set file attributes
2.3.3 Device management
request device, release device
read, write, reposition
get device attributes, set device attributes
logically attach or detach devices
2.3.4 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

2.3.5 Communications
create, delete communication connection
send, receive messages
transfer status information
attach or detach remote devices

Anda mungkin juga menyukai