You are on page 1of 13

OPERATING SYSTEMS

Chapter one: General Introduction


1. Introduction
An operating system (OS) is the software component of a computer system that is responsible for
the management and coordination of activities and the sharing of the resources of the computer.
The OS acts as a host for application programs that are run on the machine. As a host, one of the
purposes of an OS is to handle the details of the operation of the hardware. This relieves
application programs from having to manage these details and makes it easier to write
applications. Almost all computers use an OS of some type.
OSs offer a number of services to application programs and users. Applications access these
services through application programming interfaces (APIs) or system calls. By using these
interfaces, the application can request a service from the OS, pass parameters, and receive the
results of the operation. Users may also interact with the OS by typing commands or using a
graphical user interface (GUI).
The Big 3
Common contemporary OSs include Microsoft Windows, Mac OS X, and Linux. Microsoft
Windows has a significant majority of market share in the desktop and notebook computer
markets, while the server and embedded device markets are split amongst several OSs.

a) Linux
Linux (also known as GNU/Linux) is one of the most prominent examples of free software and
open source development which means that typically all underlying source code can be freely
modified, used, and redistributed by anyone. The name “Linux” comes from the Linux kernel,
started in 1991 by Linus Torvalds. The system’s utilities and libraries usually come from the
GNU operating system (which is why it is also known as GNU/Linux).
Linux is predominantly known for its use in servers. It is also used as an operating system for a
wide variety of computer hardware, including desktop computers, supercomputers, video game
systems, and embedded devices such as mobile phones and routers.
Note: GNU (pronounced "g-new") is a free Unix-like operating system distributed by the Free
Software Foundation. It is available in several different versions, but the most popular is the
GNU/Linux system, which uses the Linux kernel. Since the GNU/Linux system is a popular
version of Linux, it is often referred to as simply "Linux." However, GNU/Linux is technically a
specific version of Linux developed by the GNU Project.

The primary difference between Linux and many other OSs is that the Linux kernel and other
components are free and open source software. Free software projects, although developed in a
collaborative fashion, are often produced independently of each other. A Linux distribution,
commonly called a “distro”, is a project that manages a remote collection of Linux-based
software, and facilitates installation of a Linux OS. Distros include system software and
application software in the form of packages. A distribution is responsible for the default
configuration of installed Linux systems, system security, and more generally integration of the
different software packages into a coherent whole.

b) Windows
Windows (created by Microsoft) is the most dominant OS on the market today. The two most
popular versions of Windows for the desktop are XP and Vista (Vista being the latest version).
There is also a mobile version of Windows as well as a server version of Windows (the latest
being Windows Server 2008). Windows is all proprietary, closed-source which is much different
than Linux licenses. Most of the popular manufacturers make all of their hardware compatible
with Windows which makes Windows operate and almost all kinds of new hardware.

c) OS X
OS X is the major operating system that is created by Apple Inc. Unlike its predecessor (referred
to Classic or OS 9), OS X is a UNIX based operating system. Currently OS X is in version 10.5,
with 10.5.3 being the last major software update and plans for 10.6 having been announced.
Apple has chosen to name each version of OS X after a large cat with 10.0 being Cheetah, 10.1
as Puma, 10.2 as Jaguar, 10.3 as Panther, 10.4 as Tiger, 10.5 as Leopard, and the unreleased 10.6
named Snow Leopard.
Apple also develops a server OS X that is very similar to the normal OS X, but is designed to
work on Apple’s X-Serve hardware. Some of the tools included with the server OS X are
workgroup management and administration software that provide simplified access to common
network services, including a mail transfer agent, a Samba server, an LDAP server, a domain
name server, a graphical interface for distributed computing (which Apple calls Xgrid Admin),
and others.
Description
OS X is a UNIX based OS built on top of the XNU kernel, with standard Unix facilities available
from the CLI. Apple has layered a number of components over this base, including their own
GUI. The most notable features of their GUI are the Dock and the Finder.
The Dock is the bar at the bottom of the screen. To the left of the dotted line you can place the
applications that you use most frequently, and any application that is currently running will
appear there with a blue light underneath it. To the right you can place any documents that you
access most frequently. In 10.5 Leopard they added a tool called Stacks to the right side of the
dock. Stacks are folders that when you click on them spread upward to reveal the contents
without actually opening a finder window.
The Finder does exactly what it says it does. It finds everything in your machine. This is how
you find all of the documents, applications, movies, music, photos, and whatever else you have
stored on your machine. There are four ways to view the contents of the directory you’re looking
at that are chosen from the four icons at the top left of the window: icons, list, column, or Cover
Flow. The icon and list views are pretty standard, but the column and Cover Flow views are
fairly unique to OS X.
Compatibility
OS X is not backward compatible with earlier Mac OSs. It functions like Unix-based Linux
systems which mean that most BSD or Linux packages can be run on OS X. Due to earlier
PowerPC processors, OS X has an image of not being compatible with Windows standards,
documents, etc. However, with new Intel-based machines, dual booting and virtual machines
have become possible.
Security and Usage
OS X is a more secure OS than Windows just like Linux. Rather than Linux, however, OS X is a
closed OS. The latest version of OS X (10.5 - Leopard) was designed to add a lot more features.
The next version of OS X will focus more on functionality than cool features.
2. Roles of operating systems
 IO Management
Input/output (IO) is an essential element for the operation of any computer. It allows the
computer to interact with peripheral devices such as a keyboard, mouse, terminals (like modem,
TV card, and NIC card), disks or tapes (CD, DVD, and Floppy disk), printer etc.
 Data Management
Data management allows organizing their data into logical groupings called files. Earlier, only a
few of OS provide data management, containing limited flexibility and usefulness. At present,
most of the OS provides this feature.
 Memory
Memory management is the function responsible for managing the computer's primary memory.
Memory is a large array of words or bytes, each with its own address. When the user requests to
the CPU for read/write operation, OS determines the amount of memory required for the
program instructions and data. Then, OS allocates required memory to load the program and data
into RAM. When a program terminates, its memory space is free and the same memory area can
be allocated to another program.

Figure 1: I/O and memory management


Direct memory access (DMA) is a feature of computer systems that allows certain hardware
subsystems to access main system memory (random-access memory), independent of the central
processing unit (CPU).
Without DMA, when the CPU is using programmed input/output, it is typically fully occupied
for the entire duration of the read or write operation, and is thus unavailable to perform other
work. With DMA, the CPU first initiates the transfer, then it does other operations while the
transfer is in progress, and it finally receives an interrupt from the DMA controller when the
operation is done. This feature is useful at any time that the CPU cannot keep up with the rate of
data transfer, or when the CPU needs to perform work while waiting for a relatively slow I/O
data transfer. Many hardware systems use DMA, including disk drive controllers, graphics cards,
network cards and sound cards. DMA is also used for intra-chip data transfer in multi-core
processors. Computers that have DMA channels can transfer data to and from devices with much
less CPU overhead than computers without DMA channels. Similarly, a processing element
inside a multi-core processor can transfer data to and from its local memory without occupying
its processor time, allowing computation and data transfer to proceed in parallel.
DMA can also be used for "memory to memory" copying or moving of data within memory.

 Process Management
Process management is the process by which operating systems manage processes, threads,
enable processes to share information, protect process resources and allocate system resources to
processes that request them in a safe manner. It finds the status of processors and processes
(Traffic controller), chooses a job (job scheduler), chooses process in the job (process scheduler),
allocates the processors to the process (dispatcher), and free the processor when the process is
executed.
 Device Management
The device management allocates a device to a process. It finds the status of device, channels
and control units, finds answer to questions like which process, which device how much and
allocates the device to the process (IO Scheduling), initiates the IO operation and finally free the
device when the process is completed.
 File Management
The file management keeps track of all information on files. It is an opens and closes files. It
finds and records the following for all files: location, size, usage (attributes) status etc. It also
finds as to which process wants which files, checks through the protection routine, opens the file
if allowed, and allocates it to the process. Finally, it closes the file when the process is executed.
Processor management is at a low level which is very near to the machine whereas file
management is at a higher level which is very near to the user.
 Time sharing Management
Time sharing management is a function of OS which involves the CPU to allocate the time to a
number of users on the same computer. it is generally found in network operating system. As the
number of users increases the response time for each terminal declines. Time sharing creates the
illusion to the each user so that they are the sole user of the system because the speed of the CPU
compared to that of the monitor and terminal, which is so much faster. thereby giving each time
slice for each user to operate the program interactively. Time sharing manages the time of CPU.
Time sharing checks for CPU requests from higher-priority processes that are made every 10
milliseconds.
 Security Management
The security feature protects one user from another and the OS as a whole from all users. Its
main function is to make sure that only authorized users to get access from the computer, and the
users only do things they are authorized to do. Larger OS provides some kind of security but the
degree varies from one OS to another.

Figure 2 : Time sharing


Deadlock prevention
During the processing, a situation can arise in which a resource (hardware or software) shared by
two or more processes cannot continue because the resource required by a process is held by
another. This situation is known as deadlock. For example: if process 1 is allocated to resource A
and later it requests resources B, and process 2 is allocated to resource B and later it requests to
resource A. in this situation, neither process 1 nor process 2 will be executed. Such a situation is
known as deadlock.
OS ensures that the above condition does not hold, and thus prevents it from deadlock. It takes
suitable action by the careful allocation of resources so that deadlock can be avoided. If deadlock
cannot be avoided. OS detects it and tries to recover from it.

Figure 3: example of dealock scenario

Interrupt handling
An interrupt is a signal from a device attached to a computer or from a program within the
computer that causes the main program that operates the computer (the operating system) to stop
and figure out what to do next. Almost all personal (or larger) computers today are interrupt-
driven- that is, they start down the list of computer instructions in one program (perhaps an
application such as a word processor) and keep running the instructions until either (A) they can't
go any further or (B) an interrupt signal is sensed. After the interrupt signal is sensed, the
computer either resumes running the program it was running or begins running another program.

Figure 4: interuption handling

Virtual storage
In a multiprogramming system, there can be many programs located in the memory along
with the operating system. If the program is larger than main memory of the computer, operating
system uses free space of secondary memory which is termed as virtual memory. It is not
necessary to have the entire program in primary storage at one time, only the part on which the
computer is working is needed. The area of secondary storage used for storing pages is called virtual
storage.

3. Components of an operating system

a) The kernel : The kernel is the central module of an operating system (OS). It is the
part of the operating system that loads first, and it remains in main memory. Because it stays in
memory, it is important for the kernel to be as small as possible while still providing all the
essential services required by other parts of the operating system and applications. The the kernel
code is usually loaded into a protected area of memory to prevent it from being overwritten by
programs or other parts of the operating system.
Typically, the kernel is responsible for memory management, process and task management, and
disk management. The kernel connects the system hardware to the application software. Every
operating system has a kernel. For example the Linux kernel is used numerous operating systems
including Linux, FreeBSD, Android and others.
b) The command interpreter : A command interpreter is the part of a computer
operating system that understands and executes commands that are entered interactively by a
human being or from a program. In some operating systems, the command interpreter is called
the shell.
Command interpreters serve many purposes and are more useful than graphical user interfaces in
some cases. Details about these cases are given as follows:
o Command interpreters have a large range of commands and queries available for different
operations. Also, it is much faster to type than to click as is done using graphical user
interfaces..
o There are some systems that don’t have enough resources to support graphical user
interfaces. In those cases, command interpreters can be used.
o Scientists and engineers often used command interpreters in scientific environments.
Technically advanced users also prefer command interpreters as compared to graphical
user interfaces.
o People with visual disabilities use command interpreters as they cannot work with
graphical user interfaces. Commands and instructions can be displayed using braille
displays in command interpreters.

c) The file system: For most users, the file system is the most visible aspect of an
operating system. It provides the mechanism for on-line storage of and access to both data and
programs of the operating system and all the users of the computer system. The file system
consists of two distinct parts: a collection of files, each storing related data, and a directory
structure, which organizes and provides information about all the files in the system.
A file system is a process that manages how and where data on a storage disk, typically a hard
disk drive (HDD), is stored, accessed and managed. It is a logical disk component that manages a
disk's internal operations as it relates to a computer and is abstract to a human user.
Regardless of type and usage, a disk contains a file system and information about where disk
data is stored and how it may be accessed by a user or application. A file system typically
manages operations, such as storage management, file naming, directories/folders, metadata,
access rules and privileges.
Commonly used file systems include File Allocation Table 32 (FAT 32), New
Technology File System (NTFS) and Hierarchical File System (HFS).

Figure 5: components of an operating system

4. some elements of terminology


a) preemtive OS
The Scheduling algorithms can be divided into two categories with respect to how they deal with
clock interrupts.
 Nonpreemptive Scheduling
A scheduling discipline is nonpreemptive if, once a process has been given the CPU, the CPU
cannot be taken away from that process.
Following are some characteristics of nonpreemptive scheduling
o In nonpreemptive system, short jobs are made to wait by longer jobs but the overall
treatment of all processes is fair.
o In nonpreemptive system, response times are more predictable because incoming high
priority jobs can not displace waiting jobs.
o In nonpreemptive scheduling, a schedular executes jobs in the following two situations.
a. When a process switches from running state to the waiting state.
b. When a process terminates.
 Preemptive Scheduling
A scheduling discipline is preemptive if, once a process has been given the CPU can taken away.
The strategy of allowing processes that are logically runable to be temporarily suspended is
called Preemptive Scheduling and it is contrast to the "run to completion" method.
b) Time sharing OS: A time sharing system allows many users to share the computer
resources simultaneously. In other words, time sharing refers to the allocation of computer
resources in time slots to several programs simultaneously. For example a mainframe computer
that has many users logged on to it. Each user uses the resources of the mainframe -i.e. memory,
CPU etc. The users feel that they are exclusive user of the CPU, even though this is not possible
with one CPU i.e. shared among different users.
c) Network OS: A network operating system (NOS) provides services for computers
connected to a network. Examples include shared file access, shared applications, and printing
capabilities. A NOS may either be a peer-to-peer (P2P) OS, which is installed on each computer,
or a client-server model, where one machine is the server and others have client software
installed.
Peer-to-peer network operating systems include legacy OSes such as AppleShare and Windows
for Workgroups. These operating systems offered unique networking
d) Distributed OS: Distributed Operating System is a model where distributed applications
are running on multiple computers linked by communications. A distributed operating system is
an extension of the network operating system that supports higher levels of communication and
integration of the machines on the network. This system looks to its users like an ordinary
centralized operating system but runs on multiple, independent central processing units (CPUs).
e) Embedded OS: An embedded operating system is a specialized OS for use in the
computers built into larger systems. An embedded system is a computer that is part of a different
kind of machine. Examples include computers in cars, traffic lights, digital televisions, ATMs,
airplane controls, point of sale (POS) terminals, digital cameras, GPS navigation systems,
elevators, digital media receivers and smart meters, among many other possibilities.
In contrast to an operating system for a general-purpose computer, an embedded operating
system is typically quite limited in terms of function – depending on the device in question, the
system may only run a single application. However, that single application is crucial to the
device’s operation, so an embedded OS must be reliable and able to run with constraints on
memory, size and processing power.
f) Real time OS
A real-time operating system (RTOS) is an operating system that guarantees a certain capability
within a specified time constraint. For example, an operating system might be designed to ensure
that a certain object was available for a robot on an assembly line. In what is usually called a
"hard" real-time operating system, if the calculation could not be performed for making the
object available at the designated time, the operating system would terminate with a failure. In a
"soft" real-time operating system, the assembly line would continue to function but the
production output might be lower as objects failed to appear at their designated time, causing the
robot to be temporarily unproductive. Some real-time operating systems are created for a special
application and others are more general purpose. Some existing general purpose operating
systems claim to be a real-time operating systems. To some extent, almost any general purpose
operating system such as Microsoft's Windows 2000 or IBM's OS/390 can be evaluated for its
real-time operating system qualities. That is, even if an operating system doesn't qualify, it may
have characteristics that enable it to be considered as a solution to a particular real-time
application problem.
f) Multiproccessing
Multiprocessing is the coordinated processing of programs by more than one computer
processor. Multiprocessing is a general term that can mean the dynamic assignment of a program
to one of two or more computers working in tandem or can involve multiple computers working
on the same program at the same time (in parallel).
Multiprocessing refers to a computer system's ability to support more than one process (program)
at the same time. Multiprocessing operating systems enable several programs to run
concurrently. UNIX is one of the most widely used multiprocessing systems, but there are many
others, including OS/2 for high-end PCs. Multiprocessing systems are much more complicated
than single-process systems because the operating system must allocate resources to competing
processes in a reasonable manner.

Bibliography
-Shrestha, R. P., & Manandhar, s. (2014). Computer Essential. Kathmandu: Ashmita publication.
Brijender Kahanwal (2013) et al FILE SYSTEM : A COMPONENT OF OPERATING SYSTEM,
arxiv.org
- lecture notes : Tang Lineker
-more

You might also like