Unit 1. O.S

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

Unit 1

System Software
Software is a set of instructions, which is designed to perform a defined task,
and it tells the computer how to work. It is of mainly two types,
namely System software and Application software. System software
is a set of computer programs that is designed to manage system
resources. It is a collection of such files and utility programs that are
responsible for running and smooth functioning of your computer system
with other hardware. Moreover, it is solely responsible for running
the operating system (OS) and managing the computer device entirely.

Types of System Software


Application Software: Application software is a type of software designed
to perform specific user tasks, such as word processing, spreadsheet
creation, and image editing.

Operating Systems: Operating systems are computer System Software


responsible for managing the hardware and software resources of a
computer system. Examples include Windows, Linux, macOS, iOS, and
Android.

Device Drivers: Device drivers are software programs that allow hardware
components to communicate with the operating system. Examples include a
printer driver, a mouse driver, and a scanner driver.

Utilities: Utilities are software programs that help maintain the proper
functioning of a computer system. Examples include antivirus programs, disk
defragmenters, and system backup programs.

Application Software: Application software is a type of software designed


to perform specific user tasks, such as word processing, spreadsheet
creation, and image editing.
Introduction to Compiler
o A compiler is a translator that converts the high-level language into the
machine language.
o High-level language is written by a developer and machine language can be
understood by the processor.
o Compiler is used to show errors to the programmer.
o The main purpose of compiler is to change the code written in one language
without changing the meaning of the program.
o When you execute a program which is written in HLL programming language
then it executes into two parts.
o

Compiler Phases
The compilation process contains the sequence of various phases. Each
phase takes source program in one representation and produces output in
another representation. Each phase takes input from its previous stage.

There are the various phases of compiler:


Lexical Analysis:
Lexical analyzer phase is the first phase of compilation process. It takes
source code as input. It reads the source program one character at a time
and converts it into meaningful lexemes. Lexical analyzer represents these
lexemes in the form of tokens.

Syntax Analysis
Syntax analysis is the second phase of compilation process. It takes tokens
as input and generates a parse tree as output. In syntax analysis phase, the
parser checks that the expression made by the tokens is syntactically correct
or not.

Semantic Analysis
Semantic analysis is the third phase of compilation process. It checks
whether the parse tree follows the rules of language. Semantic analyzer
keeps track of identifiers, their types and expressions. The output of
semantic analysis phase is the annotated tree syntax.

Intermediate Code Generation


In the intermediate code generation, compiler generates the source code
into the intermediate code. Intermediate code is generated between the
high-level language and the machine language. The intermediate code
should be generated in such a way that you can easily translate it into the
target machine code.

Code Optimization
Code optimization is an optional phase. It is used to improve the
intermediate code so that the output of the program could run faster and
take less space. It removes the unnecessary lines of the code and arranges
the sequence of statements in order to speed up the program execution.

Code Generation
Code generation is the final stage of the compilation process. It takes the
optimized intermediate code as input and maps it to the target machine
language. Code generator translates the intermediate code into the machine
code of the specified computer.

Types of Compiler
Single-Pass Compiler − In a single-pass compiler, when a line source is
processed it is scanned and the tokens are extracted. Thus the syntax of the
line is inspected and the tree structure and some tables including data
about each token are constructed..
Multi-Pass Compiler − The compiler scans the input source once and
makes the first modified structure, therefore scans the first-produced form
and makes a second modified structure, etc., until the object form is
produced. Such a compiler is known as a multi-pass compiler.
Difference between System Software and Application Software
System Software Application Software
We make use of system software for The user makes use of application
operating hardware of the computer. software to perform some specific task.
When the operating system is installed on the We install the application software
computer, then the system software is also according to the requirement of the
mounted on the machine. user.
System software works in the background. So Generally, the user interacts with the
the user is not able to interact with it. application software.
It can’t run independently because it is
It can run independently as it provides the
not able to run without the presence of
platform for the running application software.
system software.
Example: compiler, assembler, interpreter Example: word processor, web
etc.. browser, media player etc.

Introduction of Assembler

Assembler is a program for converting instructions written in


low-level assembly code into relocatable machine code and
generating along information for the loader.

Types of Assembler
One-pass Assembler

One pass assembler or single pass assembler scans the program


only once to create the equivalent binary program. In this one scan,
the assembler substitutes all the symbolic instructions present in
the assembly language program with machine code.
Two-pass/Multi-pass Assembler

The two-pass assembler translates an assembly language program


into a machine language program in two passes or multiple passes.
Moreover, the sequential passes over the assembly language code
and resolves the pseudo-op instructions present in the assembly
language code.

What is a Linker?
A linker is a program in a system, also known as a link editor and binder,
which combines object modules into a single object file. Generally, it is a
program that performs the process of linking; it takes one or multiple object
files, which are generated by compiler. And, then combines these files into
an executable files. Modules are called for the different pieces of code, which
are written in programming languages. Linking is a process that helps to
gather and maintain a different piece of code into an executable file or single
file. With the help of a linker, a specific module is also linked into the system
library.

The primary function of the linker is to take objects from the assembler as
input and create an executable file as output for the loader, as it helps to
break down a large problem into a small module that simplifies the
programming task.

Source code -> compiler -> Assembler -> Object code -> Linker -> Executable file ->
Loader

There are two types of linking, which are as follows:


1. Static Linking: Static linking is a kind of linking that is performed during
the compilation of a source program in which linking is performed
before the execution of the file or object.
2. Dynamic linking: Another type of linking is dynamic linking, which is
performed at the run time, in which multiple programs can share a
single copy of the library. It means, each module having the same
object can share information of an object with other modules rather
than linking the same object repeatedly into the library.

What is Loader
In computer systems a loader is the part of an operating system that is responsible for
loading programs and libraries. It is one of the essential stages in the process of starting
a program, as it places programs into memory and prepares them for execution.

Operating System
operating system (OS), program that manages a computer’s
resources, especially the allocation of those resources among other
programs. Typical resources include the central processing
unit (CPU), computer memory, file storage, input/output (I/O)
devices, and network connections. Management tasks include
scheduling resource use to avoid conflicts and interference between
programs. Unlike most programs, which complete a task and
terminate, an operating system runs indefinitely and terminates only
when the computer is turned off.

You might also like