Research Activity 2
Research Activity 2
Research Activity 2
A bootstrap is the program that initializes the operating system (OS) during startup. The term bootstrap
or bootstrapping originated in the early 1950s. It referred to a bootstrap load button that was used to
initiate a hardwired bootstrap program, or smaller program that executed a larger program such as the
OS. The term was said to be derived from the expression “pulling yourself up by your own bootstraps,”
starting small and loading programs one at a time while each program is “laced” or connected to the
next program to be executed in sequence.
Bootstrapping is the process of loading a set of instructions when a computer is first turned on or
booted. During the startup process, diagnostic tests are performed, such as the power-on self-test
(POST), that set or check configurations for devices and implement routine testing for the connection of
peripherals, hardware and external memory devices. The bootloader or bootstrap program is then
loaded to initialize the OS.
GNU Grand Unified Bootloader (GRUB): A multiboot specification that allows the user to choose
one of several OSs
NT Loader (NTLDR): A bootloader for Microsoft’s Windows NT OS that usually runs from the
hard drive
Linux Loader (LILO): A bootloader for Linux that generally runs from a hard drive or floppy disc
Network Interface Controller (NIC): Uses a bootloader that supports booting from a network
interface such as Etherboot or pre-boot execution environment (PXE)
Prior to bootstrapping a computer is said to start with a blank main memory. The bootstrap allows the
sequence of programs to load in order to initiate the OS. The OS is the main program that manages all
programs that run on a computer and performs tasks such as controlling peripheral devices like a disc
drive, managing directories and files, transmitting output signals to a monitor and identifying input
signals from a keyboard.
Bootstrap can also refer to preparing early programming environments incrementally to create more
complex and user-friendly programming environments. For example, at one time the programming
environment might have consisted of an assembler program and a simple text editor. Over time, gradual
improvements have led to today's sophisticated object-oriented programming languages and graphical
integrated development environments (IDEs).
Warm Booting: Cold booting is the process of starting up a computer that is switched off. Usually, it is
performed by pressing the power button on the computer. Warm Boot is also called soft boot. It refers
to when we restart the computer. Here, the computer does not start from the initial state. When the
system gets stuck sometimes it is required to restart it while it is ON. Therefore, in this condition the
warm boot takes place. Restart button or CTRL+ALT+DELETE keys are used for warm boot.
Cold Booting: Warm booting is the process of restarting a computer. It can be initialized using the
operating system. In Windows, the user can perform warm booting by selecting the restart option from
the start menu. In Mac, the user can perform warm booting by selecting restart from the Apple menu.
A cold boot is also called a hard boot. It is the process when we first start the computer. In other words,
when the computer is started from its initial state by pressing the power button it is called cold boot.
The instructions are read from the ROM and the operating system is loaded in the main memory.
1. The Startup
It is the first step that involves switching the power ON. It supplies electricity to the main components
like BIOS and processor.
It is an initial test performed by the BIOS. Further, this test performs an initial check on the input/output
devices, computer’s main memory, disk drives, etc. Moreover, if any error occurs, the system produces a
beep sound.
3. Loading of OS
In this step, the operating system is loaded into the main memory. The operating system starts working
and executes all the initial files and instructions.
4. System Configuration
In this step, the drivers are loaded into the main memory. Drivers are programs that help in the
functioning of the peripheral devices.
System utilities are basic functioning programs, for example, volume control, antivirus, etc. In this step,
system utilities are loaded into the memory.
6. User Authentication
If any password has been set up in the computer system, the system checks for user authentication.
Once the user enters the login Id and password correctly the system finally starts. the process of
computer bootstrapping and the relation of the Operating System on it.
a. Interrupt
Interrupts are signals sent to the CPU by external devices, normally I/O devices. They tell the CPU to stop
its current activities and execute the appropriate part of the operating system.
Hardware Interupts are generated by hardware devices to signal that they need some attention
from the OS. They may have just received some data (e.g., keystrokes on the keyboard or an
data on the ethernet card); or they have just completed a task which the operating system
previous requested, such as transfering data between the hard drive and memory.
Software Interupts are generated by programs when they want to request a system call to be
performed by the operating system.
Traps are generated by the CPU itself to indicate that some error or condition occured for which
assistance from the operating system is needed.
Interrupts are important because they give the user better control over the computer. Without
interrupts, a user may have to wait for a given application to have a higher priority over the CPU to be
ran. This ensures that the CPU will deal with the process immediately.
b. Traps
A trap changes the mode of an OS to a kernel routine. Here, the OS executes some actions and returns
the control to the process it was executing before. During a trap, the execution of a process is set as a
high priority compared to user code.
Moreover, the trap handler is synchronous. When the OS detects a trap, it pauses the user process. As
soon as the system call is completed, the OS resumes and continues the execution of the user processes:
Additionally, a trap can be viewed as a CPU interrupt handler. The OS saves the stack pointers, registers
memory, and can resume its previous execution again.
Let’s take an example. Suppose a user running a program on an OS. There is a print statement in the
program:
printf(“%s\n”, str);
The OS executes this statement and triggers the print functionality. Furthermore, the print function
displays the string returned by the code in the monitor. Hence, this is an example of a trap.
The OS executes the print statement with high priority. As soon as the OS encounters this statement, it
switches to kernel mode. After the OS finishes the execution, the mode is switched back to the user
mode.
5. Discuss the different I/O Techniques used by Operating System (Programmed I/O(Polling),
Interrupt Driven I/O (Interrupt-Based I/O), and Direct Access Memory).
1. Programmed I/O :
In this mode the data transfer is initiated by the instructions written in a computer program. An input
instruction is required to store the data from the device to the CPU and a store instruction is required to
transfer the data from the CPU to the device. Data transfer through this mode requires constant
monitoring of the peripheral device by the CPU and also monitor the possibility of new transfer once the
transfer has been initiated. Thus CPU stays in a loop until the I/O device indicates that it is ready for data
transfer. Thus programmed I/O is a time consuming process that keeps the processor busy needlessly
and leads to wastage of the CPU cycles.
This can be overcome by the use of an interrupt facility. This forms the basis for the Interrupt Initiated
I/O.
This mode uses an interrupt facility and special commands to inform the interface to issue the interrupt
command when data becomes available and interface is ready for the data transfer. In the meantime
CPU keeps on executing other tasks and need not check for the flag. When the flag is set, the interface is
informed and an interrupt is initiated. This interrupt causes the CPU to deviate from what it is doing to
respond to the I/O transfer. The CPU responds to the signal by storing the return address from the
program counter (PC) into the memory stack and then branches to service that processes the I/O
request. After the transfer is complete, CPU returns to the previous task it was executing. The branch
address of the service can be chosen in two ways known as vectored and non-vectored interrupt. In
vectored interrupt, the source that interrupts, supplies the branch information to the CPU while in case
of non-vectored interrupt the branch address is assigned to a fixed location in memory.
Direct memory access (DMA) is a method that allows an input/output (I/O) device to send or receive
data directly to or from the main memory, bypassing the CPU to speed up memory operations.
A defined portion of memory is used to send data directly from a peripheral to the motherboard without
involving the microprocessor, so that the process does not interfere with overall computer operation.
In older computers, four DMA channels were numbered 0, 1, 2 and 3. When the 16-bit industry standard
architecture (ISA) expansion bus was introduced, channels 5, 6 and 7 were added.
ISA was a computer bus standard for IBM-compatible computers, allowing a device to initiate
transactions (bus mastering) at a quicker speed. The ISA DMA controller has 8 DMA channels, each one
of which associated with a 16-bit address and count registers.
ISA has since been replaced by accelerated graphics port (AGP) and peripheral component interconnect
(PCI) expansion cards, which are much faster. Each DMA transfers approximately 2 MB of data per
second.
A computer's system resource tools are used for communication between hardware and software. The
four types of system resources are:
I/O addresses.
Memory addresses.
Interrupt request numbers (IRQ).
Direct memory access (DMA) channels.
DMA channels are used to communicate data between the peripheral device and the system memory.
All four system resources rely on certain lines on a bus. Some lines on the bus are used for IRQs, some
for addresses (the I/O addresses and the memory address) and some for DMA channels.
A DMA channel enables a device to transfer data without exposing the CPU to a work overload. Without
the DMA channels, the CPU copies every piece of data using a peripheral bus from the I/O device. Using
a peripheral bus occupies the CPU during the read/write process and does not allow other work to be
performed until the operation is completed.
With DMA, the CPU can process other tasks while data transfer is being performed. The transfer of data
is first initiated by the CPU. The data block can be transferred to and from memory by the DMAC in
three ways.
In burst mode, the system bus is released only after the data transfer is completed. In cycle stealing
mode, during the transfer of data between the DMA channel and I/O device, the system bus is
relinquished for a few clock cycles so that the CPU can perform other tasks. When the data transfer is
complete, the CPU receives an interrupt request from the DMA controller. In transparent mode, the
DMAC can take charge of the system bus only when it is not required by the processor.
However, using a DMA controller might cause cache coherency problems. The data stored in RAM
accessed by the DMA controller may not be updated with the correct cache data if the CPU is using
external memory.
Solutions include flushing cache lines before starting outgoing DMA transfers, or performing a cache
invalidation on incoming DMA transfers when external writes are signaled to the cache controller.