Learning Materials-Chapter-2-OS
Learning Materials-Chapter-2-OS
Main difference between multiprogramming and time sharing is that multiprogramming is the effective
utilization of CPU time, by allowing several programs to use the CPU at the same time but time sharing is
the sharing of a computing facility by several users that want to use the same facility at the same time.
Each user on a time sharing system gets her own terminal and gets the feeling that she is using the CPU
alone. Actually, time sharing systems use the concept of multiprogramming to share the CPU time
between multiple users at the same time.
An Operating System provides services to both the users and to the programs.
Program execution
I/O operations
File System manipulation
Communication
Error Detection
Resource Allocation
Protection
Program execution
Operating systems handle many kinds of activities from user programs to system programs like
printer spooler, name servers, file server, etc. Each of these activities is encapsulated as a
process.
A process includes the complete execution context (code to execute, data to manipulate,
registers, OS resources in use). Following are the major activities of an operating system with
respect to program management −
I/O operation means read or write operation with any file or any specific I/O device.
Operating system provides the access to the required I/O device when required.
File system manipulation
A file represents a collection of related information. Computers can store files on the disk (secondary
storage), for long-term storage purpose. Examples of storage media include magnetic tape, magnetic disk
and optical disk drives like CD, DVD. Each of these media has its own properties like speed, capacity,
data transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and usage. These directories may
contain files and other directions. Following are the major activities of an operating system with respect
to file management −
System calls provide an interface between the process and the operating system.
System calls allow user-level processes to request some services from the operating system which
process itself is not allowed to do.
In handling the trap, the operating system will enter in the kernel mode, where it has access to
privileged instructions, and can perform the desired service on the behalf of user-level process.
It is because of the critical nature of operations that the operating system itself does them every
time they are needed.
For example, for I/O a process involves a system call telling the operating system to read or write
particular area and this request is satisfied by the operating system.
4) Information Maintenance
Many system calls exist simply for the purpose of transferring information between the user
program and the OS. For example, most systems have a system call to return the current time and
date.
Other system calls may return information about the system, such as the number of current users,
the version number of the OS, the amount of free memory or disk space, and so on.
In addition, the OS keeps information about all its processes, and system calls are used to access
this information. Generally, calls are also used to reset the process information.
Functions:
get time or date, set time or date
get system data, set system data
get and set process, file, or device attributes
5) Communication
There are two common models of interprocess communication: the message-passing model and
the shared-memory model. In the message-passing model, the communicating processes
exchange messages with one another to transfer information.
In the shared-memory model, processes use shared memory creates and shared memory attaches
system calls to create and gain access to regions of memory owned by other processes.
Recall that, normally, the OS tries to prevent one process from accessing another process's
memory. Shared memory requires that two or more processes agree to remove this restriction.
They can then exchange information by reading and writing data in the shared areas.
Message passing is useful for exchanging smaller amounts of data, because no conflicts need be
avoided. It is also easier to implement than is shared memory for intercomputer communication.
Shared memory allows maximum speed and convenience of communication, since it can be done
at memory speeds when it takes place within a computer. Problems exist, however, in the areas of
protection and synchronization between the processes sharing memory.
Functions:
o create, delete communication connection
o send, receive messages
o transfer status information
o Attach and Detach remote devices
In the above image, system programs as well as application programs form a bridge between the user
interface and the system calls.
1) Status Information
The status information system programs provide required data on the current or past status of the
system. This may include the system date, system time, available memory in system, disk space,
logged in users etc.
2) Communications
These system programs are needed for system communications such as web browsers. Web
browsers allow systems to communicate and access information from the network as required.
3) File Manipulation
These system programs are used to manipulate system files. This can be done using various
commands like create, delete, copy, rename, print etc. These commands can create files, delete
files, copy the contents of one file into another, rename files, print them etc.
4) Program Loading and Execution
The system programs that deal with program loading and execution make sure that programs can
be loaded into memory and executed correctly. Loaders and Linkers are a prime example of this
type of system programs.
5) File Modification
System programs that are used for file modification basically change the data in the file or
modify it in some other way. Text editors are a big example of file modification system
programs.
6) Application Programs
Application programs can perform a wide range of services as per the needs of the users. These
include programs for database systems, word processors, plotting tools, spreadsheets, games,
scientific applications etc.
7) Programming Language Support
These system programs provide additional support features for different programming languages.
Some examples of these are compilers, debuggers etc. These compile a program and make sure it
is error free respectively.
Some examples of system programs in O.S. are –
Ubuntu
Linux
Unix
Android
Anti-virus
Disk formatting
Computer language translators
. path for application software to run. Application software is built for specific tasks.
. Low level languages are used to write the system software. application software.
. Example of system software are operating system, etc. VLC player etc.
7 System Software programming is complex than application Application software programming is simpler as