Operating System Functions :
· Process Management
· Memory Management
· Storage Management
· Mass-Storage Management
· I/O Subsystem
· Protection and Security
Process Management
Ø A process is a program in execution. It is a unit of work within the system. Program is a passive entity, process is an active entity.
Ø Process needs resources to accomplish its task
o CPU, memory, I/O, files
o Initialization data
Ø Process termination requires reclaim of any reusable resources
Ø Single-threaded process has one program counter specifying location of next instruction to execute
o Process executes instructions sequentially, one at a time, until completion
Ø Multi-threaded process has one program counter per thread
Ø Typically system has many processes, some user, some operating system running concurrently on one or more CPUs
o Concurrency by multiplexing the CPUs among the processes / threads
Ø 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
Ø Memory Management
Ø All data in memory before and after processing
Ø All instructions in memory in order to execute
Ø Memory management determines what is in memory when
o Optimizing CPU utilization and computer response to users
Ø Memory management activities
o Keeping track of which parts of memory are currently being used and by whom
o Deciding which processes (or parts thereof) and data to move into and out of memory
o Allocating and deallocating memory space as needed
Ø Storage Management
Ø OS provides uniform, logical view of information storage
o Abstracts physical properties to logical storage unit - file
o Each medium is controlled by device (i.e., disk drive, tape drive)
§ Varying properties include access speed, capacity, data-transfer rate, access method (sequential or random)
Ø File-System management
o Files usually organized into directories
o Access control on most systems to determine who can access what
o OS activities include
§ Creating and deleting files and directories
§ Primitives to manipulate files and dirs
§ Mapping files onto secondary storage
§ Backup files onto stable (non-volatile) storage media
Ø 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 subsystem and its algorithms
Ø OS activities
o Free-space management
o Storage allocation
o Disk scheduling
Ø Some storage need not be fast
o Tertiary storage includes optical storage, magnetic tape
o Still must be managed
o Varies between WORM (write-once, read-many-times) and RW (read-write)
Ø I/O Subsystem
Ø One purpose of OS is to hide peculiarities of hardware devices from the user
Ø I/O subsystem responsible for
o Memory management of I/O including buffering (storing data temporarily while it is being transferred), caching (storing parts of data in faster storage for performance), spooling (the overlapping of output of one job with input of other jobs)
o General device-driver interface
o Drivers for specific hardware devices
Ø Protection and Security
Ø Protection – any mechanism for controlling access of processes or users to resources defined by the OS
Ø Security – defense of the system against internal and external attacks
o Huge range, including denial-of-service, worms, viruses, identity theft, theft of service
Ø Systems generally first distinguish among users, to determine who can do what
o User identities (user IDs, security IDs) include name and associated number, one per user
o User ID then associated with all files, processes of that user to determine access control
o Group identifier (group ID) allows set of users to be defined and controls managed, then also associated with each process, file
o Privilege escalation allows user to change to effective ID with more rights