0% found this document useful (0 votes)
24 views9 pages

OSSP Chap1 Notes

The document provides an overview of system programming, including the types of software, the role of translators (compilers, interpreters, assemblers), and the differences between system software and application software. It explains the functions and characteristics of system programs, their necessity, and features of system software. Additionally, it discusses the advantages and disadvantages of different types of translators and highlights the importance of system software in managing hardware and providing a user interface.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views9 pages

OSSP Chap1 Notes

The document provides an overview of system programming, including the types of software, the role of translators (compilers, interpreters, assemblers), and the differences between system software and application software. It explains the functions and characteristics of system programs, their necessity, and features of system software. Additionally, it discusses the advantages and disadvantages of different types of translators and highlights the importance of system software in managing hardware and providing a user interface.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CO254NY OPERATING SYSTEMS AND SYSTEMS PROGRAMMING

Ch 1. Introduction to system programming:


Types of software and application software, system programming and system programs, need of
system software. assemblers, loaders, compilers, interpreters, macros, operating system and
formal system, translators and its types.

Questions and Answers :

1.​ What are Translators? Explain any 3 types of Translators


Ans:
A translator is a programming language processor that converts a computer program from one
language to another. It takes a program written in source code and converts it into machine code.
It discovers and identifies the error during translation.

P
Purpose of Translator

It translates a high-level language program into a machine language program that the central
processing unit (CPU) can understand. It also detects errors in the program.
SS
Different Types of Translators

There are 3 different types of translators as follows:

Compiler

A compiler is a translator used to convert high-level programming language to low-level


programming language. It converts the whole program in one session and reports errors detected
after the conversion. The compiler takes time to do its work as it translates high-level code to
lower-level code all at once and then saves it to memory.​
A compiler is processor-dependent and platform-dependent. But it has been addressed by a
special compiler, a cross-compiler and a source-to-source compiler. Before choosing a compiler,
O

the user has to identify first the Instruction Set Architecture (ISA), the operating system (OS),
and the programming language that will be used to ensure that it will be compatible.

Interpreter

Just like a compiler, is a translator used to convert high-level programming language to low-level
programming language. It converts the program one at a time and reports errors detected at once
while doing the conversion. With this, it is easier to detect errors than in a compiler. An
interpreter is faster than a compiler as it immediately executes the code upon reading the code.​
It is often used as a debugging tool for software development as it can execute a single line of
code at a time. An interpreter is also more portable than a compiler as it is not
processor-dependent, you can work between hardware architectures.

Assembler

Made by Ms. Nikita J. Mandhan


An assembler is a translator used to translate assembly language to machine language. It is like a
compiler for the assembly language but interactive like an interpreter. Assembly language is
difficult to understand as it is a low-level programming language. An assembler translates a
low-level language, an assembly language to an even lower-level language, which is the machine
code. The machine code can be directly understood by the CPU.

Examples of Translators

Here are some examples of translators per type:

Translator Examples

Compiler Microsoft Visual Studio


GNU Compiler Collection (GCC)
Common Business Oriented Language (COBOL)

P
Interpreter OCaml
List Processing (LISP)
Python

Assembler Fortran Assembly Program (FAP)


SS
Macro Assembly Program (MAP)
Symbolic Optimal Assembly Program (SOAP)
Advantages and Disadvantages of Translators

Here are some advantages of the Compiler:

●​ The whole program is validated so there are no system errors.


●​ The executable file is enhanced by the compiler, so it runs faster.
●​ Users do not have to run the program on the same machine it was created.

Here are some disadvantages of the Compiler:


O

●​ It is slow to execute as you have to finish the whole program.


●​ It is not easy to debug as errors are shown at the end of the execution.
●​ Hardware specific, it works on specific machine language and architecture.

Here are some advantages of the Interpreter:

●​ You discover errors before you complete the program, so you learn from your mistakes.
●​ Program can be run before it is completed so you get partial results immediately.
●​ You can work on small parts of the program and link them later into a whole program.

Here are some disadvantages of the Interpreter:

●​ There’s a possibility of syntax errors on unverified scripts.


●​ Program is not enhanced and may encounter data errors.

Made by Ms. Nikita J. Mandhan


●​ It may be slow because of the interpretation in every execution.

Here are some advantages of the Assembler:

●​ The symbolic programming is easier to understand thus time-saving for the programmer.
●​ It is easier to fix errors and alter program instructions.
●​ Efficiency in execution just like machine level language.

Here are some disadvantages of the Assembler:

●​ It is machine dependent, cannot be used in other architecture.


●​ A small change in design can invalidate the whole program.
●​ It is difficult to maintain.

2.​ Difference between System Software & Application Software.(6 points)

P
Ans:
System Software Application Software

System Software maintains the Application software is built for


system resources and gives the specific tasks.
SS
path for application software to
run.

Low-level languages are used to While high-level languages are


write the system software. used to write the application
software.

It is general-purpose software. While it's a specific purpose


software.

Without system software, the Without application software


system stops and can't run. system always runs.
O

System software runs when the While application software runs as


system is turned on and stops per the user's request.
when the system is turned off.

Example: System software is an Example: Application software is


operating system, etc. Photoshop, VLC player, etc.

System Software programming is Application software programming


more complex than application is simpler in comparison to system
software. software.

The Software that is designed to A set of computer programs


control, integrate and manage the installed in the user's system and
individual hardware components designed to perform a specific task

Made by Ms. Nikita J. Mandhan


and application software is known is known as application software.
as system software.

A system software operates the Application software runs in the


system in the background until the front end according to the user's
shutdown of the computer. request.

The system software has no Application software connects an


interaction with users. It serves as intermediary between the user and
an interface between hardware and the computer.
the end user.

System software runs Application software is dependent


independently. on system software because they
need a set platform for its

P
functioning.

3.​ Write short notes on a) Compiler b) Interpreter c) Assembler.


Ans:1. Compiler
SS
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.
O

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

Made by Ms. Nikita J. Mandhan


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.​

P
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
SS
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.

Example: Perl, Python and Matlab.


O

4.​ What is System Programming and System Programs? What is the need of
System Software?
Ans:

Made by Ms. Nikita J. Mandhan


System Programs in Operating System
System Programming can be defined as the act of building Systems Software using System
Programming Languages. According to Computer Hierarchy, Hardware comes first then is
Operating System, System Programs, and finally Application Programs.

In the context of an operating system, system programs are nothing but a special software which
gives us facility to manage and control the computer’s hardware and resources.

As we have mentioned earlier these programs work more closely with the operating system so it
executes the operation fast and helpful in performing essential operation which can’t be handled
by application software.

P
SS
Note : The user can only view up-to-the System Programs he cannot see System Calls.
O

System Program Definition

System programs in an operating system are software tools that help users manage files, run
programs, and control system resources. They include file managers, program loaders, compilers,
and system utilities, making it easier to operate the computer efficiently and keep it running
smoothly.

Here are the examples of System Programs :

1.​ File Management : A file is a collection of specific information stored in the memory of
a computer system. File management is defined as the process of manipulating files in the
computer system, its management includes the process of creating, modifying and
deleting files.
2.​ Command Line Interface(CLI’s) : CLIs is the essential tool for user . It provide user
facility to write commands directly to the system for performing any operation . It is a

Made by Ms. Nikita J. Mandhan


text-based way to interact with operating system. CLIs can perform many tasks like file
manipulation, system configuration and etc.
3.​ Device drivers : Device drivers work as a simple translator for OS and devices .
Basically it act as an intermediatory between the OS and devices and provide facility to
both OS and devices to understand each other’s language so that they can work together
efficiently without interrupt.
4.​ Status Information : Information like date, time amount of available memory, or disk
space is asked by some users. Others providing detailed performance, logging, and
debugging information which is more complex. All this information is formatted and
displayed on output devices or printed. Terminal or other output devices or files or a
window of GUI is used for showing the output of programs.
5.​ File Modification : This is used for modifying the content of files. Files stored on disks
or other storage devices, we use different types of editors. For searching contents of files
or performing transformations of files we use special commands.
6.​ Programming-Language support : For common programming languages, we use

P
Compilers, Assemblers, Debuggers, and interpreters which are already provided to users.
It provides all support to users. We can run any programming language. All important
languages are provided.
7.​ Program Loading and Execution : When the program is ready after Assembling and
compilation, it must be loaded into memory for execution. A loader is part of an
operating system that is responsible for loading programs and libraries. It is one of the
SS
essential stages for starting a program. Loaders, relocatable loaders, linkage editors, and
Overlay loaders are provided by the system.
8.​ Communications : Connections among processes, users, and computer systems are
provided by programs. Users can send messages to another user on their screen, User can
send e-mail, browsing on web pages, remote login, the transformation of files from one
user to another.

System Software

System software refers to the low-level software that manages and controls a computer's
hardware and provides basic services to higher-level software. There are two main types of
O

software: systems software and application software. Systems software includes the programs
that are dedicated to managing the computer itself, such as the operating system, file
management utilities, and disk operating system (or DOS).

System software is software that provides a platform for other software. Some examples can be
operating systems, antivirus software, disk formatting software, computer language translators,
etc. These are commonly prepared by computer manufacturers. This software consists of
programs written in low-level languages, used to interact with the hardware at a very basic level.
System software serves as the interface between the hardware and the end users.

System software refers to the collection of programs and software components that enable a
computer or computing device to function properly. It acts as an intermediary between the user
and the computer hardware, allowing the user to interact with the hardware and use various
applications and programs. Some common types of system software include operating systems

Made by Ms. Nikita J. Mandhan


(such as Windows, macOS, or Linux), device drivers, utility programs, programming languages,
and system libraries.

Operating systems are the most important type of system software, as they provide the
foundational framework for all other software and applications to run on the computer. They
manage computer resources, such as memory and processing power, and provide a user interface
for users to interact with the system. Device drivers are another important type of system
software, as they allow the operating system to communicate with hardware devices such as
printers, scanners, and graphics cards. Utility programs provide additional functionality to the
operating system, such as disk defragmentation, virus scanning, and file compression.

Need of System Software

Here are some reasons why system software is necessary:

1.​ Hardware Communication: System software serves as an interface between the hardware

P
and software components of a computer, enabling them to communicate and work
together.
2.​ Resource Management: System software manages computer resources such as memory,
CPU usage, and storage, optimizing their utilization and ensuring that the system operates
efficiently.
SS
3.​ Security: System software provides security measures such as firewalls, antivirus
software, and encryption, protecting the system and its data from malware, viruses, and
other security threats.
4.​ User Interface: System software provides a user interface that allows users to interact
with the computer or computing device and perform various tasks.
5.​ Application Support: System software supports the installation and running of
applications and software on the system.
6.​ Customization: System software allows for customization of the system settings and
configuration, giving users greater control over their computing environment.

Features of System Software


O

The most important features of system software are as below.

1.​ Memory Management: operating system perform memory management. The OS keeps
track of the primary memory and allocates the memory when a process requests it.
2.​ Processor Management: OS performs process management. Allocates the main memory
(RAM) to a process and de-allocates it when it is no longer required.
3.​ File Management: Operating system perform file management. Allocates and de-allocates
the resources and decides who gets the resources.
4.​ Security: Prevents unauthorized access to programs and data using passwords.
5.​ Error-detecting Aids: Production of dumps, traces, error messages, and other debugging
and error-detecting methods.
6.​ Scheduling: The OS schedules the process through its scheduling algorithms.

Made by Ms. Nikita J. Mandhan


5.​ Difference Between Compiler and Interpreter
Ans:

Compiler Interpreter

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

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

P
The compiler generates the error message Its Debugging is easier as it continues
only after scanning the whole program, so translating the program until the error is
debugging is comparatively hard as the met.
error can be present anywhere in the
program.
SS
The compiler requires a lot of memory for It requires less memory than a compiler
generating object codes. because no object code is generated.

Generates intermediate object code. No intermediate object code is generated.

For Security purpose compiler is more The interpreter is a little vulnerable in


useful. case of security.

Examples: C, C++, C# Examples: Python, Perl, JavaScript, Ruby.


O

Made by Ms. Nikita J. Mandhan

You might also like