Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

Unit - 5

An operating system (OS) is a critical software component that manages and facilitates the
execution of various tasks on a computer or device. It serves as an intermediary between the
hardware and software, providing a range of essential functions to ensure the efficient and secure
operation of a computing system. Here are some of the key functions of an operating system:

1. Process Management:
 Process Scheduling: The OS manages the execution of multiple processes or tasks,
allocating CPU time and resources to them based on scheduling algorithms.
 Process Creation and Termination: It allows for the creation and termination of
processes, including handling errors and resource deallocation.
2. Memory Management:
 Memory Allocation: The OS manages physical and virtual memory, allocating memory
to processes as needed.
 Memory Protection: It ensures that processes do not interfere with each other's memory
space, protecting against unauthorized access.
3. File System Management:
 File Creation, Access, and Deletion: The OS provides functions to create, access, and
delete files and directories.
 File Permissions and Security: It manages file permissions and access control to protect
data.
4. Device Management:
 Device Allocation: The OS controls access to hardware devices, such as printers, disks,
and network interfaces.
 Device Drivers: It uses device drivers to interface with hardware components and manage
communication between software and hardware.
5. User Interface:
 Graphical User Interface (GUI): Many modern operating systems offer GUIs for user
interaction, making it easier for users to interact with the system and applications.
 Command-Line Interface (CLI): Some operating systems provide a text-based interface
for advanced users and system administrators.
6. Security and Access Control:
 User Authentication: It ensures that only authorized users can access the system through
password or biometric authentication.
 Access Control Lists (ACLs): The OS enforces access control policies to restrict access
to files and resources.
 Firewall and Intrusion Detection: Some OSes include security features like firewalls and
intrusion detection systems to protect against threats.
7. Error Handling:
 Error Reporting: The OS detects and reports hardware and software errors, providing
error messages and logging.
 Error Recovery: It may attempt to recover from errors and prevent system crashes when
possible.
8. Networking:
 Network Protocol Support: The OS provides networking capabilities, including support
for various network protocols like TCP/IP.
 Network Configuration: It allows users to configure network settings and manage
network connections.
9. File System Services:
 File I/O Operations: The OS facilitates input and output operations on files and devices.
 File Caching and Buffering: It optimizes file access by using caching and buffering
techniques.
10. Resource Allocation and Monitoring:
 Resource Allocation Policies: The OS manages and allocates system resources such as
CPU time, memory, and I/O devices efficiently.
 Performance Monitoring: It monitors system performance and provides tools for system
administrators to analyze and optimize resource usage.
11. Backup and Recovery:
 Data Backup: Some OSes include backup and recovery utilities to protect against data
loss.
 System Restore: They may also support system restoration to a previous state.
12. Virtualization:
 Virtual Machines (VMs): Many modern OSes support virtualization, allowing multiple
operating systems to run on the same hardware simultaneously.

These are some of the core functions of an operating system. The specific features and capabilities
can vary depending on the type and purpose of the operating system, whether it's designed for
personal computers, servers, embedded systems, or other specialized applications.

Measuring the performance of an operating system (OS) is essential for evaluating its efficiency,
identifying bottlenecks, and optimizing system resources. Various performance metrics and tools
can be used to assess how well an operating system is functioning. Here are some common
methods for measuring system performance:

1. CPU Utilization:
 CPU Usage Percentage: Monitor the percentage of CPU utilization over time. Tools like
top (Linux/Unix) or Task Manager (Windows) can provide real-time information.
2. Memory Usage:
 Memory Usage Metrics: Track the amount of physical and virtual memory used by the
OS and processes. Utilities like free (Linux/Unix) or Task Manager (Windows) can display
memory statistics.
3. Disk Activity:
 Disk I/O: Measure the rate of read and write operations on storage devices. Tools like
iostat (Linux/Unix) or Resource Monitor (Windows) can provide disk activity data.
4. Network Activity:
 Network Throughput: Monitor network bandwidth usage, including incoming and
outgoing traffic. Tools like iftop (Linux/Unix) or Task Manager (Windows) can display
network activity.
5. Process and Thread Analysis:
 Process Statistics: Analyze individual processes' CPU and memory usage, helping
identify resource-intensive applications. Tools like ps (Linux/Unix) or Task Manager
(Windows) can assist in this.
6. Latency and Response Time:
 Latency Measurements: Measure the time it takes for system responses, including disk
access, network communication, and application response times. Tools like ping (for
network latency) and application-specific profiling tools can help.
7. Hardware Performance Monitoring:
 Hardware Sensors: Use hardware monitoring tools or built-in sensors (e.g., lm-sensors
on Linux) to monitor CPU temperature, fan speed, and other hardware parameters that can
impact system performance.
8. System Logs and Event Logs:
 Analyze system and event logs for error messages, warnings, and anomalies that can
indicate performance issues or failures.
9. Benchmarking:
 Conduct benchmark tests to assess the system's performance under specific workloads or
conditions. Benchmarking tools like Geekbench, PassMark, or sysbench (for Linux) can
help with this.
10. Profiling and Tracing:
 Use profiling and tracing tools (e.g., perf, strace, dtrace) to gather detailed information
about system calls, application behavior, and resource usage.
11. Power Consumption:
 Measure the power consumption of the system, especially important for mobile devices
and laptops. Specialized tools and hardware can help with power profiling.
12. Security Monitoring:
 Monitor security-related metrics, such as intrusion detection system (IDS) alerts, firewall
logs, and access control audit logs to ensure system security doesn't compromise
performance.
13. User Experience:
 Collect feedback from users to gauge their experience, including responsiveness and
satisfaction with the system.
14. Custom Metrics:
 Depending on your specific use case or requirements, you may need to define and measure
custom performance metrics relevant to your application or workload.

It's important to note that performance measurement should be conducted in various scenarios and
under different workloads to get a comprehensive view of how the operating system behaves.
Additionally, regular monitoring and analysis are crucial for identifying performance degradation
over time and taking proactive measures to maintain or improve system performance.
Computer programs are generally written in high-level languages (like C++, Python, and Java). A
language processor, or language translator, is a computer program that convert source code from
one programming language to another language or human readable language. They also find errors
during translation.

What is Language Processors?

Compilers, interpreters, translate programs written in high-level languages into machine code that
a computer understands and assemblers translate programs written in low-level or assembly
language into machine code. In the compilation process, there are several stages. To help
programmers write error-free code, tools are available.

Assembly language is machine-dependent, yet mnemonics used to represent instructions in it are


not directly understandable by machine and high-Level language is machine-independent. A
computer understands instructions in machine code, i.e. in the form of 0s and 1s. It is a tedious
task to write a computer program directly in machine code. The programs are written mostly in
high-level languages like Java, C++, Python etc. and are called source code. These source code
cannot be executed directly by the computer and must be converted into machine language to be
executed. Hence, a special translator system software is used to translate the program written in a
high-level language into machine code is called Language Processor and the program after
translated into machine code (object program/object code).

Types of Language Processors

The language processors can be any of the following three types:

1. Compiler

The language processor that reads the complete source program written in high-level language as
a whole in one go and translates it into an equivalent program in machine language is called a
Compiler. Example: C, C++, C#.
In a compiler, the source code is translated to object code successfully if it is free of errors. The
compiler specifies the errors at the end of the compilation with line numbers when there are any
errors in the source code. The errors must be removed before the compiler can successfully
recompile the source code again the object program can be executed number of times without
translating it again.

2. Assembler

The Assembler is used to translate the program written in Assembly language into machine code.
The source program is an input of an assembler that contains assembly language instructions. The
output generated by the assembler is the object code or machine code understandable by the
computer. Assembler is basically the 1st interface that is able to communicate humans with the
machine. We need an assembler to fill the gap between human and machine so that they can
communicate with each other. code written in assembly language is some sort of
mnemonics(instructions) like ADD, MUL, MUX, SUB, DIV, MOV and so on. and the assembler
is basically able to convert these mnemonics in binary code. Here, these mnemonics also depend
upon the architecture of the machine.

For example, the architecture of intel 8085 and intel 8086 are different.

3. Interpreter

The translation of a single statement of the source program into machine code is done by a
language processor and executes immediately before moving on to the next line is called an
interpreter. If there is an error in the statement, the interpreter terminates its translating process at
that statement and displays an error message. The interpreter moves on to the next line for
execution only after the removal of the error. An Interpreter directly executes instructions written
in a programming or scripting language without previously converting them to an object code or
machine code. An interpreter translates one line at a time and then executes it.
Difference between Compiler and Interpreter
Compiler Interpreter

A compiler is a program that converts the entire An interpreter takes a source program
source code of a programming language into and runs it line by line, translating each
executable machine code for a CPU. line as it comes to it.

The compiler takes a large amount of time to An interpreter takes less amount of time
analyze the entire source code but the overall to analyze the source code but the
execution time of the program is comparatively overall execution time of the program is
faster. slower.

The compiler generates the error message only


Its Debugging is easier as it continues
after scanning the whole program, so debugging
translating the program until the error is
is comparatively hard as the error can be present
met.
anywhere in the program.

The compiler requires a lot of memory for It requires less memory than a compiler
generating object codes. because no object code is generated.

No intermediate object code is


Generates intermediate object code.
generated.

The interpreter is a little vulnerable in


For Security purpose compiler is more useful.
case of security.

Examples: Python, Perl, JavaScript,


Examples: C, C++, C#
Ruby

 What is a batch operating system?


—A batch operating system is where users do not directly interact with the computer and jobs are
organized into batches based on similarities.

 What is the drawback of a batch operating system?


—The drawback of a batch operating system is potential CPU idleness while waiting for one batch
to complete before moving on to the next.
 What is a multi-programmed operating system?
—A multi-programmed operating system allows for continuous execution without idle time by
giving multiple programs to the CPU simultaneously.

 How does a multi-processing operating system work?


—In a multi-processing operating system, different processors can access memory and execute
multiple processes at the same time.

 What is a distributed operating system?


—A distributed operating system, also known as a network operating system, allows for faster and
shared execution of jobs by connecting multiple processors to the same computer.

Multiprocessor OS

A multiprocessor operating system is an operating system that uses multiple processors to improve
performance. This operating system is commonly found on computers with more than one CPU.
Multiprocessor systems improve system performance by allowing the execution of tasks on
multiple processors simultaneously. Overall reduces the time it takes to complete specific tasks.

Multi-programming OS

The operating system which can run multiple processes on a single processor is called a
multiprogramming operating system. There are different programs that want to get executed. So
these programs are kept in the ready queue. And are assigned to the CPU one by one. If one process
gets blocked then other processes from the ready queue are assigned to the CPU. The aim of this
is optimal resource utilization and more CPU utilization. In the below figure, different processes
are there in RAM (main memory). Some processes are waiting for the CPU, and process 2(which
was previously executing) is now doing I/O operations. So CPU shifted to execute process 1.

Distributed OS

A distributed operating system is an operating system that is designed to operate on a network


of computers. Distributed systems are usually used to distribute software applications and data.
Distributed systems are also used to manage the resources of multiple computers. Users could be
at different sites. Multiple computers are connected via a single communication channel. Every
system has its own processor and memory. Resources like disk, computer, CPU, network interface,
nodes, etc., are shared among different computers at different locations. It increases data
availability in the entire system.

Multitasking OS

Multi-tasking operating systems are designed to enable multiple applications to run


simultaneously. Multi-tasking operating systems allow multiple users to work on the same
document or application simultaneously.

For example, a user running antivirus software, searching the internet, and playing a song
simultaneously. Then the user is using a multitasking OS.

Time-sharing OS

A time-sharing operating system is an application that provides a shared user interface with
multiple users logged in simultaneously. It allows multiple users to access the same resources,
such as files and applications, as long as they are logged in simultaneously. This operating system
type is most commonly used in businesses, especially those that involve many simultaneous users.
Time-sharing operating systems enable users to finish their jobs on a system at once. The time-
sharing OS is the latest advancement in the computer science world; it is being accepted
worldwide, also at an increasing rate.
DOS: DOS stands for Disk Operating System, which is an operating system that was popular till
1995 in IBM PCs. It is a single-tasking OS i.e., it can perform one task at a time. It is based on a
command-line interface where one has to provide instructions to the computer in the command
form. It runs from hard disks, floppy disks, or any other storage devices and thus provides an
environment for the execution of programs. It occupies less memory. To use more than 64kb of
memory, memory extenders were used, which older Windows used to use more memory. It was
originally released only to OEMs (Original Equipment Manufacturers) who added support for their
hardware. It was eventually released to the public.

Windows: Windows is a product of Microsoft. It is an operating system with various versions,


Windows 10 being the latest version. It is a Graphics-Based user interface. Users give commands
through clicking or choosing icons and images with the help of a mouse, keyboard, or touchscreen
to the computer. Windows was originally a DOS extender running on top of DOS. The Windows
9x family consisting of Windows 95, Windows 98, Windows 98SE, and Windows ME ran on top
of MS-DOS and is capable of running DOS programs directly. Windows NT was released
separately and is portable, and initially, it was written in C and C++ languages where processor
reliability code is separated into DAL and HLL and was designed to be more secure than DOS and
the Windows 9x family. The Windows NT family includes Windows NT 3.x,4.x, Windows 2000,
Windows XP, Windows Vista, Windows 7, and so on. Windows is more reliable than DOS and
handles errors with ease due to various tools available for debugging and error handling.

Linux: Linux is a freely distributed multitasking and multi-user operating system that behaves like
UNIX. It was originally developed by a Finnish student, LINUS TORVALDS in 1991. It is the
best known and most commonly used open-source operating system. It is a cross-platform
operating system based on UNIX that can be installed on PCs and laptops.

Comparison Between DOS, Windows, And Linux


Feature DOS WINDOWS LINUX

Developed by Developed by Linux is developed by Open


Development Microsoft. Microsoft. Source Development.

License Proprietary Proprietary Open-source

It supports a Text- It supports both Command-


It supports Graphical
Based/ Command- line interfaces/Graphical
User Interface
Interface line interface. user interfaces.

DOS is unable to
run multiple Windows supports
Linux supports multitasking
processes at the multitasking
Multitasking same time.

DOS was Windows was Linux is distributed by


distributed by distributed by various vendors, such as
Distribution Microsoft. Microsoft. Red Hat, Fedora, etc.

Linux can be installed on a


DOS can be Windows can be
wide variety of computer
installed on installed on PC
hardware, mobile phones,
standalone PC desktops, laptops,
and video game consoles to
desktops or servers, and some
mainframes and
laptops. mobile phones.
Usage supercomputers.

It is possible to
Expansions for
change the
DOS can be One can rewrite the code for
background and
downloaded so that Linux so that it can be
general color schemes
one can customize customized further.
and fonts for windows
them.
Customization desktops.

DOS is not very


reliable because it Linux is very reliable and is
Windows is not even
crashes easily if a known for being run for
reliable, with it
program doesn’t months or even years
crashing/needing to be
open properly or a without needing to be
restarted all the time.
wrong command is rebooted.
Reliability issued.
Feature DOS WINDOWS LINUX

DOS is not very


Easy to manage. Difficult to manage.
Management easy to manage.

DOS is free of
charge to It is not free. Linux is free to download.
Cost download.

DOS is a single-
Windows is a multi- Linux is a multi-user
user operating
user operating system. operating system.
User- Support system.

UNIX and DOS commands

Back in the days before Microsoft Windows dominated the PC market, operating system were
controlled by commands. PC users were required to learn these commands in order to perform
tasks. During the 1980s, Microsoft DOS dominated the PC market while the early UNIX
command systems were used on larger multi-processing servers. The main difference between
UNIX and DOS is that DOS was originally designed for single-user systems, while UNIX was
designed for systems with many users.

While PC's have evolved into GUI interfaces such as Windows, UNIX systems have never
evolved into GUI environments. Hence, The Oracle professional must master a bewildering
number of cryptic UNIX commands in order to manage their Oracle databases.

One of the most confounding issues for the UNIX neophyte is being confronted with a complex
UNIX command. The cryptic nature of UNIX is such that even the most seasoned UNIX
professional may have trouble deciphering the purpose of the command.

We will begin by examining a cryptic UNIX command and then see how the command is
deciphered by applying a simple set of rules.

Because UNIX and MS-DOS were developed at the same time they share some common syntax,
and the UNIX neophyte will be happy to find many common commands and concepts.

Below is a simple table showing some common UNIX commands and their Windows
counterparts.
UNIX WINDOWS
cat type, copy
cd cd (plus if changing drives, type the drive letter first)
e.g. C:>D:
D:>cd D:\test
cp copy, xcopy
cron at, Task Scheduler
ftp ftp
grep find, findstr
ls dir
man help
mkdir mkdir
more more
mv rename - to rename, move - actually move a file
netstat netstat
nslookup nslookup
ping ping
ps Task Manager, tasklist
pwd cd
rm del
rmdir rmdir
telnet telnet
traceroute tracert
who net session

UNIX MS-DOS Command Function


-- cd - Switch between current and last
directory
cat Type Displays the contents of a file
cd Cd Moves from one directory to
another
cd /u01/test cd c:\u01\test Change directory paths
cd .. cd.. Go up in directory
chmod Attrib Sets file permissions
clear Cls Clear the screen
cp copy Copies a file (or a group of files)
diff fc Compare two files
cpio xcopy Backs up and recovers files
date date Display the system date
doskey <ctl> k (3) Display command history
UNIX MS-DOS Command Function
export prompt Change the command prompt text
PS1=?xx?
find grep Find a character string in a file
gzip dblspace Compress a data file
ln -- Forms a link to a file
lp print Queues a file for printing
lpstat print Displays the printing queue
ls -al dir Displays the contents of a directory
mem lsdev (2) Display RAM memory
mkdir md Creates a new subdirectory
move cp (4) Move a file to another directory
mv rename Renames a file
rm del Deletes a file (or group of files)
rmdir rd Deletes an existing directory
setenv (1) set Set an environment variable
sort sort Sorts lines in a file
ver uname -a Display OS version
Vi edit Creates and edits text

You might also like