Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 20

Operating Systems

Week 2: Lecture 3 & 4: Operating System Structures


User Operating System Interface

• A User interface (UI) facilitates communication between an application and its user


by acting as an intermediary between them. Each application including the operating
system is provided with a specific UI for effective communication. The two basic
function of a user interface of an application is to take the inputs from the user and to
provide the output to the users. However, the types of inputs taken by the UI and the
types of output provided by the UI may vary from one application to another.
• A user interface of any operating system can be classified into one of the following
types:
• Graphical user interface (GUI)
• Command line user interface (CLI)
• .
• Graphical user interface (GUI)
• The graphical user interface is a type of GUI that enables the users to interact
with the operating system by means of point-and-click operations. GUI
contains several icons representing pictorial representation of the variables
such as a file, directory, and device. The graphical icon provided in the UI can
be manipulated by the users using a suitable pointing device such as a mouse,
trackball, touch screen and light pen. The other input devices like keyboard
can also be used to manipulate these graphical icons. GUIs are considered to
be very user- friendly interface because each object is represented with a
corresponding icon. Unlike the other UIs the users need not provide text
command for executing tasks
User Operating System Interface
• Some advantages of GUI based operating system
• The GUI interface is easy to understand and even the new users can
operate on them on their own.
• The GUI interface visually acknowledges and confirms each type of
activities performed by the users. For example when the user deletes a
file in the Windows operating system, then the operating system asks
for the confirmation before deleting it.
• The GUI interface enables the users to perform a number of tasks at the
same time. This features of the operating system are also known as
multitasking.
• Command line Interface (CLI)
• Command line interface is a type of UI that enables the users to interact with
the operating system by issuing some specific commands. In order to perform
a task in this interface, the user needs to type a command at the command
line. When the user enters the key, the command line interpreter received a
command. The software program that is responsible for receiving and
processing the commands issued by the user. After processing the command
are called command line interpreter, the command line interpreter displays
the command prompt again along with the output of the previous command
issued by the user. The disadvantages of the CLI is that the user needs to
remember a lot to interact with the operating system. Therefore these types of
interface are not considered very friendly from the users perspective.
System Calls
• A system call is a mechanism that provides the interface between a process and the
operating system. It is a programmatic method in which a computer program
requests a service from the kernel of the OS.
• System call offers the services of the operating system to the user programs via API
(Application Programming Interface). System calls are the only entry points for the
kernel system.
• For example if we need to write a program code to read data from one file, copy that
data into another file. The first information that the program requires is the name of
the two files, the input and output files.
• In an interactive system, this type of program execution requires some system calls
by OS.
• First call is to write a prompting message on the screen
• Second, to read from the keyboard, the characters which define the two files.
Types of System Call

• Here are the five types of System Calls in OS:


• Process Control
• File Management
• Device Management
• Information Maintenance
• Communications
Types of System Call
• Process Control
• These system calls deal with processes such as process creation, process termination etc.
• File Management
• These system calls are responsible for file manipulation such as creating a file, reading a file, writing into a file etc.
• Device Management
• These system calls are responsible for device manipulation such as reading from device buffers, writing into device
buffers etc.
• Information Maintenance
• These system calls handle information and its transfer between the operating system and the user program.
• Communication
• These system calls are useful for inter process communication. They also deal with creating and deleting a
communication connection.
Types of System Call
Categories Windows Unix
CreateProcess() fork()
Process control ExitProcess() exit()
WaitForSingleObject() wait()
SetConsoleMode() loctl()
Device manipulation ReadConsole() read()
WriteConsole() write()
CreateFile() Open()
ReadFile() Read()
File manipulation
WriteFile() write()
CloseHandle() close!)
GetCurrentProcessID() getpid()
Information maintanence SetTimer() alarm()
Sleep() sleep()
CreatePipe() Pipe()
Communication CreateFileMapping() shm_open()
MapViewOfFile() mmap()

SetFileSecurity() Chmod()
Protection InitlializeSecurityDescriptor() Umask()
SetSecurityDescriptorGroup () Chown()
Types of System Call
• open()
• The open() system call is used to provide access to a file in a file system. This system call allocates resources to the
file and provides a handle that the process uses to refer to the file. A file can be opened by multiple processes at the
same time or be restricted to one process. It all depends on the file organisation and file system.
• read()
• The read() system call is used to access data from a file that is stored in the file system. The file to read can be
identified by its file descriptor and it should be opened using open() before it can be read. In general, the read()
system calls takes three arguments i.e. the file descriptor, buffer which stores read data and number of bytes to be
read from the file.
• write()
• The write() system calls writes the data from a user buffer into a device such as a file. This system call is one of the
ways to output data from a program. In general, the write system calls takes three arguments i.e. file descriptor,
pointer to the buffer where data is stored and number of bytes to write from the buffer.
• close()
• The close() system call is used to terminate access to a file system. Using this system call means that the file is no
longer required by the program and so the buffers are flushed, the file metadata is updated and the file resources are
de-allocated.
System Program
• In an operating system a user is able to use different types of system programs and the system program is responsible
for all the application software performance of the computer.
• The system programs are responsible for the development and execution of a program and they can be used by the
help of system calls because system calls define different types of system programs for different tasks.
System Program
• File management − These programs create, delete, copy, rename, print, exit and generally manipulate the files and
directory.
• Status information − It is the information regarding input, output process, storage and the CPU utilization time how
the process will be calculated in how much memory required to perform a task is known by status information.
• Programming language supports − compiler, assembler, interrupt are programming language support used in the
operating system for a particular purpose in the computer.
• Programming Loading and execution − The needs to enter the program and after the loading of a program it needs
to execute the output of the programs and this task is also performed by system calls by the help of system programs.
• Communication − These services are provided by the user because by using this number of devices communicates
with each other by the help of device or wireless and communication is necessary for the operating system.
• Background services − There are different types of services available on the operating system for communication
and background service is used to change the background of your window and it also works for scanning and
detecting viruses in the computer.
Virtual Machine
• A virtual machine (VM) is a virtual environment which functions as a virtual computer system with its own CPU,
memory, network interface, and storage, created on a physical hardware system.
• VMs are isolated from the rest of the system, and multiple VMs can exist on a single piece of hardware, like a server.
That means, it as a simulated image of application software and operating system which is executed on a host
computer or a server.
• It has its own operating system and software that will facilitate the resources to virtual computers.
• Characteristics of virtual machines
• The characteristics of the virtual machines are as follows −

• Multiple OS systems use the same hardware and partition resources between virtual computers.
• Separate Security and configuration identity.

• Ability to move the virtual computers between the physical host computers as integrated files.
Virtual Machine
• Advantages of virtual machines
• Virtual machines are easy to manage and maintain, and they offer several advantages over physical machines:   
• VMs can run multiple operating system environments on a single physical computer, saving physical space, time and
management costs. 
• Virtual machines support legacy applications, reducing the cost of migrating to a new operating system. For example, a Linux
virtual machine running a distribution of Linux as the guest operating system can exist on a host server that is running a non-
Linux operating system, such as Windows. 
• VMs can also provide integrated disaster recovery and application provisioning options. 

• Disadvantages of virtual machines


• While virtual machines have several advantages over physical machines, there are also some potential disadvantages: 
• Running multiple virtual machines on one physical machine can result in unstable performance if infrastructure requirements
are not met. 
• Virtual machines are less efficient and run slower than a full physical computer. Most enterprises use a combination of
physical and virtual infrastructure to balance the corresponding advantages and disadvantages. 
Virtual Machine
• The two types of virtual machines
• Users can choose from two different types of virtual machines—process VMs and system VMs:  
• A process virtual machine allows a single process to run as an application on a host machine, providing a platform-
independent programming environment by masking the information of the underlying hardware or operating
system. An example of a process VM is the Java Virtual Machine, which enables any operating system to run Java
applications as if they were native to that system.   
• A system virtual machine is fully virtualized to substitute for a physical machine. A system platform supports the
sharing of a host computer’s physical resources between multiple virtual machines, each running its own copy of the
operating system. This virtualization process relies on a hypervisor, which can run on bare hardware, such
as VMware ESXi, or on top of an operating system.  
Operating System Debugging
• Debugging is the process where the user needs to analyze the failure and after seeing the failures they can check the
performance and find out the error after finding out the error and fixing all the error and this type of system is called
operating system debugging.
• There are many different ways in which operating systems perform debugging.
• Log Files
• The log files record all the events that occur in an operating system. This is done by writing all the messages into a
log file. There are different types of log files. Some of these are given as follows −
• Event Logs
• These stores the records of all the events that occur in the execution of a system. This is done so that the activities of
all the events can be understood to diagnose problems.
• Transaction Logs
• The transaction logs store the changes to the data so that the system can recover from crashes and other errors. These
logs are readable by a human.
• Message Logs
• These logs store both the public and private messages between the users. They are mostly plain text files, but in some
cases they may be HTML files.
Operating System Generations
• The First Generation ( 1945 - 1955 ): Vacuum Tubes and Plugboards
• Digital computers were not constructed until the second world war. Calculating engines with mechanical relays were
built at that time. However, the mechanical relays were very slow and were later replaced with vacuum tubes. These
machines were enormous but were still very slow.
• These early computers were designed, built and maintained by a single group of people. Programming languages
were unknown and there were no operating systems so all the programming was done in machine language. All the
problems were simple numerical calculations.
• By the 1950’s punch cards were introduced and this improved the computer system. Instead of using plugboards,
programs were written on cards and read into the system.
• The Second Generation ( 1955 - 1965 ): Transistors and Batch Systems
• Transistors led to the development of the computer systems that could be manufactured and sold to paying
customers. These machines were known as mainframes and were locked in air-conditioned computer rooms with
staff to operate them.
• The Batch System was introduced to reduce the wasted time in the computer. A tray full of jobs was collected in the
input room and read into the magnetic tape. After that, the tape was rewound and mounted on a tape drive. Then the
batch operating system was loaded in which read the first job from the tape and ran it. The output was written on the
second tape. After the whole batch was done, the input and output tapes were removed and the output tape was
printed.
Operating System Generations
• The Third Generation ( 1965 - 1980 ): Integrated Circuits and Multiprogramming
• Until the 1960’s, there were two types of computer systems i.e the scientific and the commercial computers. These
were combined by IBM in the System/360. This used integrated circuits and provided a major price and performance
advantage over the second generation systems.
• The third generation operating systems also introduced multiprogramming. This meant that the processor was not
idle while a job was completing its I/O operation. Another job was scheduled on the processor so that its time would
not be wasted.
• The Fourth Generation ( 1980 - Present ): Personal Computers
• Personal Computers were easy to create with the development of large-scale integrated circuits. These were chips
containing thousands of transistors on a square centimeter of silicon. Because of these, microcomputers were much
cheaper than minicomputers and that made it possible for a single individual to own one of them.
• The advent of personal computers also led to the growth of networks. This created network operating systems and
distributed operating systems. The users were aware of a network while using a network operating system and could
log in to remote machines and copy files from one machine to another.
Any Question?

You might also like