Topic-08
Q.1. What is Single pass Compiler?
A single pass compiler is a type of compiler that processes the source code of a
programming language in a single pass or one go. In other words, it reads the entire source
code of a program and generates the object code in one pass, without revisiting any code
that has already been processed. In a single pass compiler, the source code is analyzed and
translated into machine code in a single sweep.
Single pass compilers are commonly used in embedded systems or low-level programming
languages where code size and efficiency are crucial factors.
Q.2. What is Multi pass Compiler?
A multi pass compiler is a type of compiler that processes the source code of a
programming language in multiple passes or stages. In other words, it reads the source code
multiple times, each time performing a different analysis or transformation on the code,
before finally generating the object code.
In a multi pass compiler, the source code is analyzed and translated into machine code over
several passes, with each pass performing a specific task such as lexical analysis, syntax
analysis, semantic analysis, and code optimization
Q.3. Write down the difference between Single pass & Multi pass
Compiler.
The comparison between One-Pass and Multi-Pass Compiler are given below:
One-Pass Compiler Multi-Pass Compiler
It reads the code only once and It reads the code multiple times, each time changing it into
translates it at a similar time. numerous forms.
They are faster. They are "slower." As more number of passes means more
execution time.
Less efficient code optimization Better code optimization and code generation.
and code generation.
It is also called a "Narrow It is also called a "wide compiler." As they can scan every
compiler." It has limited scope. portion of the program.
The compiler requires large The memory occupied by one pass can be reused by a
memory. subsequent pass; therefore, small memory is needed by the
compiler.
Example − Pascal & Example − Modula -2 languages use multi-pass
C languages use one- compilation.
pass compilation.
Q.4. What is linker?
In computer science, a linker is a computer program that takes one or more object files
generated by a compiler and combine them into one, executable program.
Q.5. What is dynamic linking & Linking Editor?
Dynamic linking: It is a technique used in computer programming to allow different
programs to share a library of code at runtime, rather than each program having its own copy
of the library. This is done by having the operating system load the library into memory and
then allowing different programs to access it as needed. The advantages of dynamic linking
include reduced memory usage, faster program startup times, and easier maintenance of the
shared library.
Linking Editor: It also known as a Linker or Link Editor, is a program that takes object code
produced by a compiler and combines it with other necessary libraries to create an executable
program. The Linking Editor resolves references between different object files, assigns
memory addresses to the various code and data segments, and creates the necessary data
structures to support the program's execution. The output of the Linking Editor is an
executable file that can be run by the operating system.
Q.6. What is Loader?
A loader is a program that loads executable programs into memory and prepares them for
execution. When a program is compiled, it is converted into object code, which is not directly
executable by the computer's processor. The loader is responsible for taking the object code
and loading it into memory, resolving any references between different parts of the program,
and preparing it for execution.
Q.7. What is Machine Dependent loader?
A Machine Dependent loader is a type of loader program that is specific to a particular
computer system's hardware architecture and operating system. Its primary function is to load
and prepare executable programs or object files for execution in the main memory of the
computer system.
The loader typically performs several tasks, including:
1) Allocating memory for the program: The loader determines how much memory the
program needs and allocates it in the computer's memory.
2) Loading the program: The loader reads the object code from the executable file and loads
it into memory.
3) Relocating the program: The loader adjusts any memory references in the program to
reflect the actual memory location where the program has been loaded.
4) Linking the program: The loader links any external libraries or modules required by the
program.
5) Initializing the program: The loader sets up the program's initial state, including
initializing variables and data structures.
Q.8. What is Bootstrap loader?
A Bootstrap loader, also known as a boot loader, is a type of program that is responsible for
loading the operating system into the computer's memory when the system is first turned on.
It is the first program that runs when the computer is started up and it resides in the firmware
or read-only memory (ROM) of the computer system.
The Bootstrap loader is responsible for include checking the system hardware, configuration
system components such as the processor and memory, and initializing the input/output
devices.
Once the Bootstrap loader has completed its tasks, it loads the operating system kernel into
memory and transfers control to it. The operating system kernel then takes over control of the
system and continues the boot process by initializing the remaining system components and
loading the necessary device drivers.
Q.9. Describe Bootstrap Program?
A bootstrap program is the first code that is executed when the computer system is started.
The entire operating system depends on the bootstrap program to work correctly as it loads
the operating system.
A figure that demonstrates the use of the bootstrap program is as follows −
In the above image, the bootstrap program is a part of ROM which is the non-volatile
memory. The operating system is loaded into the RAM by the bootstrap program after the
start of the computer system. Then the operating system starts the device drivers.
Bootstrapping Process
The bootstrapping process does not require any outside input to start. Any software can be
loaded as required by the operating system rather than loading all the software automatically.
The bootstrapping process is performed as a chain i.e. at each stage, it is the responsibility of
the simpler and smaller program to load and execute the much more complicated and larger
program. This means that the computer system improves in increments by itself.
The booting procedure starts with the hardware procedures and then continues onto the
software procedures that are stored in the main memory. The bootstrapping process involves
self-tests, loading BIOS (basic input/output system), configuration settings, hypervisor,
operating system etc.
Benefits of Bootstrapping
Without bootstrapping, the computer user would have to download all the software
components, including the ones not frequently required. With bootstrapping, only those
software components need to be downloaded that are legitimately required and all extra
components are not required. This process frees up a lot of space in the memory and
consequently saves a lot of time.
Q.10. Explain Development of system software?
System software refers to a category of software that manages and controls the operation of
computer hardware and provides a platform for application software to run. It includes operating
systems, device drivers, utility software, and programming languages.
The development of system software typically involves several stages:
Planning and Requirements analysis: The first step in developing system software is
requirement analysis. It is the most important and fundamental stage. This helps to define the
features and functionality that the software should provide.
Planning for the quality assurance requirements and identification of the risks associated with the
project is also done in the planning stage.
Design: After gathering the requirements, the next step is to design the software architecture.
This involves breaking down the system into modules and defining how they will interact with
each other.
Implementation: Once the design is finalized, the software is implemented by writing code in a
programming language. This involves writing algorithms, data structures, and control structures
that will be used by the system.
Testing: After the software is implemented, it is tested to ensure that it works as intended. This
includes unit testing, integration testing, and system testing to identify and fix any defects.
Deployment: Once the software has been tested and validated, it is deployed to the production
environment. This involves installing the software on the target system and configuring it for use.
Maintenance: After the software is deployed, it requires ongoing maintenance to ensure that it
continues to function correctly. This includes fixing bugs, patching security vulnerabilities, and
updating the software to support new hardware and software platforms.
Q.11. Explain IOT in Embedded System programming.
In simpler words, embedded programming is designing and writing programs for small
computers that are embedded within devices other than traditional PCs, laptops. It’s enables
microcontrollers to awaken previously dumb devices—e.g. thermostats, lighting systems,
parking meters, etc. and give them some ability to reason about their environment.
Embedded Programming and IoT-
The Internet of Things describes a network of embedded, microprocessor-controlled devices,
where that network is connected directly or indirectly to the web. The three pillars of IoT are,
therefore:
1. Embedded programming.
2. Network technology.
3. Information technology.
Here is a brief glance at some of the ways in which IoT is changing industries:
Industry — Industrial machinery control, temperature monitoring and
cognitive anomaly detection.
Healthcare — Blood pressure monitors, heartbeat monitors, fitness trackers,
embedded medication delivery.
Aerospace and Defense — Flight control systems, actuation air and thermal
management, engine power monitoring and control.
Smart Homes — Home security systems, digital cameras, televisions and kitchen
appliances.
Compiled By
Md. Masum Billah
Lecturer
Department of CSE, CBST