SS 4,5
SS 4,5
Loader C51
50 Semester TP Solved eries (System Softwar Liskea
r n
and
B.Tech. Fifth loader and
KTu the role of both linker:
4.3 shows to re-translate the user's program every
P i g u r e
t itime
s necessary
it is run.
Module 4 S u n c e
Pmgralm
tProgran
5)
4)
tis very difficult to handle multiple segments.
t is very difficult to
programs.
produce orderly module
Code Ready or
Execution
Loader
Ques 5) Discuss relocating
advantages and disadyantages.
loader with their
Linker and Loade.
Memory Ans:
Role
of Both Loader and Linker Relocating Loader (Relative Loader)
Tigure 4.3:
Discuss aassemble-and-go loader with their
The heart of a linker or loader's actions is relocation and
Step 5: Initializes the machine registersinc
ncluding h Discuss
ssen
code modification. The process of modifying the addresses
LOADER AND LINKER stack pointer
4)
QDesntages and disadvantages. used in the address dependent instructions of a program
Ans: Assemble-and-Go Loader Such that the program can execute from any allocated area
Ques 1) What is loading and linking? to a start-up routine that one in which the assembler
of the memory is called Program Relocation. oaders
Step 6: Jumps the stack S the ble-and-gO
loader is
argumenis from performing such a task is called relocating loader. As part
Or program S As the process of compiling and then places the
Define terms: and calls the progralm s main routine. BIsters of the loading process, the loader modifies the object code
jselt u nstructions in the designated memory
i) Loading 5sembled assembilng procesS 1s done first and then
to retlect the actual addresses assigned. Relocating loaders
i) Relocation Types of Loader ations. The are versatile when compared to the absolute loaders, when it
cembler causes a transrer the first instruction of
toO
ii) Linking 1) Assemble-and-Go Loader Comes to re-assembling routines every time when a single
gram. This loading scheme, is also known as routine is changed.
Relocating Loader (Relative Loader) the Pbler-and-Go.The loader here has just one
Ans: Loading and Linking 2)
Loader) instruction that
directs the loading of the newly assembled
Advantages of Relocating Loaders
The Source
Program written in assembly language or hign 3) Absolute Loader (Bootstrap memory. For example, WATFOR
level language will be converted to
object program, which de into the 1) Program can be loaded and executed in different parts
15 1n the machine language form for execution. This 4) Direct Linking Loader FORTRAN Compiler of memory irrespective of the address.
2) Relocation is done by the usage of relocation bits.
conversion either from assembler or from compiler,
contains translated instructions and data values from the Ques 3) What are the basic functions of a loader Compile and
3) Allocation is done by the availability of program length.
Go Program
sOurce program, or specifies addresses in primary memory (2020[03) Source
Translator, Loaded in
4) Linking is also done, as a part of the loading process
itself.
to be loaded for execution. This Program Memory
where these items arethree Ans: Basic Loader
Functions e.g 5) Loader performs all the four functions given below:
contains
1
the following processes, and they are, A loader is a system program that pertorms the loadimg
Assembler
i) Memory allocation,
Loading: It allocates memory location and brings the
object program into memory for execution - (Loader)
function: It brings object program into memory and start
ii) Subroutine linkages,
its execution. The role of loader 1S as snown in the figure
iil) Relocation, and
2) Linking: It combines two or more separate object 4.1:
ASsembler
iv) Loading of code into the memory.
programs and supplies the information needed to
Figure 4.4: Compile and Go Loader
allowreferences between them -(Linker)
Object Loader Object Disadvantages of Relocating Loaders
3) Relocation: It modifies the object program so that it Source-ransia"
Program Program TOgr Advantages of Assemble-and-go loader 1 The complexity of the loader increases with the
can be loaded at an address different from the location 1) Itis relatively easy to implement. capability to handle larger number
program SIze and
originally specified - (Linking Loader)
Exccui0n 2) Involves no extra procedures. of subroutines.
increased overhead on as there is
2) There is an memory
Disadvantages of Assemble-and-go loader increase in number of subroutines.
Ques 2) What is loader? List the various steps of 1) A portion of memory is wasted.
loader. Also list the various types of loaders. Figure 4.1: Role of Loader
Memory Discuss bootstrap loader (absolute loader) with their advantages and disadyantages.
Ans: Loader Ques 6)
Translator may be assembler/compiler, which generates
A loader is a utility of an operaling system. It copies the object program and later loaded to the memory by the Ans: Absolute Loader (Bootstrap Loader)
programs from a storage device to a computers The absolute loader is the simplest of all the loaders.
loader for execution.
main memory. where the program can then be executed 0000 Absolute 0000 Relocatable
Loader perfoms the loading function. It is responsible for In figure 4.2 the translator is specifically an assembler, 00FF Toader
00EE loader
initiating the execution of the process. which generates the object loaded, which becomesinput to
0100
the loader
Various Steps a Loader Performs 0110
Loaded
The various steps required for working of loader are as BRA 0110
follows: Source Object 01FO - - - - -
progran 4100
rogram
Assembler Dject Loader 4110 ------:
determine the
Step 1: Read executable file's header to Program Program
Ready 1or
01FF
BRA4110
Relocatable
size of text and data segments. program
Execution 41FE
Step 2: Create a new address space for the program
Step 3: Copies instructions and data into address space FFFFL
FFER (b)
the program the Figure 4.51 Memory Map
Step 4: Copies arguments passed to on
Figure 4,2: Role of Loader with
Memory
stack.
C-52 TP Solved Series (System
ed Serics(System (odule 4)
C-53
SotWare) kn
(Modu
Semester
B.Tech, Fifth
L o d e r
and
Loa
(2019 03]) But the disadvantages arc, the need for programmer to
determined address memory starting fromap Absolute Loader
(figure 4.5). The machine ns: Design
ol
Desn of absolute loa an
loader is very simple. The object Specity the actual address, and, difficult to use subrouline
program so loaded will work langug Ans: Direct
Linking
Loader
: Or
absolute
libraries.
starting from the specified corectly only if it is loadea
address. Absolute type or
A direct Jinking loader 1S a general relocatableload
an The
operilo
oaded to specitied
locationsiin the memory. At the
loader is most popular
sCheme presentl is der jumps to the specitied address to begin
impractical, as there are lots of is perhaps the d The algorithm for this type of loader is given below. The
involved in loading the complieations
program. "Bootstrap loader 1s an allows programming
muluple procedure seo the O the loaded program. The role of absolute
Object program and, the object program loaded into
example of absolute loader. This gives the a
progan execulion
in the figure 4.6: memory by the absolute loader are also shown. Each byte
data segment.
s h o w n i
multiple mon s as
references in the routines become tedious and 1) External Symbol Directory (ESD): It provides end
address specified in End record
One byte
charncter
complex. information about all symbols defined and used in t jump to
source program. It is basicaliy a symbol dictionaryor end H.COPY 001000,00107A
Ques 7) Given an idle computer with no program in look-up. This is the symbol table. T,001000,1E,141033,482039,001036,281030,301015,482061,3C1003,00102A,0C1039,00102D
memory, how do we get things started? 2020[03]) T00101E,15,0C1036,482061,081033,4COO00,454F46,000003,000000
2) Text (TXT): It contains the actual translated object
code, non-relocated data, initial values and so on. T002039,1E,041030,001030,E0205D,30203F,DS20SD,281030,302057,549039,2c205E,38203F
Ans: In this situation. with the machine empty and idle,
T002057,1C,101036,4C0000,EL,001000,041030,E02079,302064,509039,DC2079,2C1036
there is no need for program relocation. We can simply 3) Relocatable and Linkage Directory (RLD):
T,002073,07,382064,4CO000,05
specify the absolute address for whatever program is first contains information about address sensiti
loaded. Most often, this program will be the operating E,0O1000
instructions in the source program. They need to be (a) Object Program
system, which occupies a predefined location in memory. relocated as performed in relocating loader
Memory address Contents
This means that we need some means of accomplishing 4) End (END): It signifies the end of the object deek
the functions of an absolute loader. This is the last card in an object deck.
0000 x XX X**XXXXXXXXXX XXXXXXXXXXXX XXX
0010 x xxXAXXX XXXX X*XX
Some early computers required the operator to enter into
memory the object code for an absolute loader, using Advantages of Direct Linking Loader AX
1) It provides the programmer with multiple procedure OFFO X XXX XXXX XXXXXXXX X XX XX X XX X*X
switches on the computer console. However, this process 10001 4 I 0334 8 2039 0010 36281 0 30 3 01014 SHalf
segments & multüple data segments. 00 I 0 200e T 0byte
is much too inconvenient and error-prone to be a good 1010|206 1 3CI0 0300I02A 0CI039
2) It provides endorsement referencing& accessing ability 8 2061 08IO334C 0000 4 3
O 0000 cOpY
solution to the program. 102036 4
3) It allows independent translations of programs along X *XXX XX* XXXX AXX AAA
1030 10 0 0 0 00XX
with above benefits.
On some computers, an absolute loader program is
resident in a read-only memory (ROM). O 30 0010 3 0E 0
permanenuly
XXXXX*XXXxO4T
XX XXXXX
Disadvantages of Direct Linking Loader 2030X 28103 0 30 2 0 5 7 5 490
When some hardware signal occurs (for example, the 3FD8 2 05D
D3020
The linking and loading need to be postponed until the 2040 |2 0 5 0 0 F 1 o01
1036 4 CO0 0
operator pressing a "system start switch), the machine execution. During the cxecution if at all any subroutine is
2050 3 9 2 C205 E 38203 FI0 39 DC20 79
2060 0 00 4 1030 E020 7930 20645 0 9 0
begins to execute this ROM program. On some computers, TX
the program is executed directly in the ROM; on others the needed then the process of execution needs to be 20702 CT0 36 38 20 64 4C0 0 000 5X X X
XXX AX A XI XIA
from ROM to main memory and
Suspended until the required subroutine gets loaded in the 2080 x XX*X XXX
XXXXX*X*
program is copied
main memory.
executed there
(b) Program Loaded in Memory
However, some machines do not have such read-only Ques 9) Discuss the design of absolute loader,
4.7: Londing ot an Absolute Program
inconvenient to change a Or Figure
storage. In addition, it can be the End record is encountered,
the
ROM program if modifications in the absolute loader
Give the algorithm for an absolute loader. (2017 (03) Text record is read to memory. When
Header record is first checked. Then, cach
are
The
Or
required. loader jumps to the specificd nddress,
SUbrouune iorcut Line Mnchine
Ans: Lnbel Instruction
In our
Object Program Format i) Most such libranes contain man Number Address Operand
object subroutines than will be used Objeet
given using itsprogram. each byte of
by any more
one 5 0000 COPY
START Code
hexadecimal assembled code is program. 10 0000 FIRST 0 Relocatable program
form representation in character t) To make efficient use of memory, it is 0003
STL RETADR
17202D
exacuy impor
LDB
be able to select and load WLENGTH 69202D
For those
example, the opcode for STL that are needed. routines 15
--
BASE LENGTH
O000-- CLOOP.-ISUB.-_.-RDREC
represented by the pair of instruction would be
1)
When they are characters1" and 20 000A
LDA 4BIO1036---------
read
Dytes of memory and by
the loader,
they occupy two
Ques 12) Describe the machine dependent f e
loader.
ependent ieatures of 25 000D
0010
COMP
LENGTH
0
032026
290000
With hexadecimal must be stored in a 0
91t
- Address decreases
B.Tech, Fifth Semester TP Solved Series (System Softwn (Module 5) C-77
ware) KTU Processors
Ques 12) Discuss different Macro
macro with example. types of
parameters used in Example: the macro definition usin of Macro Parameters: Most macro
keyword Concatenation WHILE-ENDW Structure
paurneters to be concatenated with
D
Or
parameters processor
allows
i) When an WHILE statement is encountered dunng
Writenotes on MACRO ther character strings. For example, consider that
the expansion of a macro, the specified Boolean
suitable examples. keyword macro
parameters, giving INCR_M &MEM VAL=, the parameter to such a macro instruction is named Cxpression is evaluated.
(2017 [05]) &INCR_VAL=, ®= &ID. The body of the macro definition might contain
Or i) TRUE
Differentiate between MOVER ®, &MEM_VAL a statement like
parameters.
Keyword and Positional macro ADD ®, &INCR_VAL LDA X&ID1 a) The macro processor continues to process
lines from DEFTAB until it encounters the
(2018[03]) MOVEM ®, &MEM_ VAL &ID is concatenated alter the string "X and before
next ENDW statement.
Ans: Types of Parameters in MEND
Macro the string T . b) When ENDW is encountered, the macro
1) Positional Parameter: Consider the following macro calls LDA XAL (&ID = A)
The parameter from macro processor returns to the preceding WHILE,
prototype and arguments from the macro call are INCR M MEMVAL =
A,
INCR_VAL =B LDA XBI (&ID =B) re-evaluates the Boolean expression, and
associated with each other REG = AREG & is the starting character of the macro instruction;
according to their
positions. A positional parameter is written as but the end of the parameter is not marked. So in the
takes action based on the new value,
ii) FALSE: The macro processor skips ahead in
Sparameter name>, For
where SAMPLE is the nameexample,
&SAMPLE, INCR M
MEM_VEL = A
INCR_VAL =
B,
REG =AREG case of &lDi, the macro processor could deduce the
meaning hat was intended.
DEFTAB until it finds the next ENDW statement
of a parameter. The and then resumes normal macro expansion.
value of positional formal parameter XYZ 15
a are now equivalent.
of is not
determined by the rule of
positional association as Dilference between P'ositional and
2) Generation Unique Labels: It to
use labels for the instructions in the macro definition,
possible 4) Keyword Macro Parameters: The types of macro
follows: Keyvord Parameters parameter are classified as:
i) Find the ordinal position of XYZ in the list of 1) In positional parameters here S one to one since every expansion ol macro would include the
i) Positional Parameter: Parameters and
comespondence between macro definition and macro call label repeatedly whieh is not allowed by the
fomal parameters n are associated according to their
the macro prototype The calling sequence should be same as assembler. This in tum forces us to use relative arguments
statement. defined sequence positions in the macro prototype and invocatiol.
2) In keyword parameters
addressing in the jump instructions. Instead we can If an argument is to be omited, a null argument
11) Find the actual parameter specification occupying sequence is not important and use the technique of generating unique labels for (two consecutive commas) should be used to
the ordinal number of parameters used while
same
position in the list of actual
are also not important
calling the macro every macro invocation and expansion. During macro maintain the proper order in macro invocation:
parameters in the macro call statement.
expansion cach S will be replaced with SXX, where For example, RDBUFF OE, BUFFER,
Example: consider the call XX is a two-character alphanumeric counter of the
Ques 13) Define the machine independent features of LENGTH, , 80
NCR A, B, AREG number of macro instructions expansion.
macro processor. It is not suitable if a macro has a large number of
In the following macro definition: Or 3) Conditional Macro Expansion: If the macro is parameters, and only a few of these are given
MACRO List the machine independent expanded depends upon some conditions in macro values in a typical invocation.
INCR
macro processor
features. Also discuss ditferent types
&MEM_VAL, &INCR_VAL of parameters definition (depending on the arguments supplied in i) Keyword Parameter: Each argument value 1s
® used in macro with example. the macro expansion) then it is called as conditional written with a keyword that names the
MOVIVER ®, &MEM_ VAL Or macro expansion. Macro def+nition is designed in
corresponding parameter. Arguments may appear
ADD ®, &INCR_VAL Explain the following: such a vay that it generates different instruction in any order. Null arguments no longer need to be
MOVEM ®, &MEM_ VAL 1) Conditional expansion
macro
sequences when different relations hold between the used.
MEND 2) Generation of unique labels actual parameters of a call. For example, GENER TYPE=DIRECT,
Or
CHANNEL=3
Following the rule of positional association, values of the Explain conditional macro expansion with an example. Macro-Time Variables It is easier to read and much lesS error-prone than
formal parameters are (2017 (05)) Macro-time variables (often called as SET Symbo)
the positional method.
Formal Parameter VluC Or can be used to store working values during the macro
Is it possible to include labels in the with symbol &
MEM VAL body of macro expansion. Any symbol that begins
Ques 14) Differentiate between a Macro and a
definition? Justify your answer. (2018[06) and not a macro instruction parameter is considered as
INCR VAL B Subroutine. (2019[03])
Or macro-time variable. All such variables are initialised
REG AREG Write Or
short note
parameters within a character string.
on
concatenation of macro to zero.
What is the difference between macro invocation and
2) Keyword Parameter: For keyword parameters,
(2018[04)) subroutine call? (2020[03))
Or If the value of this expression TRUE:
<parameter name> 1s an ordinary stnng and
Explain the different types of conditional )The macro processor continues to process lines
parameter kind> is the string= The <actual macro Ans: Difference between Macro and
Subroutine
expansion statements and their from the DEFTAB until it encounters the ELSE
parameter spec> is wntten as implementation Table 2 shows the difference between Macro and
Subroutine:
examples. (2018110) or ENDIF statement.
formal parameter name> = <ordinary
tring> Write
Or ) I f an ELSE is found, macro processor skips lines
Table2: Diference between Macro and Subroutine
notes on conditional macro in DEFTAB until the next ENDIF Procedure
expansion. (201910 3) Once it reaches ENDIF, it resumes expanding thhe
Macros m/c Corresponding
The value of the formal parameter XYZ is determined
Or
The corresponding The
Explain the following machine independent mac macro in the usual way. machine code is watten code is wnitten only once
by the rule of keyword association as follows: processor Ieatures: (2020[10) every lime a
maero is in memory
i) Find the actual parameter specification which has 1) Generation of unique labels.
the form XYZ= <ordinary stning>.
If the value of the
expression is FALSIE calledin a program.
2) Keyword macro ahead in DEFTAB
more Program lukes up
ii) Let <ordinary string> in the specification be the parameters ne macro processor skips
ELSE or ENDIF grn
takes up
comparatively less
next memory' space,
string ABC. Then the value of the formal Ans: Machine Independent Macro Processor Feature Cncounters
memory space.
The design of
macro processor doesn't statement
parameteris ABC.
architecture of
depend on
the machine. Some ne macro processor then
resumes normal macro No transter of programransterring of program
extended features " counter is required,
macro processor are; expansion, Lcounter
CW
( o d u l e 5)
C-78 B.Tech, Fifth
Semesterisoed
des(ystem Softwa ProcessIs
KTU ATo
Some of the data structures required DY a
ose Macro Processors: 1ne most 2) D
can
processo and he language ranslator
Ques 15) DIscuss the
as an aid to
eral-i
various design options for macro of macroprocessos
1S
processod and
Tuncuons
can
language progra mg Oren Such combined, Many utility subrouines
ASaCro Frocessors Design Options with, or closely related be used by both the language tránslarOr and n
nother. The D
1s sSrocessors are combined nning
pansion: There can be a condition that invocation A, taking care onOy
of one maCTtO
also
Deen avC
processor, These incude sucn op
EDCu or the necessary t e s t - n S he asscmbler. MncroprocSSOS onverting numennc
program1
A D h e definition of RDBUFF SO
1oop. It is convenient to use tnat uiC
eveloped
ngn-levei
for
sonme
input 1o internal representauon
POgrammer who i values irom extema
D g KDBUFF need not wory about the details of device access and contro. anguages
An
example is shown in figure 5.9: Processor W anguage TranslatorsS Disadvantages Macro Processor within Language
facro
macro procesSOD I g PP
0
DEFIAD
The and
TranslatoS. wntten to work
RDBUFF &BUFADR, &RECLTH, That is, they proc exDanded version of ney
must
De specially designed and or
RDBUFF NDE macro invo . TThis expanded program is then
with
a particujar implementation
of an assembler
compiler (not just with a particular prograng
CLEAR he sour assembler or compiler. In this case
RDCHAR A
o an
Ised as up
with the language).
CLEAR SS
macro processing runcuons are combinedmethod must
+LDI =Uo translator itsell. Ihe sSimplest 2) The costs o macro processor development
uage
line-by-line
SLOOP RDCHAR 25 chieving this
sort
or combinatlion
is a
approach,
niS the
therefore be addcdO
translator, which results in a more expensive preee o
sng
COMPR A macro processor Stalemens ana
JEQ SEAI orocessor
reads tn
SOurc PrOgrm t
SOLwa
21,A erforms all o translator as they are
JLT SLOOP ines are pass ime instead of being wrilen t DEVICEDRIVERS
SEXIT *MEND enerateu source file. Thus, the macro processor
Ques 17) What is device driver? Del+ne
the anatomy
rates as a sort of input routine for the assembier or of device driver,
RDCHAR MACRO &INN compiler. Or
TD=A What are the major design
JEQ -3
Ques 16) List the advantages and disadvantages of What is Device Driver?
a
Devce 2018105)
macro procesSor and macro prOcessor 155ues OL a
Diver
general purpose
translators,
wwith in language ot a device driver with the of
Explain the anatomy help
FigureS. Macro Processors diagrams. (2019[05))
Ans: Advantages General-Purpose
Ans;
SP=-1 AdvanB does not need to learn
2Call RDBUFF BUFFER, LENGTH, FL ntma
macro facility for each compiler or Ans: Device Driver
A device driver is a program routine that links a peripheral
embler language, so much of the time and expense
a 1t SS
S0)_ involved in training are eliminateca. device to an operaing system or compurer.
10-1+141+141 Macros expanded essentially a sottware program nat ows
CLEAR X The costs involved in
producing ageneral-purp5 employ a device, Suci Ise It is
as
(4) BUFFER CLEAR A cro processor are somewhat greater than those ror nrohend the detailed
LENGIH CLEAR S developing a language-specitic processor. owevc Wnte P . douice's command
(6)
language a d
HLDT #4096 nis expense does not need to be repeatea lor eacn
characteristics and contains the speciic machine language
language; the result 15 a substantal overal Savg " . necessary to perform the functions requested by the
software development cost a new hardware device is added to the
application. when
1TD=X Savings in soltware maintenance eftort should
also be
Computer, such aS a CD-ROM dnve, a printer, or a sound
to run it. The
Card, its driver must be installed in order
FI
Ieilzed,
Over a peri0d or years, tnese maintenanCe "calls" the daver, and the driver "dnves"
cOSts may be even more significant than the original operating system
= S
cost 1or software development, device
=4
Disadvantage General-Purpose Macro Processors The basic inputoutput (Uo) harUwae Teauressuc
P=S (SP)=1 One polential problem with general-purpose maCro ports, buses, and device c o o c
processors
involves the syntax used for macro deliniuon ariety ol 7
aud macro invocation statements, WIth most Specia daices the kernel of an
inique ic n to use device driver modules.
COMPR A, Ss acro
"
proccs5ors,
01D1 10 Satements im ne source programming device drivers present a unitoim deviceicees
STCH
15+1+1+1+1+l+l| BUFFER, age, intertace to the VO subsystem.
(4) BUFPER nlages Macro Processor within Langunge Each of the different types of /O devices is accessect
$IOP ntertace. The
(6)
LENGTH EXIT FrAnslators
avods he
through a Standardhzed
tangible dreronces are encapstutated m
set of tunctions-an
semel moctules
making an extra pas5 Over source
siom
Figure 5.10: Kecurp)VE MiacrO YpalisioD =l+]-2
1or the
LENGJH_ g (riling and hen rendDg ne CNpandcd (i.e., device drivers) that internally are customizcd tor each
FKample in Pigure 5,9 ource file), so it can be more efficlent than using n device, but that export and utilize one ot the standar
nacto preprocessor intertace
C-80
B.Tech. Fifth Semester 7P
Solved Series (System Software) Kn Processos
(Module 5) C-81
Design Issues of a Device Driver Ques 18) Define the various types of devic
Macro
To make the evice drivers between Character and Block Device Driver The task calls the device driver via a kernel device
design of device drivers easier, we have block
Also differentiate character and
divided the issues to be considered into three Or
device driver, iflerence
cter Device Drives Block Device Drivers call. The device entury routine gets blocked on
broad
categories (Design issues of a device
driver): Differentiate between characters and bloek
Chunnut and output Transters data in blocks, semaphore and blocks the task in that way. When an
rather than one byte at a time. input comes from the device, it generates an interrupt
rform
)
Operating system/Driver ata am
2)
3)
communications
Driver/Hardware Communications
Driver Operations
drives.
Or (2017,2020device
05
onecharictCr
Support singie nardware. Support
hardware unit.
more than one and the ISR releases the semaphore and the device
Entry routine returns the data to the task and the task
Distinguish between Character and Block D Do not have file-like
logical name assigned logical continues it execution.
The first
category covers all of the issues related to the Drivers. Device Have names.
exchange of infomation between the device
driver and
Or (2018(05) 1othem
1sually control
terminal or Usually control floppy-disk,
2) Asynchronous Device Driver: When a task calls an
asynchronous device driver it means that the task will
operating system. t also includes Differentiate between Character and Block fixed or magnetic tape daves._
the kermel
provides for the
support functions that Drivers. Device pranter
mples: sOund cards, EXamples:
USB cameras, only check if the device has some data that it can give
The second covers
benefits of the device diver.
those issues related to the
exchange or
Ans: Types of Device Drivers (2019[04) Example
nallel cards, serial ports hard disk. D+sk-on-key to the task (igure 5.13). In this Cxample the task is
just checking if there is a message in the queuc. The
the intormation
between the device driver and the device it Depending upon how data is fetched by the of a device driver.
controls. This also includes issues such as how device drivers can be dividcd into two categories levio Oues
Ques
19) Give the general design device drver can independenty of the task send data
talks to hardware and how software (2017 [05]) into queue.
the hardware talks 1) Character Device Drivers: Character device dnvers Or Device Driver
back. are intended for those ices, which have
The third covers issues a nscribe the general design of a device driver. (2020[051)
keyboard simple
related to the actual internal character basecl interface such Task Driver Entry
as the
operation of the driver itself. This S Or Calling Kermel KOutine
1) includes
Interpreting commands received
devices do not require any buffering as
they send a design and anatomy of. a device Read 0 Dev Read O ]
from the operating receive data in single Eyplain the general
System character chunks. Character driver with
the help of diagrams. (2019[05])
device drivers normally pertom VO
2) Scheduling multiple outstanding requests for in a byte stream.
of Device Drive
servce They can also prOvIde adaiional Ans: Design
Managing the transfer of data across both interfaces interfaces
present in block drivers, such as I/O control (iocnot t Is very good if you can
(operating system and hardware) When you design your system
commands, memory mapping, and the soltware 1nto two parts, one that is hardware
4) Accepting and processing hardware interrupts device polling. split up
Maintaining the integnty of the driver's and the
User Proces Kemel independent and one that is hardware dependent, to make Device
kenel's data structures. iteasier to replace one piece of the hardware without
Driver In the hardware
having to change the whole application. Figure 5.13: Asynchronous device driver
Anatomy of Device Drivers dependent part you should include:
Device driver take on a read/write 1) Initialisation routines for the hardware The task calls the device driver Via a kermel device
special role in Linux kernel. They sy stem call< ad/wnte system cal read/wnte
are "black
boxes that make a particular piece of hardware handler ntry poins 2) Device drivers
call. The device entry routine receives a message from
3) Interrupt drivers the queue and returns the data to the task. When new
respond to a well-defined internal
The driver translates between the programing
interface. data arrives from the device the ISR puts the data in a
hardware commands The device can then be called from the application using message and sends the message to the queue.
understand the 2) Block Device Drivers: Devices that
by device and the stylized
interface used by the kernel. User activities areprograming system are known as block devices.
support a file RTOS standard calls. The RTOS creates during its own
performed for these devices are known as
Drivers writen initalisation talbles that contain function pointers to all the Ques 20) Describe the working of device driver.
by means of a set of standardised calls that are block device drivers. device driver's routines. But as device dri vers are
independent of the specific operations that act on a real Block device drivers are intended
that have a data block based
for those devices initialized after the RTOS has been initialized you can in Ans: Working of Device Driver
hardware is then the role of the device driver.A interface such as the hard your driver use the functionality of the RTOS. When you
device disk. In order to When we get a peripheral device such as printer, scanner,
driver has three sides: improve speed and
devices transfer the whole data buffer eficiency, these
design your system, you also have to specify which type of keyboard or modem, the device comes together with a
1) One talks to the hardware and at one time device driver design you need. Should the device driver be
2) One talk to the user. User Process driver CD which needs to be installed before the device
Kermel interrupt driven, which is most common today, or should starts working.
3) While one side talks to the rest of the kernel.
Driver
the application be polling the device? It depends on the Application Application
Read/write system call device itself, but also on your deadlines in your system. Applications Programl Program 2
User
handler But you also need to specify if your device driver should
Suriegy
buffer management Called synchronously or asynchronously.
Kernel 1) Synchronous Device Driver: When a task calls
Device Diver synchronous device driver it means that the task will
buffer cache until the device has some data that it can give to the
headers Keme
task (igure 5.12). In this example the task is blocked
Hardware buffer cache data Sun Common SCSl Architecure (SCSA)
on a semaphore until the driver hat been able to read
Figure 5.11: Anatomy of Device Drivers any data from the deVICe.
Block device
Device Driver Host bus adapter Eost bus adapter
drivers take a file system
1om ol request, in te Task
driver driver2
A device driver performs the
following jobs: buf(9S)
a
stnucture, and issue the IO operalons Driver Entry
1) To accept request from the device
to the disk to
transfer the specified block. The
main Calling
Read
Kernel Routine
independent interface to the file is the HDevRend OJ}
software above to it
Block device
system
drivers can also provide a
strategy9E) roune Hanfivare Applitation
Togram
Ppncano0
Pogram
2) Interact with the device controller to take and give /Oo character dnv
interface that allows
and perform required error handling. utility programs to bypass he
5ystem and access the device directly. As soon we instull the driver software into the computer, it
3) Making sure that the request is executed
successfully This device scces detects and identifies the peripheral device and we become
s commonly referred to as
device. For
the
interface to a blo
raw ISIR Device able to control the device with the computer A device
example, disks
as block devices
are
commonly implemenic ---
driver is a piece of sottware that allows your computer's
Tigure 5,12: Synchronous device drlver
B.Tcn. as Ques
sociateath the
tasks
C-82 main
1our
Index
Blemen
operating system to communicate with a bardware device
out
D o c u m e n t
List
the
E d i t i n g P r o c e s s .
Q018|021 5 Ans: Salient Aspects of Text Editor
A text cditor has to cover the following
main aspects
the driver is written for. Generally a driver communi progy related to document creation, storage and revision
Ans: Editing a
computer
1sise a target
ogramtha
with the device through the
computer bus which is us allowsa An important
editor
c o mdocumen Interactive User Interface:
interactive
putercnt 1)
connect the device with the computer. Device dnve
works within the kemel layr of the operating sys
Kernel is the part of the operating system that dirteu
An
user
to
i n c l u d e s
c r e a t e
objects
and
suCh
diagramis,
as
ine art,
uter
diagrams
Doeumen
photogra Dh
Figure 5.14(a)
consideration of a document is its layout
to a human
reader. For this it is essential to present a documentin
(terminal)
cquations
tables,
strings
strings are n e
are
pimary ele a rectangular form, on the monitor screen
interacts with the physical structure of the system.
of accessing a device directly, an operating system lods
Inste text
editors,
charicter
ments of Index Element or via a printer (as an output of
be
the interacive
process). Further since a document can potentially
t h e t a r g e t text.
the device drivers and calls the specific
diver software in order to execute specific tasks on tne
functions in a
in
Document-Editing
Proo 05 very large and since in a computer
terminal can
a time,
display only a limited size of a document at
Involved interactiv
codes Steps in a n ve user-computer
device. Each driver contains the device specific process
hence it IS necessáry for a text editor to display only
Document-editing a
required to cary out the actions on the evice tasks
ter
Consider an example of a printer, when it is connected
to
dialogue
)
has four
Select the part
of the target iocument
documen
tO De
Viewed Figure 5.14(6)
portion (page). of a large document that cannot
displayed in entirety at once.
be
and manipulate
view c
the computer and the specific device driver is installed.
device object is created on the computer which is designed 2)
Determine
how to
fomat this
on-line and how to Graphica
Editors: Graphical edítors are GUI
The process of creating and revising a document in a
tne display it. Graphical User Interace) based editors. These are For interactive editing a
to control the device. This device object represents execute
operaions hat modis.
that
modiy the
ch user-friendly.
The Window-based editors are computer is called editing.
pinter and its physical structure modes hat
allow your
3) Specify
and
target for the graphical editors. Notepad is an
text editor displays a document on the terminal and
computers operating system to control its functions.
document. hest example graphical edito
accepts various types of input from the user through
view appropriately. for a
4) Update the example different types of input devices, viZ., keyboard,
P to pint a
When we choose an operation (like Control + text editor. Also def+ne the various mouse, data-tablet (flat, rectangular,
document) on the printer then this command goes
to tne above task invoíves:
Oues 23) Define electromagnetically sensitive panel over which a ball-
The 3
dog
Selection ot the part of the cument to be
editors.
text
device dnver through the kemel of the operating System. of
1) Travelling: edited. It ypes
point-pen-like stylus is moved and the coordinates of
Resultantdly a calling program invokes a routine in the
viewed and involves first travellino Ans: Text E d i t o r s
the stylus is sent to the system). Initially the text
the document to locale tne area of nterest such as tool that allows a user to create and revise
device diver and the diver issues coresponding
next t editor is a
editor may display the starting portion of the
and Tind pattern this task can be carried out
commands to the microcontroliers within the printer.
screenful, "bOtom .
ncuments in a computer. 1hough document. During editing the user may give inputs to
of text editor commonly refers to the
Further these microcontrollers control the components 2) Filtering: The selection of what is to be viewed and modes, the word
the printer like motors etc. to start printing the document does this interactively.
A popular text editor in bring other portions to the display. Besides the
manipulated is controlled by Tillering. Filtering ev lthat displayed page, there is the notion of a point within
or mainirame computers is called XEDIT. In
the relevant subset of the target document at the point of BM's large the page, indicatd by an casily distinguishable
Ques 21) What is a Device Driver Entry Point? the two most commonly used text editors are
next scTeenrul of text or next INIX Systems, called the cursor, where the next insertion.
interest. such as statement and v. n Personal COmputer systems, word symbol
deletion or modification will be effective.
Ans: Device Entry Point
Driverfunction within a device dnver that can 3) Formatting: Formatting
determines how
then Emacs
nrocessors
are more common than text editors. However,
An
entry point is a result of filiering will visible representat
be seen as a of mainframe and UNDX text editors that
be called by an extennal enuty to get access to some dr+ver
(the view) on a display screen or other device. there are variations example is
Many text editors allow pictures and other non-text
for use on personal computers. An
functionality or to operate a device. Each device driver are provided
XEDIT for Windows.
information to be included in a document. Such
provides a standard set of functions as entrT points.In 4) Editing: In the actual editing phase, the arget document KEDIT, which is basically editors provide mechanisms to either create/modify
illumos kernel uses entry points for these general task is created or altered with a set of operations SUch as Such information or embed such objects ins+de the
of Text Editors
areas insert, delete, replace, move or copy. Manuscpt Types creation lines of text are
Line Editors: During original document. The output of an editing process, 1.e., the
1) Loading and unloading the driver oriented editors operate on elements such as single 1)
2) Autoconfiguring the device - Autoconfiguration is the recognised and delimited byend-of-line markers, and document, can be either saved as file(s) in the
characters, words, lines, sentences, and paragraphs line must be explicitly
the secondary storage or sent to some destination in the
process of loading a device dniver's code and static Program-oriented editors operate on elements such as
during subsequent revISion,
data into memory so that the driver is registered with specified by line number or by some pattern context. For network, such as a printer or some remote host.
1dentifiers, key words and statements. editor in early MS-DOS systems.
the system. example, edlin 2) Appropriate Format for Storing the Document in
3) Providing I/O services for the driver The idea here is similar to line
Editing phase involves 2) Stream Editors: File in Secondary Storage: The most natural way to
stream
editor, but the entire text is treated as Single
a
document is planar layout of the
Drivers for different types of devices have different sets of
a Insert b. Delete visualise a as a
of characters. Hence the location for revision cannot information, within some bounded space. Thus, one
C. Replace d. Move
entry points according to the kinds of operations the
Cut be specifiedusing line numbers. Locations for possible format to save (store) the document in
devices perform. A driver for a memory-mapped e Copy revision are either specified by explicit positioning or
secondary storage is to save the attributes of each
character-oriented device, while a block driver does not Paste, etc. context. Forexample, sed in visible point (pixel) by traversing the layout in some
support this entry. by using pattern
Unix/Linux. Line editors and stream editors are order, say, left-to-right lines trom top to bottom.
Types of Editors
The editors may be classified into two types as given suitable for text-only documents, However, this is not the done for obvious reasons. For
TEXT EDITORS below: 3) Screen Editors: These allow the document to be textual information, there are widely used eode-sets
) Text Editors: A text editor is a program, which viewed and operated upon as a two dimensional (C.g, ASCIl, EBCDIC, ISCI, Unicode, ete.) that are
plane, of which a portion may be displayed at a time Lused to encode the information. These code sets also
Ques 22) What is the
various types of editors.
meaning of editing? Def+ne allows the user to create the source progranm in the
contain codes for white spaces and new-line, and
form of text into the main memory.
Generally theuser Any portion may be specified for display and location
Or prepares HLL program or any sOurce program. 1he for revision can be specified anywhere within the hence most textual intormation can be conveniently
What is editing? List the steps involved in document- emacs, etc, represented preserving the desired layout. Many
text
Creation, cditing modification, deletíon, updating o displayed portion, For example, vi,
editing process in an interactive user-computer document or files can be done with the help of the text 4) Word Processors; Provides additional features to editors allow the appearance (script, size, colour and
dialogue. editor. The scope of the editing is limíted to the text basic screen editors, Usually support non-textual style) of text to be specified by the user, From the
only POint of yiew of storing such variations of appearance
C-85
Semester TP Solved Series (System (Module 5)
C-84 B.Tech. Fifth Software) KTu SMacro
Procesors
wn. pattem search, etc.), in which case the Thus some kind of combination of array and linked list
of text. this is usSually achieved key. Text devices wilh
arow
(cursor) -down,
by stoning cxtri Simulate locator devices, v nbe p potiOns must be performed tor that portion. Thus may have to be used. For cxample, the entries of an array
used to
information descnibing the appearancc along wth p oI the size of the buffers for each Jine of the
actual tex Thus in secondary storage, the iie
the devices, which transliate spoken worde o r Drogram should keep track may pont to individual
document The buffer for a line may either be array or
textual cquivalents, may prove to be the ters window, and
the bOundaries of the current
to a document contains the textual
coTesponding
informaton as well attributes of the
devices of the future. Voice recognizers are currep
d e d portion in tems of offsets Irom some fixcd point
first
Iinked lists (with, say, a word in each node). For very
( s u c n as line number of the idea to hold the
as
text, available for command input onsome systems document Targe documents it may not be a good
sometimes called metadata that controls the the
structure for entire document in such buffers since only a small portion
displayed lines, elc.). The chojce of datasince
in
of the text in output medium. if n) Button or ChoIce Devices: These genera
appearance Similarly, image (Duiers) 15 important, it has to is displayed at a time and editing operations for a
the document has to contain non-textual information, interrupt or set a system 1ag, usually he memory
invocation of an associalcd application-nr
insertion
efficient and deletion, while allowing the reasonable duration are likely to be in the neighbourhood
that too iS embeddecd using suitable metadata. support
of the document
Irom small to
to very Jarge.
vary of the displayed portion.
action. Such devices typically include a set of e
3) Eicient Transfer of Information between the User
special function keys on an alpha
anumeric each row
containing
nple 2-dimensional array with
a
Interface and the File in Secondary Storage: Theto keyboard or on the display itself. 4 simple
In such situations, a text editor may load only the required
ine of text,
may not sujt
1or
obvious reasons (what are the portion of the document into memory buffers, but be able
uscr interface of a text cditor has to give emphasis
ons?). A linked Jist may 1acilitate easy insertion and
the visual appearance of the portion of the document im) Locator Devices: These are two-dimentine
a single node in the
toload any other portion as and when required. Ittoo
needs
it
to
deletion. but having
Cach
leter in be remembered that in the memory image is
that 1s
any time, and convenience of
displayed at the analog-to-digital converters that position a cu memory. Also, user
user to perform editing operations and viewing the symbol on the screen by observing the user finked list may
be wastetul
oI essential to represent thc metadata corresponding to. the
document On the other hand the format in which the movement of the device, 1he most common s conmands sSuch as page-up, pag-doWn, etc., may become different portions of the document.
document is stored in the secondary storage basically devices for editing applications arC the mouse and inefficient.
an unambiguous, static, and non-vi1sual the data tablet. Locator devices usually
provides the structure of typical editor wíth the help of diagram.
model of the document. Thus the text editor has to incorporate one or more butons that can b Used Oues 27) Explain
Or
convert the user input into the file fomat, and file to specify cditing operations.
into the format. This conversion is one the structure of a text editor with the help of a diagram. (2017 [05))
fomat display
of the basic requiretnents for the 1ext editor design. 2) Output Devices: Formerly limited in ringe, output
Explain Or
devices for editing are becoming more diverse. The
Draw the structure
of a Typícal Text Editor and describe the functions of each block. (2018[08)
output device lets the user vicw the clements being Or
Ques 25) Discuss about the criteria for the user
interface design.
edited and the results of the editing operatioh. The fint With the help ofa diagram describe the structure of a text editor. (2021(10))
Or output devices were teletypewnters and othercharacter Or
printing terminals that generatcd output on paper. Explain the structure of text editor wíth the help of diagram. (2019[06)
Write notes on the user interface of a text editor.
(2017 [05)) 3) Interaction Language: The interaction languageofa Ans: Structure of Text Edítor
Or texteditor is generally one of several common types Most text editors have a structure similar to that shown in figure 5,16, regardless of the particular features they offer and
Describe the user interfaces used in a text
editor.
(2019|05))
The user communicates with the
editor by typingtext the computers on which they are implemented
strings both for command names and for operands
Ans: User Interface These strings sent to the Editüing Editing
Conceptual model of the editing system provides an casily
are
editor and are usually Component Buffer
echoed to the output device. Typed specification often
understood abstraction of the target document and its Tequires the user to remember the exact form ofall
clements. For example, Line editors simulatcd the commands, least their abbreviations If the
or at
Editing
sworld of the key punch - 0 characters, single line or an Filter
Command language 1s complex, the user must
integral number of lines, Screen editors Document is continually refer to a manual or an on line help
represcnted as a quarier-plane of text lines, unbounded
function for a description of less frequently used Main
both down and to the nght. Traveling
Commands. In addition, the Memory
typing reqUired can D Compone
time consuming, especially for
The user interface (U) is concerned with, the input inexperienced users
The function-key interface addresses these
devices, the output devices and. the interaction language Vicwing
deficiencies. Here each command has assocated wiln InputCommand
The input devices are used to enter text elements of being marked
Filter
it a the user's
key on keyboard, Languager
cdited, to enter commands. The output devices, lets the Processor
user view the ciements being edited and the results of the
editing operations and, the interaction language provides
Ques 26) Discuss the desígn of an Edítor, Viewing Viewing
Component Bufer
communication with the editor. A user interface plays
Ans: Design of an ditor
important role in simplifying the interaction of a user with
The structure of a text editor depends largely onthe yp Paging
an application. UI functionalities have two important routines
of
aspects. User interface is concerned with the input devices, editing features and displaying capabilitiesthatare1o Ouiput Devices Display File
the output devices, and the interaction languape of the Supported. To implement the displaying capabilite, Componcne
semantucs of the metadata that may be presen System
system, which are 2s follows:
document nle necds to be implernented as display Control
1) Input Devices: These are uscd to enier elements of
For Dala
the text being edited, to euter comnands, and to example, if the netadata
implies a particu Figure 5,16; Editor Structure
De Used for a
designate cditable elements. These devices, as used segment of text, editor shou
nethods affect that
to
colour ne
with editons, cun be divided into there categories, for the particU major components of
tert Siice at
time only a finite
a
gd docun editors are 2) Editing Component: In a the start
editing doeument.
which are as folows portion o 0and Langunge Processor: The command of the area to be edited is determined by the current
such actíons are to betaken for a portin
ofthe layed,
i)Text or String Devices: These are typically uige processor accepts input from the user's nput editing pointer maintained by the cditing component
information the file.
ypewriter-ike keytrds on wfuch a uer prees
pecly sote other
However,
in
age CeS, and unalyzes the 1okens and syntactic which is the collection of modules dealing with
and releases keys, sending a unigue c e for cachi portion
displayed (hrouy
to be structure of the commands, editing tasks.
C-86 B.Toch. Fifth Semester 7P Sofved Series (ystem Sotware) (Module 5) CR7
Phxeswrs
MAn
3) afes on the debuggmg inctions and capabilities
Travelling Component: The travelling component ot 2) Printing to log files writes of database. In some debugger systems, it wil
the editor actualy
perfomms the setting of the curent 5) Spnnkling the code with assertions
interactive
debugging ystenm (2017 [051)) be enough simply to cnsure that a read qucry never
editing and viewing pointers, and thus determines the fan Or
4 UsinS post-mortem dumps nd ittempts to read data which is not yet available in
point at which the viewing and/or 5) Having programs that provzde function call stacks the functions capabilities of an in others, it may be necessary to ensure that
begins.
editing filtening
Feminaton
0n
ihe
Debugging System. (2018[06)
database;
what is read is the last complete write done by
Interactiyd
4)
Viewing Component: 6) Profiling debugger client. Onc method of coordinating reads
start of the area to
In viewing a document. the
7) Heap checking Debugging Funetions and Debugging Capabilities and writes is to treat each read and write as a
be viewed is determined by the
tools
ATS:
ints highlight the debugging unctions and
curent viewing pOinter. Th1s S) System call tracing transaction and to use standard dátabase transaction
pointerIs maintained by 9) Interacive source-level debugging
the viewing component of the editor.
which Is a
nubilhues provide functions such as processing techniques where consistency
10) Reverse erecution etc. Debugging system should
collection of modules responsible for determining the tracing and traceback. requirements are less stringent, the overhead of
next view. to track the flow of execution transaction processing can be avoided and sufficient
The basic principles of debugger are: Tricing can bemodifications.
used It can also coordination of reads and writes may be achieved by
5) Display Component: be based on
This produces a
display the
by ) Heisenberg Principle: This pnnciple says that the logic and data ordering the writes such that informatron which a
mapping the buffer to a rectangular subset of conditional expressions.
debugger must intrude on the debuggee in a minimal
Sereen. usualy called a window. Traceback can shoW the path by which the current given record in the data base depends on is written to
way the
6) Editing and iewing Buffers: The editing and
statement was reachned. can also show which database before therecord itself is written, thereby
viewing buffers. while independent, can be related in
2) Truthful Debugging: 1he
so the programmer always trusts it
debugger must be truthful statements have modified a given vamable or parameter. ensuringthat all the information needed to respond to
a query for which the given record is a result is in the
many ways. In the simpiest case, they are 1dentical - Debugging system have a good program display database the time the record itself can be
capabilities. It must be possible to display the program by quenied
the user edits the material
directiy on the screen. On
3) Providing Context Information: The debugger
the other hand. thec editing and should provide the program context heing debugged, complete with statement nunmbers. 2) Debugger Client: Debugger client is a debugger
viewing buffers may information The system should saveall the debugging specifications is cxecuting
be completely disjoint
duringSource
debugging. Program context information are across such a recompilation, so the user does not need to
which a program being debugged in
debugger process. For purposes of the present
i) code. m) Stack back-track, ) Variable
7) Viewing and Editing Filter: This component tilters discussion, a debugger client may be any entity which
values, iv) Thread infomation reissue all ofthese debugging commands,
the document to generate a new vicwing buffer based
Debugging system must be sensitive to the specific executes a computer program in such a fashion that
on the current Viewing pointer as well as on the
viewing tlter parameters. his viewing bufferis then
Ques 30) Discuss the basic operations supported by a
language being debugged so that procedural,
anthmetic and conditional logic can be coded in the
information about the execution which would not
normally be available to a user of the program
passed to the display componcent of the editor. debugger.
Ans: Basic Operat.ons Supported
syntax of that language.
becomes available. Thus, debugger client may be
A debugger
by a Debugger The debugger should be able to switch its context implemented expressly for system or it may be any
provides an nteractive interface to the kind of existing interactive debugger. Debugger client
DEBUGGERS programmer 1o control the execution of the program and
observe the proceedings. The program
when program wrntten in one language calls a
a
program written in a different language. may have access to both the source code and object
Ques 28) What do you mean by debugging? Explain. be debugged is provided as an input to
(executable file) to A debugging system must be able to deal with
code for program. Debugger client may interpret source
basic operations supported
the debugger. The optimised code. Application code used in production code, but more generally, it will execute object code
Ans: Debugging by a debugger are:
Debugging means iocating (and then removing) bugs 1)Breakpoints: Setting breakpoints at various positions in
environments is usually optimised.
and use
source code to make debug info more
understandable to the user of the debugger
the
fauilts in programs). in the entire process of program program. The breakpoints are points in the program
at which the programmer wishes to
Ques 32) What are the different components of a Debug information obtained from source code and by
development errors may occur at vanous stages and efiorts suspend normal debugging system? Explain. means of execution of object code is wnitten to debug
execution of the program and perform
to detect and remove them may also be made at various other tasks. database by means of update queries to debug database
2
stages. However. the word debugging is usually in context
of errons that manidest while running the program dunng
Examining Values of Different Memory Locations:
When the
Ans: Components of Debugging System
Server In
some embodiments there may be more than
execution of a program is suspended, the he major components of debugging system are: one debugger client; for example, a progrummer may
or during actual use. The
testing most common steps taken contents
of specified memory locations can be
Cxamined. This includes local
Debugging Database System: Debugging database want to watch the behavior of two closely-cooperating
n debuggng arc to cxumine the of control during
fiow variables (usually on
the stack), function parameters,
system contains a database with persistent debugging programs, or there may be debugger chents specializedd
exccution of the program. examine values of vaniables at and global (extem) mormation (a... n) for a variety of executions of Tor different progrumming languages or tor ditlerent
different points in the program. cxamine the values of vaniables. programs, The term persistent is used here in to mean
parametes passed to functions and values retumed by the programming problems
3) Examining the Contents of the program Stack: Ine hat the debugging information remains available in
functions, examine the function call sequence, etc. To 3) User Interface Client: Each user interface client
overcome several such drawbacks of debugging by
COnients the program stack reveals informaton
he database after execution of the program has receives inputs from a user, responds to some inputs
related to the function call sequence that is active a ceased. Database is managed by debug database
nserting extra statements in the program. there is various
that moment by making a read query (Rquery) for debug data buse
erver, which responds to from the other
queries
kind of tool calied debugger that heips in debugging ponents of debugging system by wriling to or server, and responds to the resuls of Rquery by
programs by giving the programmer some control over the Depositing Values in Different
Memory LOcatios formatting the results and providhng the formatted
execution of the program and some means of examining Whiie the Cxecution of the debugged program 1s cading from debug information as required by the results to the user as formattecd output The foms o
and modifying different program variabies during runtine underway (yet to start or suspended at a breakpoint. ucry, Conceptually, debug data base server has two
cls of clients: the inpuls received and the outputs provided by a
E
programmer can deposit any value in the memop given intertace client depends on the kind of
Debugger client which provides update
Ques 29) Discuss Interactive Debugging System Ocauons coTesponding to the program variahies queries interactive intertace enployed by the user. Again, the
paramelersto subroutines, and
processor rogstetn otaining debug information todatabuse, nd interactive intertace may be any presently existing or
Ans:Interactive Debugging Systems interface clients which
Debugging is a methodical process of finding ad reducing e more
or
user future interactive intertace. Debugger cliçnt and the
ues 31) Describe the important functions and provide gueries that read selected debug user intertace clients turther communicale with euch
the aumber of debugs, or defects in a computer program. capabilities of an interactive debugging system.
An interactive debuEging systcm pruvides programmers nformation from database, other by means of control channel, which may be any
Or arrangement which pemuts ranster of nessages
with faciliues that aid an the esting und debugging of Eaplain the data base system may b0 Speciay
programs The approaches to debuggng ae
debugging functions and debua ciented for system or it may be one of the many
between debugger client and a user iniecface client
1) Prn stalemcns
capabilities User intertace client uses control chaRnel o tansler
Or cCal database systems. One ofthe functions of debugger cOmmands to debugtges wh
C-88
B.Tech, Fifth Semester IP Solvea Seriess (System S 5)
(System Software) Proces
(Module
C-89
debugger client
KTu Macro
shown in the following table. The "What" boxes
uses control channel to transter 3) Backtracking here), one attempt to eliminate all but one of the
debugger event
messages to user interface cient. For Or list the general synproms, the "Where" boxes
example, a first debugger command may instruct the possible causes, If all are climinated, additional data
List and explain the difterent debugging technion describe where tne 5ymptomsS were observed, thee
debugger conceming the kinds of information it 1s to Vhen" boxes list anything that is known about are needed (cg, by devising additional test cases) to
output, while another may instruct the
stop execution of
debugger to
Ans: Methods/Techniques Used for Debuggino
2019(05) the times that the symptoms occur, and the "To
.What Extent boxes describes the scope and