.title kmtest .ident /v01.000/ .default displacement,word .link "sys$system:sys.stb"/selective_search .psect data noexe,rd,wrt,pic,noshr,page iosb: .blkq ;i/o status block chan: .blkw ;channel buffer: .blkb 64 ;user space buffer kma0: .ascid "KMA0" ;where the driver is .psect code exe,rd,nowrt,pic,shr,page .entry start,0 $assign_s devnam=kma0,chan=chan ;get a channel blbc r0,10$ ;nope. movab g^exe$gl_sitespec,r2 ;a handy address $qiow_s chan=chan,- ;first read it func=#io$_readlblk,- ; ... iosb=iosb,- ; ... p1=buffer,p2=#4,p3=r2 ; ... blbc r0,10$ ;lossage. blbs iosb,20$ ;check here, too. 10$: ret ;lossage. 20$: mcoml buffer,buffer ;compliment it $qiow_s chan=chan,- ;then write it func=#io$_writelblk,- ; ... iosb=iosb,- ; ... p1=buffer,p2=#4,p3=r2 ; ... ; test for a failing case. $qiow_s chan=chan,- ;attempt a read func=#io$_readlblk,- ; from somewhere way off in space iosb=iosb,- ; ... p1=buffer,p2=#7500,- ; ... p3=#8677740 ; ... $qiow_s chan=chan,- ;attempt another kind of failure func=#io$_writelblk,- ; ... iosb=iosb,- ; p1=@#0,p2=#512,p3=r2 ; ... movl #ss$_normal,r0 ;shh. ret ;done .end start