by

1S E−T R−82−26
i筑波大学
07s
1982, 1,1 3
蠣.
8竃
電子回報工学系
−h2{7Elill l ur’一.
/二==■
SOFTWARE−FAULT DETECTOR FOR MICROPROCESSORS
by
Kozo ltano
Tetsuo lda
January 15, 1982
S。ftwa・e・一fauしt D・te・t。・f。・Mi,,。P,。cess。rs
by
*
K.Ztano
*
*半
and T・工da
Znsrit. ute of lnformation.Sciences end Etectronics.
University of Tsukuba.
Sak・・a−mu・a・Niih・・i−9・・.エb・raki 3。5, J。p。。.
**
エnstit・t・。f Phy・icaL and ChemicaしR。、ea,ch.
Hirosawa. Wako−shi. Saitama 351. Japan.
This paper Ss a revised version of the paper presented at ACM−
S:GSMALL Symposium on Smatt Systems on.October 13−IS. 298a.
・key wbrds:s。ftwa「e ・et’・bうtity・・un−t Dime h・・dW・・e supP・・t’
key一し。・k mem・・y p・。tecti。・. inc・eme.t、しP,。t6、ti。n
む
c。de’…ay b。und・heck・・’・P・。9・am m。d・し。 p,。t。,ti。』。.
一1一
Abstract:
For the reaしization of the means ・to deveしop more reしiabしe
software for microcomputers especiaししy in reaし time
environments, we design a hardware tooし caししed ”software・一fauしt
detector” which detects software fauしts such as mうsaccess to an
eしement beyond the range of an array. The impしementation of
the mechanism for such address range checks is generaししy
difficuしt in mうcroprocessor environment,・ since internaし
registers are n。t readiLy vi・.ibしe t。 e×ternaL L。gics・We
introduce an ”incrementaし” key一しock Protection scheme into
fixed microcomputer architecture 工NTEL 8080 because of its
popuし孕rity and simpしicity・ 工n this scheme, a ”しocktt is a
protec. tion. code associated with the storag6 ceしし, and a ttkeン”
is associated with access capabiしity such as address● 工n each
memory access to a ceしし a check is made whether a key matched
against the ・しock of the addressed ceしし・ 工n this paper, we
の
present the detaiしs of the scheme and its anaしysis● Further,
we present an actuaし hardware design of the software fauしt
detector. Our design methodoしogy is to reaしize a detectgr by
the use of identicaし microprocessor 8080s, as an independent
one−board moduしe which can be connected to the memory bus of
the host system.
一2一
ユ● Motうvation
Recent LS; technotogy has improyed the hardware cost
perfgrmance’ @of D microcomputers. Zncreased execution speed and
memory size of current inicrocomputers invite many sofistieated
apptications. As a resutt ’w’e are often faced viith the
situati。ns w’h・・.e we h・v・t。deveし。pf・irしyし・・geand・。mpしex
software on sうte (in a possibしy short period of time)● 工t うs
urged to provide adequate hardware tooLs to support on site
・software devetopment and moreever to imptement retiabte
SOf eWar 〟Diespeci.at}y in some apptications where mi.croprocessors
are us’ [email protected].
We examined the means to .make microprocessor softwaie more
reしiabしe and in this paper present a. practicaし soしution to one
Qf the es’ [email protected]opments. We
observe th.at common, software fautts [3r4] are caused by
e.rroneb.us. accesses su’ch as 1) misuse of undefined variabLes. 2)
mis.access to an’ etement beyond the range of an array and 3)
errqneQus D ju.mps. The theme of our paper is ’to prevent these
kind$ of a.ccess viotation errors.
Range check of arrays may be perfprmed by the use of softbeare
[2] . but it may be impractica’t or even impossibLe to keep such
check codes in production programs such as bf reat time process
controし・
一3一
Th。 imptement・ti。・。f the mechani・m f。・add・ess range ch・・k i・
difficuしt in microprocessor environment, since internaし
,egi。t。・s a・e n。t・eadiしy vi・ibし・t。 e×t・rnaL L。gics・Page。「
segmentwi・e mem。・y p・。tecti。n mech・ni・m Perf。・med in c。・」unc働
tio.n with addr・ess. transしation which・. is empしoyed in しarge
、。mp。t。,s(・・d・し・。・。me・ec.ent 16 bit mi・・。・。mp・t・・s with
し。,ge add,es$. space)i・incap・bし・。f p・。tecti・g use・一d・fined
data s’tructures. such as’arrays, stacks and procedures, because
these data structures.しarge。r smaしし・are n。t necessariしy
aししocated fうxed page 『1ze●
W。i.。t,。duce an’・increment・し”key。し。ck p・。tecti。・scheme i・t。 a
micr。P,。cess。, architect・・e. A・。・・desig・t・・g・t we seしec’ 煤Ed
INTEL 8。80 micr。P・。cess。・because。f it・p。P・し・・ity S・
i,d、.st・i弓し・PPLicati。ns.0・・P・i ncip・しd・・ign meth。d。し・gy is
(1)t。・.・’
≠オi・ead・tect。・usi・g .a mi・・。P・。cess。・id・nticaし
to tりe host processo「,
(2) to reaしize a detector as an independent one−board
moduLe which couしd be connected to the memory bus of
the host micropocessor system’ and
(3) to reaしize a detector by whic_h software o、f the
host system is as しittしe affected as possibしe・
2●Key一しock, protection scheme
2●ユ Basic concept of key一しock 、protectlon
一一 4一
A”し。・k” isap・。tegti。・ρ。deass。・i a’t・dwiththest。・ageceしし
and a ’ttkeytt うs associated with access capabiしうty, i●e. address●
The concept of key−tock to protect memory btocks introduced to
しarge computer syst.ems is extended to the storag6 ceしし しeveし
concept, i・eo to specific data ceししs su’ch as constants,
variabLes. arrays. and strings.
FSrst. for simpLicity. assume that every consecutive storage
have unique protectうon codes on the whoしe storage● 工n making
access to such storage ceしし whose address is na”, the CPU
shoutd present the key together with the memory address ”a”.
工f the key matches with the しock, we know the ac.cess is
correct.
エ。。,d。, t。 P,esent such。k。y in each mem。,y access〆CPU
『houしd obtaうn the key associated w†th the contents of the
storage, if the content うs an address. To reaしize the scheme
we need a speciaし memory structure in which each storage ceしし
contains two fieしds; うnformation fうeしd, しock fieしd● The
L
informatうon fieしd is subdivうded うnto data fieしd and key fieしds.
The key fietd is si・gnificant onLy when address is stored in the
data fietd.
Since aし。・ki・.s・t・tth・timewh・・thest。’・ageisaしし。cat・d・
tii)e toek fiet’
[email protected]
[email protected]c.ator. On the
other hand. since the ”key” is associated with the address. the
key うs しoaded into the CPU register and is stored into the
−s一・
storage together with.addre Dss.
2.2 Uniform protection code
First we consider assigning the same protection code to the
しocks of every ceししs beしonging to the singしe consecutive area●
Hence. different areas have unique diff’erent protection codes.
A generaし prうncipしe’of storage access operation is (cf● Figure
ユ(1)):
(1) CPU has the’ head address ”a” together with key ”k”
to the area A as (a. k).
(2) and the CPU caしcuしates reaし address (a+i, k) by
indexing ttittt
(3) then. CPU makes access to the ceLL(a+i) and
simuしtaneousしy checks whether k equaしs to ’the
protection code of the ceLL(a+i).
When there are N different areas, we needしog N bit$of protec−
tion codes to distinguish the areas uniqueしy. 工f there is not
sufficient memory bits for the protection codes, compしete
protecti◎n cannot be done・ However, the probabiしity of
detecting erroneous access is shown to’be very high even with
しimited number of bits.
With k bits in handting.N areast the probabiLities of er Dror
d。t,6ti。。qi、gi》enbyth。f。U。wi。gf。,muし、[ユ]=
一6一
ユ
1一 一一一
k
2
k
where N 〉 2
q=一一一一一一一一蝋’一一・一一り●
ユ
ユー一一一
N
k
vi’here N $ 2 .
and q’= 1
Probabiしうties of typうcaし cases are given うn tabしe 1●
2e3
工ncrementaし protection code
Aしthough the uniform protection code うs very simpしe to
うm. Pしement. construction of the hardware based on the unうfoトm
protection code is difficuしt on microprocesso‘r. To be
concrete. to attach. auxitiary processors which operate
independentty from the host CPU under ’different program
c。nt「。し’but yet check. the detai L D ed behavう。「(in p・・ticuし・・
memory accesses) of the host CPU is difficuしt to reaしize,
becpuse internat togic anyd states of t.he .host CPU is net
visibte to externat worLd. Hence. we deveLop a more suStabLe
sch6me for the detector which is impt.emented by microprocessors
identicaL t.o the host processor as described Later. We
transformed the scheme into a c’ 盾高垂≠狽奄bke one using
”incrementat” protection codes.
Zn handLing M cetLs of area A whose head addr.ess is. ”a”. we
assうgn protection codes to the しocks of each ceししs asi
一7一
しock of .ceしし(a十」) = k 十 j,
for OSj f一{g M−1.
where k is a base protection code for area A.
The term ”incrementaし” is named after the property that the
incrementaししy increased protection codes are assigned to the
・。ntig・。s cetL・i・t卜is way・ The essentiaしfeatu「e。f the
incrementat protection eodes is that the increment of the key
is the same as the increment of the address. and we can perform
the equivaしent checks to the one by the uniform protection
codes. A generaL principLe of’ storagg access operations are
(cf. Figure i(2)):
(1) CPU has the head address ”a” together with
head key ”k” to area A as: (a. k).
「(2)and CPU caしcuし、tes th。,e。し、dd,ess and th。,eaしk。y
by index ”i” as (a+i. (k+i moduto K)).
where K is definedしater,
(3) then makes access to the ceLL(a+i). and checks
whether (k+i moduto K) equaLs to the protection
code of the ceしし(a+i)●
W。。。,t。 th。t l。 the case。f th。 increment・しpr。tecti。・’・。d・・we
cannot distinguish areas simpしy by assigning different vaしues
to the base protection codes to each area・ For exampしe’ the
[email protected](1) capnot be.disting
・naLy・e the Dc。nd賛’ons f。「detegt’。n m。「e cしoseしy・
一8一
Dui,shed.
@We
On any two different areas A and B, ”a” and ”b” are the head
・dd・esses。f・t・・s A and B.and”L”and”L”。,etheb』se
a b
P・・t・6ti・n−des・ssigned t・th・head・9’Lt・ ・f・・ea.・ A・・d B・
When N diffrent areas:
A , A , ●●・・, A
O・1 . N』■1
e×i・t。・th・・t。・ag・i・thr same time・the c。nditi。・。f…。・
detection is given as: ’
L ≠ (L + (a 一. a ) moduし。 K),
り
1 、 , 1 コ
wh「ere a うs the physicaし head address of the area A ,
う ’ i
and L うs the protectうon code assigned to the head
i
cetL。fthea,1、A.
i
The suffi・ient…d’ 奄狽堰E・f・・th 秩cpし・t・d・tect一・K≧N・
Aしthough a うs fうxed when the area is aししocated, we can
う.
dete”m’neし 堰i0≦’≦N“’1)systemat’catしy as f。tL。Ws:
一9一
(1)肖,st.、h。。seL p,。P。,しy.
o
(2) Compute L as:
i
L = ((a − a ) + L + m) moduし。 K,
i i i−1 i一一1
where ユ≦i≦N ・■・ユ and m is reしativeしy prime to K●
Most simpLe ”m” is 1. and we may rewrite L as:
i
L = ((a + i) + (L − a )) moduし◎ K.
i i o o
This reしation gうves a simpしe systematic method generating base
protection codes for unique identification of aしし areas as
shown in Figure 2(2).
B。th the inc,ementaしpr。tecti。n c ’ B de and the unif。,m p,。t。Cti。.
code require the same size of code fieしds to uniqueしy identうfy
the areasL Therefore. the ’power of error detection on bQth
schemes are the same・ 工n the case that the number of bits for
the key一’ kock memory is Limited and the reLation N$K is not
satisfied, th6 probabiしities of err◎r detection is aしso the
same. The incrementaL protection eode scheme can be
imptemented with much difficutty by muLtipte processors as is
shown tater. because the scheme is based on the as’ 唐浮高垂煤f [email protected]
[email protected]tしy coupしed to
the controし programs for au×iしiary processors which manipuしate
’keys and Locks. We take advantage of the fact that mostty th’
−10一
same @ p「09「am can be obeyed by the host .and au×iしiary
proces.sors aしike●
2・4 Program moduしe protection
Program moduしes such as procedures can be considered as a kうnd
of consecutive storage areas. If we assign protection codes to
the,し・・ks aS・。・i・t・d with th・inst・ucti。n w。・d・。・f such
moduしe『, the key一しock protection mechanism can aしso work in the
instructi。・ f・t・h ・y・しes i・t6e same way as th, d。t。
protection● Keys are stored うn the key memory associated with
add「ess「etating t。 th・jump and caしし instr・ctう。ns sh。W・i・
門9・・e5;These k・ysa・eし。、d。di。t。th。、P,。9,am、。unt,,。f
the key processor on the executうon of such jump and caしし
1nstr’uctlonSo
3。 Hardware organization of the detector
Figure 3 shows a moduしar software−fauしt detector・ co・nnected to
t.he address bus of the host system. The detector consists of
り two mlcrらopr・ocessors, aux1しi』ary functうonaし しogics and three
me…ies:し。・k ・hem。,y, k。y mem。,y and.fし、g mem。,y.
Aしし these three memories are reaしized as independen七 banks, and
ca・be add・essedi・p。,aしし。しwi七hthemainmem。,ybyth。h。、t
P「ocess。「・
jeyand l。ck mem。「うesa「eusedt・h・しdth・k・ysand
the pro,tection codes respectiveしy, and the fしag memory is used
to hoしd a singしe identification bit wh{ch specifies whether the
−1ユー
associated data of the main ・memory is address. IAIe use two
identicaし mi.croprocessor 8080s as a key processor and a fしag
processor respectうveしy, and outside of the microprocessor a
comparator is provided for high speed cheeking of the key and
the protection code. The data Li’nes of these processors are
connected to the specific memories through a muLtipLexer.
because the instruction opcodes are supptied directLy from the
main memory during the fetch cycte of the host processor.
Tりe three microprocessors (main’ key ahd fしag) shouしd be
synchronized by the same cLock system. and the same instruction
opcode (the first byte of the instruction) shouしd be given at
t・he same time. ALthough most i’nstructions are sent to these
th,ee mi、,。P,。cess。rs.、。me speci。しinst,ucti。ns a,e ’
高≠垂o,d
into harmしess ones such as NOPs for the fしag processor.
Therefore. the execution time of such a processor may differ
f,。m th。’ Bth。,s. エ.。rd,, t。、ynch,。。ize、u,h p,。cess。,s,
”wait” states are inserted in the Ml cycLe (the first instruc−
tion fetch cycLe) by controLLing the memory ready status.
The use of the identicaL microprocessors is essentiaL in
modutar design of hardware. because the processors have the
same registers. instruction decoders and execution timing
controしs in their own LS工 chips● Hence, these LS工 chips can
make our design of hardware simpしe and compact.
4e
Prうncipしes of operatうons
一一 12一
4●ユ Basic operations
(1》 Opcode fetch cycしe
The fうrst action of instruction e×ecution is the opcode fetch.
At thi、 f,t、h、y、し。. th。 f。t・ t6wi.g。P。,。ti。。s<。一d>。,e
performed in paraしし』eし:
<a> The host processor outputs the contects of the program
counter to its own address しines, and aしし the four
memory banks are accessed by thうs same address
simuしtaneOUSしy●
<b> The host processor reads a byte of data (opcode) from
the main memory.
<、>Th。 k。y p,。cess。,。。tp。t、 the c。.tect,。f it、6w, p,。9,am
counter (procedure−wise key) to its own address しines,
and the comparator checks the equaしity between this
address and the data (protection code)
read from the しock memory. If an error is det層ected
durうng the comparison, an interrupt occurs to the
host processor.
<d> The key processor r・eads the same・byte of data (opcode)
f…the−mai・.m・…y;du・i・g乏hir・y・・し・・d・t・bus・f the
key processor is swうtched to the data しines of the
maln memory・
(2) The other cycしes
−13一
The’ @other cycLes of the execution may be either instruction
operand fetch cycしe or execution cycしe● 工n these cycしes, the
foししowing operations <a−d> are performed in paraししeし:
〈a> The host processor executes the opcode,’ if necessary it may
access to aLL the four memories by ghe same address which
is the foししowing: the program counter, registers, or
internaL working address register.
〈b> The host processor reads or writes the data from or to the
main memory if necessary.
<c> The lくey processor e×ecutes thg same opcode as the host
processor; it outputs the corresponded key to its address
しines. Then, the comparator checks the equaしity in the
same way as the previous case.
〈d> The gther actions of this key processor to the data depend
upon whether the content is a key or not● 工n the case that
the data is a key. the key processor reads or writes the
key from or to the key memory.
Otherwise, in the case of read operation the key processer
reads data from the main memory (as described in しater
e×ampしe), and in the case of write operation it writes
nothing to the key or main memory except that the operatiQn
is perfermed to the stack area. The decision whether
the content is a key or not is made by t・he ftag processor
’穿㌔
and the fしag memory.
(3) rncrementation of the keys
一ユ4一
Once the address i・s Loaded into one of the registers of the
host processor, address arithmetic operations such ’as
increments ◎r index additi◎ns are usuaししy performed on such
addresses● 工n・paraししeし with such operations, the key processor
performs the same operation on the co’
[email protected]
[email protected] address.
Thうs is s、impしy done by the execution ◎f the same instruction●
The incrementaし protection code is designed to match with such
caしcuしati◎ns of keyso
(4) Invaしid key operations
エn our scheme, arithmetic operations on addresses are
prohibited other than a±i or i±a where a is address and i is
integer. (Address shoutd be transformed into intege’ [email protected]
address ’O’. if generat arithmetic operations on addresses are
required.) The ftag processor checks whether the invatid opera−
tion was performed on the address.
(5.) Stack operations
Aしth。ugh. the vaしues inth・k・yp・。cess・・sh。・しd・。tbest。・ed
into key. memory usuatty7 there is one exception. We have to
save both key and vaLue onto the stack in the case of stack
operations such as PUSH.
4.2 Examptes of the basic operations
一ユ5一
(1) SimpLe reference of an array etement
First. consider that CPU Loads the contects of the second byte
of the array AA into. A−register. The program may be wrStten as
Pl:
LXI H,AA l L×工 H,base key of AA
エN× 』H l エN× H
MOV A.M 1 ’MOV A.M
(i) host processor (ii> key processor
Program PIL● Reference of the second eしement of array AA
工n this case, when the host processor e×ecutes the instructions
as program Pl〈i>. the key processor executes the instruction as
program Pユ(ii) in paraししeし. However, we note that the program
Pユ(ii) does not e×ists e×pしうcitしy on the memory● On the third
step of this program, the key proce、ssor wouしd pひesent the
contents of its.own HL register to the address しines・ This is
the key to be compared with the しock of the second byte of the
array AA. An exampLe of object codes for the program Pl is
shown in Figure 4.
(2) lndexed access
一ユ6一
エn the program P2, the CPU しoads the contents of the fourth
byte of array AA into A−register. But the vatue 3 is given in
the DE register as as index. 工f we couしd not しoad this vaしue 3
into the DE register of the key processor at the second step.
the k。y p,。cess。,c。。しd。。tp,。ducea’ o r。P,,k,yi。th。し、ter
memory access. Therefore, we しoad vaしue 3 into the DE register
of the key processor at step 2. To perform thist the vaLue 〈*
in the program P2(ii)) must be transfered from the main memory
data bus to the key processor data bus in the proper timing.
This switching うs done by the contents of fしag memory; that is,
the data bgs is connected to main system in the case that the
ftag indicates ”’not address”. and conneeted to the key !nemory
in the case the ftag indicates ”address”. Thus. keys and
vaしues are mi×ed うn the key processor. A fしag processor うs
used to prevent this confusion.
LX工 H,AA l LX工 H,base key of AA l L×I H,address fしag
L×I D,3 1 L×I D,3 (*) l L×工 D,vaしue fしag
DAD D I DAD D I DAD D
MOV A.M l MOV A.M l MOV A.M
(i) host (ii) key processor (.iii) fしag processor
processor
Program P2. Reference by index access
一ユ7一
(3
j .Progrgmming restriction on parameter pasging
Zn our scheme. we can pass the key of the parameter to the
gatLed subroutine by the use of registers as parameter.
However. in the case the parameter address is pass.ed by the
program countert mostLy by return address. with 8080
microprocessor we have no mean to pass the proper key of those
parameter area to the subroutine. even when we assign the
different protection codes to such parameter area. There are
two choices for this case:
(i) We restrict th’e programming technique or. code generation
convention. and we pass the parameter address through a
register as shown in Figure 5.
(ii) Or. we abandon the runtime check; that is. we do not
distinguish the parameter area from the instructien space.
However. the first strategy is to be preferred to improve the
software reLiabitity.
一ユ8。
5. Conctuding remarks
We desうgned the detector based on the 工N丁EL 8080 microprocessor
as a hardware tooし to improve the software reしiabiしうty, and
further to・ increase software cost perfoimance. Our detector
reqiures additionaL hardware resources such as processor chips
and e×tra memories・ However, the cost wouしd be minimaし,
・。n・id・ring th・fact th・t the c。、t。f、’ Bftwa,ed。veし。pme。t
occupies. targe part of the totat system devetopment cost.
especiatLy in the case of a dedicated embedded system.
In ouト scheme other additう.onbし hardware wうしし make further
protection possibしe・ For e×ampしe, an additionaし one bit fしag
memory to 6ach memory ceしし can detect the うししegaし reference of
undefined vaしues of a variabしe [7] . 工f we appしy the bound
checking mechanSsm to timit the range ot pointer (address
va・iabし・). we c。・しdうn・。・・P6・at・・m。・e c。mpし・X’,ange checki。g
inctudi,g、ub,angeし’
奄高奄狽≠狽堰B。. F。,th。,,。mech。。う,m whi。h can
monitor dynamう。 behavior of the program [5,8,9] wouしd
profうtabしy be incorporated as hardware tooしs for the reaしi2a−
tion of the powerfut debugging environments.
一19一
References:
[1]
K● 工tano and T● 工da,
Hardware array bound checker on tagged architecture.
工SE−TR−80−16, University of Tsukuba (1980)●
[2]
N. Suzuki and K. Zshihata.
Zmptemantation of array bound checker.
Proc. of 4th ACM §ymposium on Principしes of
Programming Languages 〈1977).
[3]
G.J. Myers. Advances in computer architecturet
John WiLey and Sons (1978).
[4]
[5]
G.J. Myerst The art of software testing.
John Witey and Sons (1978).
L・G● Stucki,.New directions in automated tooしs for
improving software quatity.
in tCurrent trends in programming methodoしogyt,
VoL. 2. Program Vatidation,
Prentice Haしし, (1977), 80−111..
[6]
C.V. Ramamoorthy. R.E. Meekert and J. Tunner.
Design and’ construction of an automated software
eVaしUatiOn SyStem,
IEEE Symposium on co願puter software reしiabiしity,
New York. 〈1973). 28−37.
[7]
J. R. Ehrman. System design. machine architecture.
and debugging. SrGPLAN Notices. 8(1972). 8・一23.
[8]
J. R. Kane and S. S. Yau. Concurrent software
fautt detection.
工EEE trans. Software Engineering, SE・一1, 1(1975), 87−99●
[9]
H.J. SaaL and L.J. Shuster.
On・measuring computer systems by microprogramming.
Microprogrammin and Systems architectur’e:
:nfotech State of the art reports. Berksire. Engtand:
rnfotech (1975). 473−489.
一20一
Figure captうons塁
Figure
1.
Fi gure 2e
Figure
Basic ke.y−btock’ protection scheme.
工ncrementaし protection codes
with two.bit しock fうeしd●
3.
Figure 4e
Fi gure se
Hardware organization of the moduしar
software−fauしt detector・
An exampLe of ebject codes of program Pl.
Procedurewsse protection scheme
and parameter passing.
一21一
k
1
2
3
4
20
0,526
0,789
0,921
0,987
1
50
0,510
0,765
0,893
0,957
1
100
0,505
0,758
0,884
0,947
1
200
0,503
0,754
0,879
0,942
:L
500
0,501
0,752
0,877
0,939
0,998
oo
0,500
0,750
0,875
0,938
0,996
k= number of bits of
8
P「otegt■on code
N = number of areas
Table 1. Probabilities of error detection
address lock cell
(a+i,k)
k
k
k
a :
a十1:
a十2:
ce11(0)
ce11(1)
cell(2)
. I I l larea A
:
k
a十i:
ce11(i)
:
.
(1) Uniform protection code
(a+i ,’k+i)
a :
a十1:
a十2:
k
k十1
k十2
ce11(0)
cell(1)
ce112
・ ’1 1 1 1area A
:
a十i:
k十i
cell(i)
:
.
(2) lncremental protection code
Figure 1. Basic key−lock p. rotection scheme.
address lock cell lock cell
AO(0)
3=15十〇
0=0十〇
AO(0
15: 1 O=O十〇 1 AO(O) 1一一一一
AO(1)
16: 1 1=O+1 1 AO(1) 1一一‘一1 O=15+1 1 AO(1)11 area AO
AO(1
0=15+1
1=0+1
AO(2)
1=15十2
2=0十2
AO 2
17: 1 2=O十2 1 AO(2) 1一一一一
1=:L十〇
Al(0)
Al(0)
3=18+1
18: 1 1=1十〇 1 Al(O) 1一一一一
A1(1)
Al(1)
0=18十2
2=1十1
19: i 2=1+1 1 Al(1) 1一一一一
area Al
Al(2)
A1(2)
1=18十3
3=1十2
20: 1 3=1十2 1 Al(2) 1一一一一
A1(3)
Al(3)
2=18+4
0=1十3
21: 1 O=1十3 1 AI(3) 1一一一一
A2(0)
A2(0)
2=2十〇
0=22+2
22: 一一一一 area A2
A2(1)
A2(1)
1=22+3
3=2十1
23:1 3=2十1 lA2(1)1一一一一
A3(0)
A3(0)
3=24+3
3=3+0
24: 一一一一
area A3
A3(1)
25 :.
A3(1)
0=24+4
0=3十1
一 一 一 一
’
(1) lncrementing the base (2) Assignment of the protection
protection codes codes by Li ai+ i・
rk All additions are made in modulo 4.
Figure 2. Incre皿ental protection codes with two bit lo.ck field・
r一一一 一一”’一一一v一一一一一一一一一一一
u
「一一一一一一一一一一一一}一一l
l
l Software−fault detector !
Host svs’tem !
l
” 1
1 ’T”T’nr一’T’T一’M’”’1’V’一 1
1
l
l
clock
synchronizer 1 ’ l
I
l
t
I
I
l
I
t
Fla g.
Keヤ
l
Host
l
■nput
processor
processor
&
(8080)
(8080)
p. rocessor
I Devices
(8080)
D
1 A.
output
l
l
l
interrupt1
l
1
l
ma p.
I
l
D
l
D
D A
l
FIag
i
Lock
Key
l
Ma in
memo ry.
l
memo rv
memory
l
I
memory
1
l
1
?
op. .
L一一一”一一.一””一一 J
Lm””一一一
Figure 3. . Hardware organization of
detector
the modular sof.tware−fault
address
1000:
1001:
1002:
1003:
1004:
key/lock cell
夫
3
A
4
0
嚢
5
6
夫
7
21
34
12
23
7E
LXI H,AA
INX H
MOV A,M
.
・
.
.
.
1234:
1235:
1236:
1237:
1238:
Figure 4.
.
氏
A
★
B
C
★
★
D
夫
E
41
42
43
44
45
AA: DB
鱒ABCDE,曾
An example of object codes of Program Pl.
addresq.
1024:
1025:
1026:
1027:
1028:
1029:
102A:
102B:
102C:
key/lock cell
敦
8
0
嚢
2
0
夫
夫
肉.
OF
10
11
12
13
14
08
09
17
21
:LXI 且,IX
2A
10
CD
CALL SUB
56
23
41
42
B7
DB
ORA A
.
:
2356:
:
索
02
:F9
SUB: SPHL
.
.
.
.
.
Fig.ure 5.
騨AB曾冒
.
Procedurewise prot・ection scheme
and parameter の
paSS■ng・
INSTITUTE OF INFORIVIATION SCIENCE AND ELECTRONICS
UNIVERSITY OF TSUKUBA
SAKURA−MURA, NIIHARI−GUN, IBARAKI, JAPAN
REPORT DOCUMENTAT I ON PAGE
REPORT NUMBER
ZSE−TR一一82−26
丁ITLE
Software−fault detector for Microprocessors
AUTHOR(S)
Kozo ltano
Tetsuo 工da
REPOR丁 DATE
January 15, 1982
MAIN CATEGORY
Computer systems
NUMBER OF PAGES
・27
CR CATEGORIES
6.2, 6.3
KEY WORDS
software reliability, run−time hardware support,
key−lock memory protection, incremental protection code,
array bound checker, program module protection.
ABSTRACT
For the realization of the means to develop more reliable
soEtware for the microcomputers especially in real time environments,
we desigrt a hardware tool called ”software−fault detector” which
detects software faults such as misaccess to art element beyond the
rqnge of an array. The implementation of the mechanism for such
address range checks is generally difficult in microprocessor
environment s since internal registers are not readily visible to
external logics. We introduce an ”incremental” key−lock protection
scheme into the fixed microcomputer architecture of the 工NTEL 8080
.
because of its popularity and simplicity. 1n this scheme, a ”IQck”
is a protection code associated with the storage cell, and a ”key” is
associated with access capability such as address. ln each memory
access to a cell, a check is made whether a key matched against the
lock of the addressed cell. ln this paper,
we present the details
of the scheme and its analysis. Further, we present an actual hardware
Our
des.ign of the $oftware fault detector.
design methodology is to
identical microprocessor
8080s, as an
realize a dector by the use of
independent one−board module which could be
connected to the memory
bus of the host system.
SUPPLEMENTARY . NOTES