Operating System Concepts
Operating System Concepts
Operating System Definition: It is a software that works as an interface between a user and
the computer hardware. The primary objective of an operating system is to
make computer system convenient to use and to utilize computer hardware in an efficient
manner. The operating system performs the basic tasks such as receiving input from the
keyboard, processing instructions and sending output to the screen.
The Software is the Non-Touchable Parts of the Computer , and Software’s are those which are
used for Performing an Operation So that Software’s are just used for Making an Application
but hardware’s are those which are used for Performing an Operation .
Operating system is software that is required in order to run application programs and utilities.
It works as a bridge to perform better interaction between application programs and hardware
of the computer. Examples of operating system are UNIX, MS-DOS, MS-Windows –
98/XP/Vista, Windows-
Operating System Means that Resource Manager, that manage all the Resources those are
Attached to the System,like Memory,Processor,Input/output Devices.
1) Storage Management: It manage all the Storing and Accessing Files and Directories
Reading/Writing Operations.
Operating system manages overall activities of a computer and the input/output devices
attached to the computer. It is the first software you see when you turn on the computer, and
the last software you see when the computer is turned off. It is the software that enables all
the programs you use. At the simplest level, an operating system does two things:
The first, it manages the hardware and software resources of the computer system. These
resources include the processor, memory, disk space, etc. The second, it provides a stable,
consistent way for applications to deal with the hardware without having-to know all the
details of the hardware.
The first task is very important i.e. managing the hardware and software resources, as various
processes compete to each other for getting the CPU time and memory space to complete the
task. In this regard; the operating system acts as a manager to allocate the available resources
to ‘satisfy the requirements of each process.
The second task i.e. providing a consistent application interface is especially important. A
consistent application program interface (API) allows a user (or S/W developer) to write an
application program on any computer and to run this program on another computer, even if
the hardware configuration is different like as amount of memory, type of CPU or storage
disk. It shields the user of the machine from the low-level details of the machine’s operation
and provides frequently needed facilities.
2) Process Management: It manage all the User and system Process.
3) Memory Management: Operating System also Manages the Computer Memory that is
provided to the process.
4) Extended Machine: It is behaves like an Extended Machine that Provides us Sharing of
Files between Multiple Users.
Mastermind: It performs Many Functions that’s why we can say that Operating System is
a Mastermind.
There are different types of operating system those are organized by their Working.
1) Serial Processing: In Serial Processing operating system that use FIFO (First in First Out)
technique for processing the process.
2) Batch Processing: In batch processing a similar type of jobs prepared and processed.
3) Multi-Programming: In Multi programming Operating System Multiple Programs are
Executed on the System at a Time.
4) Real Time System: Real Time System are used there Requires higher and Timely
Response.
5) Distributed Operating System: In this Operating system Data is Stored and Processed
on Multiple Locations.
6) Multiprocessing: In This type of operating system there are two or More CPU in a Single
OS.
7) Parallel operating systems: It manage parallely all running resources of the computer
system.
• User Interface
• Program Execution
• File system manipulation
• Input / Output Operations
• Communication
• Resource Allocation
• Error Detection
• Accounting
• Security and protection
- User Interface
Usually Operating system comes in three forms or types. Depending on the interface their types
have been further subdivided. These are:
Programs need has to be read and then write them as files and directories. File handling portion
of operating system also allows users to create and delete files by specific name along with
extension, search for a given file and / or list file information. Some programs comprise of
permissions management for allowing or denying access to files or directories based on file
ownership.
A program which is currently executing may require I/O, which may involve file or other I/O
device. For efficiency and protection, users cannot directly govern the I/O devices. So, the OS
provide a means to do I/O Input / Output operation which means read or write operation with
any file.
Process needs to swap over information with other process. Processes executing on same
computer system or on different computer systems can communicate using operating system
support. Communication between two processes can be done using shared memory or via
message passing.
When multiple jobs running concurrently, resources must need to be allocated to each of them.
Resources can be CPU cycles, main memory storage, file storage and I/O devices. CPU
scheduling routines are used here to establish how best the CPU can be used.
-Error Detection
Errors may occur within CPU, memory hardware, I/O devices and in the user program. For
each type of error, the OS takes adequate action for ensuring correct and consistent computing.
-Accounting
This service of the operating system keeps track of which users are using how much and what
kinds of computer resources have been used for accounting or simply to accumulate usage
statistics.
-Protection and Security
Protection includes in ensuring all access to system resources in a controlled manner. For
making a system secure, the user needs to authenticate him or her to the system before using
(usually via login ID and password).
System call
A system call is a function that a user program uses to ask the operating system for a particular
service. User programmers can communicate with the operating system to request its services
using the interface that is created by a system call.System calls serve as the interface between
an operating system and a process. System calls can typically be found as assembly language
instructions. They are also covered in the manuals that the programmers working at the
assembly level use. When a process in user mode needs access to a resource, system calls are
typically generated. The resource is then requested from the kernel via a system call.
System call uses Application Programming Interfaces to provide operating system services to
user programmes (API). It offers a point of contact between processes and the operating system
so that user-level processes can ask for the operating system's assistance. The only ways to
access the kernel system are through system calls. System calls are required for all programmes
that require resources.
The following is a diagram that illustrates what is system call in an operating system and how
the system call is executed:
This diagram shows how the processes normally run in user mode until a system call interrupts
them. The system call is then carried out in kernel mode according to priority. The control
switches back to user mode after the system call has been completed, allowing user processes
to continue running.
The most common system calls used on Unix system calls, Unix-like, and other POSIX-
compliant operating systems are open, read, write, close, wait, exec, fork, exit, and kill. There
are hundreds of systems calls in many contemporary operating systems. For instance, Linux
and OpenBSD each have over 300 different calls, NetBSD and FreeBSD both have over 500,
and Windows has close to 2000 system calls, split between win32k and ntdll.
Tools like strace, ftrace, and truss allow a process to run from the beginning and report every
system call it makes. They can also attach to an already running process and intercept any
system call made by that process if the action does not conflict with the user's permissions.
If we need to copy data from one file into another, we can do so by writing programme code.
The names of the two files, the input and output files, are the first piece of data that the
programme needs. This kind of programme execution requires some system calls from the
OS in an interactive system.
The Applications operate in user space, a portion of memory. The operating system's kernel,
which runs in kernel space, is reached through a system call. An application must first
request permission from the kernel before it can create a system call. It accomplishes this
by sending an interrupt request, which pauses the running process and gives the kernel
control.
The kernel carries out the requested action, such as creating or deleting a file, if the request
is approved. The output of the kernel is provided to the application as input. Once the input
is received, the application continues the process. The kernel transfers data from kernel
space to user space in memory after the operation is complete and returns the results to the
application.
A straightforward system call, like getting the system date and time, might only return a
result in a few nanoseconds. It might take a few seconds to complete a more complex system
call, like connecting to a network device. To prevent bottlenecks, most operating systems
start a separate kernel thread for each system call. Because modern operating systems are
multi-threaded, they can manage multiple system
There are primarily 5 different types of system calls in the operating system:
1. Process Control
The following services are provided by Process Control System calls that are used to control
a process.
The following services are provided by system call for file management:
The following services are offered by a system call that controls I/O devices:
• Devices might be needed while a process is running. such as access to the file system,
I/O devices, main memory, etc.
• As a result, it can ask for a device and then release it once the task is complete.
• when a requested device is granted access by the process. It is capable of reading,
writing, and repositioning operations.
• In order to obtain or modify a specific device's attribute.
• To detach a device from the processor that is currently executing a command, the call
can be made.
4. Information Maintenance
The system calls for information maintenance call moves data from the user programme to
the operating system. Considering this, the services offered by this type of system call are:
• Obtain the system's time or date. Set the system's time or date.
• Obtain system-related information. Configure the system data.
• Obtain the characteristics of a specific operating system process. Alternatively, of a
specific file on the system or on any attached devices.
• Set the characteristics of a specific operating system process. Alternatively, of a specific
file on the system or on any attached devices.
5. Communication
Such a system call facilitates the system's network connection. The services that these
system calls offer are:
• Open a fresh connection to send the data. After the transmission is finished, disconnect
from the connection.
• On a particular connection, send a message. Obtain communication from a specific
connection.
• Identify and connect a specific remote device to the network. Remove a specific remote
computer or device from the network.
• Example of System Calls in Windows and Unix
Following are the rules for passing parameters to the system call:
• System calls are necessary for reading and writing from files.
• System calls are necessary for a file system to add or remove files.
• New processes are created and managed using system calls.
• System calls are required for packet sending and receiving over network connections.
• A system call is required to access hardware devices like scanners and printers.
The purpose of system calls serves as the interface between an operating system and a
process. System calls can typically be found as assembly language instructions. They are
also covered in the manuals that the programmers working at the assembly level use. When
a process in user mode needs access to a resource, system calls are typically generated. The
resource is then requested from the kernel via a system call.
• If a file system needs files to be created or deleted. A system call is also necessary for
reading and writing from files.
• development and administration of new procedures.
• System calls are also required for network connections. This also applies to packet
sending and receiving.
• A system call is necessary to access hardware such as a printer, scanner, etc.
Looking to master Python programming? Discover the best Python programming
course that guarantees to take your skills to the next level. Start coding like a pro today!
Conclusion
The interface by which the process interacts with the system call is called a system call.
There are two operating modes for computers:
• kernel mode
• user mode
When a system call is made, the process transitions from user mode to kernel mode. Once
the system call has finished running, the control is returned to the user mode
The monolithic operating system is a very basic operating system in which file management,
memory management, device management, and process management are directly controlled
within the kernel. The kernel can access all the resources present in the system. In monolithic
systems, each component of the operating system is contained within the kernel. Operating
systems that use monolithic architecture were first time used in the 1970s.
The monolithic operating system is also known as the monolithic kernel. This is an old
operating system used to perform small tasks like batch processing and time-sharing tasks in
banks. The monolithic kernel acts as a virtual machine that controls all hardware parts.
It is different from a microkernel, which has limited tasks. A microkernel is divided into two
parts, kernel space, and user space. Both parts communicate with each other through IPC
(Inter-process communication). Microkernel's advantage is that if one server fails, then the
other server takes control of it.
Monolithic kernel
A monolithic kernel is an operating system architecture where the entire operating system is
working in kernel space. The monolithic model differs from other operating system
architectures, such as the microkernel architecture, in that it alone defines a high-level virtual
interface over computer hardware.
A set of primitives or system calls implement all operating system services such as process
management, concurrency, and memory management. Device drivers can be added to the
kernel as modules.
o The execution of the monolithic kernel is quite fast as the services such as memory
management, file management, process scheduling, etc., are implemented under the
same address space.
o A process runs completely in single address space in the monolithic kernel.
o The monolithic kernel is a static single binary file.
o If any service fails in the monolithic kernel, it leads to the failure of the entire system.
o The entire operating system needs to be modified by the user to add any new service.
A monolithic design of the operating system architecture makes no special accommodation for
the special nature of the operating system. Although the design follows the separation of
concerns, no attempt is made to restrict the privileges granted to the individual parts of the
operating system. The entire operating system executes with maximum privileges. The
communication overhead inside the monolithic operating system is the same as that of any
other software, considered relatively low.
CP/M and DOS are simple examples of monolithic operating systems. Both CP/M and DOS
are operating systems that share a single address space with the applications.
o In CP/M, the 16-bit address space starts with system variables and the application area.
It ends with three parts of the operating system, namely CCP (Console Command
Processor), BDOS (Basic Disk Operating System), and BIOS (Basic Input/Output
System).
o In DOS, the 20-bit address space starts with the array of interrupt vectors and the system
variables, followed by the resident part of DOS and the application area and ending
with a memory block used by the video card and BIOS.
Modular operating systems and most modern monolithic operating systems such as OS-9
OpenVMS, Linux, BSD, SunOS, AIX, and MULTICS can dynamically load (and unload)
executable modules at runtime.
This modularity of the operating system is at the binary level and not at the architecture level.
Modular monolithic operating systems are not confused with the architectural level of
modularity inherent in server-client operating systems (and its derivatives sometimes marketed
as the hybrid kernel) that use microkernels and servers.
Practically, dynamically loading modules is simply a more flexible way of handling the
operating system image at runtime instead of rebooting with a different operating system
image. The modules allow easy extension of the operating systems' capabilities as required.
Dynamically loadable modules incur a small overhead when compared to building the module
into the operating system image.
However, in some cases, loading modules dynamically helps keep the amount of code running
in kernel space to a minimum. For example, to minimize operating system footprint for
embedded devices or those with limited hardware resources. Namely, an unloaded module need
not be stored in scarce random access memory.
The monolithic operating system has the following limitations, such as:
The monolithic operating system provides the following features to the users, such as:
1. Simple structure: This type of operating system has a simple structure. All the
components needed for processing are embedded into the kernel.
2. Works for smaller tasks: It works better for performing smaller tasks as it can handle
limited resources.
3. Communication between components: All the components can directly communicate
with each other and also with the kernel.
4. Fast operating system: The code to make a monolithic kernel is very fast and robust.
A kernel is the core part of an operating system, and it manages the system resources. A kernel
is like a bridge between the application and hardware of the computer. The kernel can be
classified further into two categories, Microkernel and Monolithic Kernel.
The microkernel is a type of kernel that allows customization of the operating system. It runs
on privileged mode and provides low-level address space management and Inter-Process
Communication (IPC). Moreover, OS services such as file system, virtual memory manager,
and CPU scheduler are on top of the microkernel. Each service has its own address space to
make them secure. Besides, the applications also have their own address spaces. Therefore,
there is protection among applications, OS Services, and kernels.