• No results found

Development Environment

In document dtj v04 01 1992 pdf (Page 52-54)

The Microsoft Windows system includes virtual device drivers. M icrosoft also has a device driver development k i t specifically for ueveloping v i rtual device drivers. 1 This section uescribes the envi­ ronment for developing and debugging this driver software.

Development Tools

Current ly, virtual device d rivers are wri tten in assembly language because higher-level language compilers general ly lack the abil ity to generate code with _32-bit offsets and registers. A special 32-bit assembler and l i nker are provided with the M icrosoft Windows device d river development kit. Debugging Tools

Vi rtual device drivers are debugged using the WDEB386 software modu le. This debug tool requ ires that a terminal or equ ivalent be connected

to one of the com munication ports on the PC; the

debugger performs i ts I/O to that com munications

port. Symbols are avai lable in the debugger, but source-level debugging is not provided.

To take fu l l advantage of the WDEB386 capabi l i­ ties, the debug version of the M icrosoft Windows WlN386.EXE mod u le should be used . Th is version contains many featu res essential for i nvestigating the behavior of the Windows system and, in par­ ticu lar, for debugging virtual device drivers. The features incl ude commands to displ ay the registers, the stack, and the control blocks for each v irtual machine. Many of the v irtual device drivers i ncluded with the Windows system, and the two i ncluded in the PATHWORKS for OOS product, have a debug entry point that may be invoked by entering the period keyboard character, followed by the name of the virtual device d river. Two particu larly usefu l debug entry points are .YMM and .V86MMGR, which provide detailed information about memory usage for each virtual machine, including the use of expanded memory and the high memory area. WDEfl)86 can be used successfu l ly in the Windows environment to debug virtual device drivers and to diagnose bugs in the read-only memory basic l/0 system (ROM BIOS) and other resident rea l-mode software.

\lfcmsujl \\ iudoii'S . \ eltmrk 1 /'r/t((f/ Oe/ ' ice /)rit ·ers in F I TIH\ ONK.\jin· nos

The CodeVinv lor Win dows lkhug tool i s i n t cndnl for debu ggi ng a p p l i c a t i ons a n d lh·n:t m i c l in k l i braries. not for de hugging 1 i rt u:tl dn i c e dri1 crs. l lowenT, t he CotlcVicw a m i WDEI I.-)H(J to o l s c t n h e used si m u l t a n e ously t o d i agnos e problems t h: t t occur wll l'n a p p l ic:tt ions c:t use t i l e \Vinllows SYstem t o fa i l .

The Network Virtual Device Drivers The I 'At ! JWt lt\h:S lor nos sort ware prm· ides t wo

.\l'l.'i fo r t:tsk- t o - L :t.�k n l'l 11·ork com n w n ic:t t ions. One i s :1 D l cCill'l socket-based i n terface. which uses

:111 a rgu ment blo ck cal le d :tn 1/0 con t ro l block

( l OCI I). T ile o t h n is t he i nd u�t r1·-st a nd ; t rd PC : nct­ \\·orking i n t erface. �l't iiiOS. 11·i th some c.\ t cnsions prm· i dctl b1· l ) ig i t :t l to s u p port 11· ide : t re:t lll' t ii'(Jrks. The ,'..Jct iiiOS i n t er Ltcc tt.scs : 1 11 a rg u m e n t block c:t l lnl t ile Nc· t iiiOS co n t ro l block ( NCB ) . !loth i n t c r­ LttTS : t re fu l l \ s u p j)Ort nl i n \V in dmY s e n h a nced Ill oti c .

l )igi t al 's 1',\l l i \\OHKS lor DOS n:rsion · t . l i n c l udes 1 wo l' i r t u a l dev ice d r i vers t o su pport net wor k i ng : \'D\!LT.:)H(J, wh ich h a n d k s I li:C n c t socket ca l ls. : t n d \ '\ E' I I I I O S 5H(J. IY hich l l : 1 1 1 d les N c t iiiOS ca l l s. ,\ l t lwugll t he\· s u p port d i llc rcn t ,\Pis. t 11L'sc t wo ,·i r­ t u a l tk,·ice dr i1Trs a rc simil:tr in struct ure. The d i s­ cussion in t his sec t i o n :t p jll ies to b o t h d rinTs u n lc.ss other11 i.s L· notell Thc.se d r i ,·ers a rc i n c l uded 11 i t h the c m re n t 1'.\TI I \\ t l l { h: S n: rs i o n i . l j)rod­ uct ami wi t h \Vi ntlows 1 e rs i o n .1. 1 ' l ( J i d e n t ify Digi t :t l Eq u i p ment Corpora t i o n :ts t h e dcvcloptT ol t h e d rin:rs . .\1 icrosoft tTq ucsted t l u t t h e modu il' n a lllL'S \ 1 )'\ \T .-) H(l a n d \ ' '\ J : T \ 1 \ 0 S . )H(l he ch;tngcd to D I ·:< : :'\ ET .-)1-)() :tnd DEC.'\ 1 1 ',H(l, respcc t i ,·c iY. i n W i ndows vers i o n :). ! . I n t h is pa per, t h e nomencla­ t urL' \'DNET and \' ;'! FT I IIOS is used to rein t o these t 11 0 modu ks.

TilL' Llri,·crs i n n > ke t h e rL·:t l -motle net 11·ork soft­ vv:t l'l' i n the ' i r t u a l ma c h i n e t h a t t't'lJ U <.:stcd the op era t i o n Ct'l':t t i ng a "net work 1· i r t u a l machine" to 11 i l ich t h e dri1 c r IH> u l d rou t e a l l net 11 ork acti l·­ i \ 1 11·o u l u h:ll c a l l o11·cd most of th e nct ii'Ork sot't· wa rL· to be loaded i n to a s i ng[(: l'i rt u a l m a c ll i ne aJH I t h u s !'reed u p conH·n t i onal me mory ror n o n­ \Vi mlo11·s a p p l ica t i o ns. I lo11·cn:r. u�i ng t h is design \\'< > u l d ha1·c i n c u rrul t h L· m c rhL·ad of .s\1· i t c l1 i ng on 1 i r t u:tl 11l:tch i lll'S ror l'\ t'f\' lll't WOrk :tl'l'l'SS. t i m e r t i ck. a m i net work hanlw;t JT i n t e rru p t . I n a d d i t i o n , crc:t t i ng a n e t 11·ork ,· i rt u:t l mach i n e wo u ld il a1·c rcq u i rnl t ll:tt t l tc t i a r a l i n k J a,·er :tll ll t i le DECoct '-Cilnlu il'r he c:q):t[)[e o( p cr t'orm i n g t h e 1· i r r u a l nl:t c i l i n c sw i t ch . l ' ina l ly, t h is design wo u l d he p rac-

l)igilal li't'/)llical /IJIII'IIlll I t t!. I .\ 1 1. I 1\ ill/('/' I'J')J

t ica l o n h· ror those users who access t h e net ­ work exc l us iYeiY 11 h i l c opera t ing i n a .\·l icrosoft \Xfi n do11·s cn\·iron mcn t .

Initialization

Vi rtual dc1·iet: d r i ,·ers : t re ca l it'd sc1 eral t i mes d u r­ i ng \Vi llLim1·s ini t i : t l i 1.:1 t i o n . \X;h i lc t h e \Vi ndoll s s1 s­ tem i.s st i l l opera t i ng in rea l mode. t h e \'D,'\ I ·T ami V Nt:TI I I OS mod uks ch eck to SLT il t he resident network soft ware is l oa d n l . If i t is not. there i s no reason to l oad these d r i ,·ers. A Y:t l u e is retu rned t h a t abOrt S t he load i ng o f t il e u r i l'l'rS b u t d i rec t s t h e Wind ows S\'Stem t o con t i n u e lo:td in g.

Aft er t h e \Vi ndows system L·n t er s pro t ected moclc, tile d ri1-ers a rc cal led ag:t in tl u r i ng e:tcll suc­ cessi l c phase of i n i t i a l il.a t i o n . L:tch ,- i r r u a l de1 icc dri1·cr t a kes COnt rol or t he sort \\ : l iT i nterrupts USetl for i t s tTSJ KUivc i\ 1'1 , rese r ves space in t he c o n t rol block of each ,·ir t u a l machine. olll a i n s p a r:tmct ers from t h e SYST D I I : \'1 f i le a n d : t l loca tcs a pool of global mc mon for l'\Jill lll u n ict t i on w i th t i l l' real­ mode resident n e t wo r k i n g sort w:tre . hgurc 2 i l l u s­ t ra tes a s1·srem 1· i rr u a l mach i n e and a ' i rt u a l machine r u n n i n g a DOS a p p l ic: t t i o n . The figu re ShOll'S t i le pOOl of U ln\·cnt ion:t l nll'!llOr\' tll : t t t h e v i rt ua l dev ice ll ri ,·cr a l locate:- a s global memory.

Tile liri,·crs pcr forn1 a " s a n i t l check" t o l'lTi f�· t h a t the 1 i r t u a l d c1· ice d riYer c:t n d i s t i ngu ish global lll Cnl <ln f'ro lll lll l'Ol O I'\' t h a t i s J oc:t J to :t si ngle l· i r­ tuaJ m a d 1 i n e . l !OIVC \'lT. t h e \Vi n lio ws fu n c t i o n to perform t h is clH:ck cttl !'a i l when r u n n i ng on some common unsupport l'll soft \\·;t rL· contigura t i o ns. At this p o i n t , if the sa n i t \' ciKck ra i l s. till' d ri\Tr d ispJ:t,·s a message t o ath·isc t h e u�c'l' to e.\ i t t he \Vinliows system

Virtt /{/fi.?:ct tion of'

I he

Netl/ 'ork

A Pis

\Vhu1 an a p pl ica t ion i.s.sucs a soft ware in tnrupt for a OECnct or N e l i iiOS ca l L t i l e a p propri a t e ' i r t u a l deYin: d r i ver g a i n s co n t ro l . I f t h e ; t p p l i c:t t i o n ma k­ ing the c :t l l is i n prot ected mode. t i l e Y i r t u a l dc1·icc d r i n:r a hv:tl's maps t he c:t l l in llll'lllO I'I'. OthtT\\ isc, the d r i \'lT software ch ecks tile con t rol block ( i . e . . the IOC B or the NUl ) a n d t h e b t t rkr :tddresses to deter m i ne iJ the' a rc st ored i n gl ob;t l memon. i . e . . mapped identica l l y i n t·,·erl' ,·i r t u : t l m ac i l i n c . JJ so. tile \'i rt u:tl d e 1·ice d r i ,·er do es 110t map t il L' c a l l , because i t w i l l cxLT u t c properly w i t h o u t mapping API .lhtjJf!in,r:. I f the control block ;tnd t i le h u fkr add resses :tJT n o t st ored itl global mcnHJ n·. map­ p i n g is ncccssaJ'\'. T h e \'i rt u:tl dc1·icc dril'cr

PATHWORKS: PC I ntegration Software

In document dtj v04 01 1992 pdf (Page 52-54)