2.services and Component of OS Notes
2.services and Component of OS Notes
2.services and Component of OS Notes
1. Process Control
A running program needs to be able to stop execution either normally or abnormally.
When execution is stopped abnormally, often a dump of memory is taken and can be
examined with a debugger.
2. File Management
Some common system calls are create, delete, read, write, reposition, or close. Also,
there is a need to determine the file attributes – get and set file attribute. Many times
the OS provides an API to make these system calls.
3. Device Management
Process usually requires several resources to execute, if these resources are available,
they will be granted and control returned to the user process. These resources are also
thought of as devices. Some are physical, such as a video card, and others are abstract,
such as a file.
User programs request the device, and when finished they release the device. S imilar to
files, we can read, write, and reposition the device.
4. Information Management
Some system calls exist purely for transferring information between the user program
and the operating system. An example of this is time, or date.
The OS also keeps information about all its processes and provides system calls to
report this information.
5. Communication
There are two models of interprocess communication, the message-passing model
and the shared memory model.
Message-passing uses a common mailbox to pass messages between processes.
Shared memory use certain system calls to create and gain access to create and gain
access to regions of memory owned by other processes. The two processes exchange
information by reading and writing in the shared data.
Process Management
A process is a pro gram in execution. It is a unit of work within the system. Pro gram is a
passive entity, process is an active entity.
Process needs reso urces to accomp lish
its task
CPU, memory,
I/O, files
Initializati
on data
Process termination requires reclaim of any reusable
resources
Single-threaded process has one program counter specifying location of next instruction to
execute
Process executes instructions sequentially, one at a time, until
comp letion
Multi-threaded process has one program counter
per thread
Typically system has many processes, some user, some operating system running concurrently
on o ne or more CP Us
Concurrency by multiplexing the CPUs among the processes / threads
Mass-Storage Management
Usually disks used to store data that does not fit in main memory or data that must be kept for a
―long‖
period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk sub system and its algo rithms
MASS STORAGE
activities Free-
space management
Storage allocation
Disk scheduling
Some storage need not be fast
Tertiary storage includes optical sto rage, magnetic tape
Still must be managed
Varies between WORM (write-once, read- many-times) and RW (read-write)
Process Management
A process is a pro gram in execution. It is a unit of work within the system. Pro gram is a
passive entity, process is an active entity.
Process needs reso urces to accomp lish
its task
CPU, memory,
I/O, files
Initializati
on data
Process termination requires reclaim of any reusable
resources
Single-threaded process has one program counter specifying location of next instruction to
execute
Process executes instructions sequentially, one at a time, until
comp letion
Multi-threaded process has one program counter
per thread
Typically system has many processes, some user, some operating system running concurrently
on o ne or more CP Us
Concurrency by multiplexing the CPUs among the processes / threads
Process Management Activities
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 providing mechanisms for
process communication providing
mechanisms for deadlock handling
Mass-Storage Management
Usually disks used to store data that does not fit in main memory or data that must be kept for a
―long‖
period of time
Proper management is of central importance
Entire speed of computer operation hinges on disk sub system and its algo rithms
MASS STORAGE
activities Free-space
management Storage
allocation
Disk scheduling
Some storage need not be fast
Tertiary storage includes optical sto rage, magnetic tape
Still must be managed
Varies between WORM (write-once, read- many-times) and RW (read-write)