Everhart, Glenn From: Terry Kennedy [terry@spcunb.spc.edu] Sent: Wednesday, September 02, 1998 7:46 AM To: Info-VAX@Mvb.Saic.Com Subject: Re: Can I change Error count on a disk? paddy.o'brien@zzz.tg.nsw.gov.au writes: > I have searched the bookreader manuals and spoken to our systems contractors for > our corporate machines. None /neither were able to remember a way to revert the > error count on a disk to zero. I have never needed this before, but would like > to do it now, if possible without re-booting -- the only way that we could think > of. I remember something called "ZDEC" (I think) on a long-ago SIG tape. It may appear on newer SIG tapes, and maybe even an Alpha version. At least the name should give you something to search on. Also, here is a Bliss skeleton which claims to work on Alphas (from the DECUServe system at telnet://eisner.decus.org): <<< EISNER::$2$DIA7:[NOTES$HIVOL]VMS.NOTE;1 >>> -< VMS and bundled utilities >- ================================================================================ Note 1650.9 Can the error count be zeroed? 9 of 9 EISNER::WATSON_G "George Watson" 46 lines 13-APR-1998 18:46 -< Code to clear device error counts, Alpha V7 >- -------------------------------------------------------------------------------- Here is a BLISS version that I have used successfully from Alpha VMS V7.1. This is the guts of the utility, the routine that you call via $CMKRNL. You would want to wrap this in a main program that uses your preferred method of getting the device name from the user, then doing the change mode. Note that this uses the new *_STD$* routines, which use normal (i.e., easy to use from C) calls instead of JSBs. LIBRARY 'SYS$LIBRARY:lib'; EXTERNAL ROUTINE LIB$get_foreign, LIB$put_output, SCH_STD$iolockw, SCH_STD$iounlock : NOVALUE, IOC_STD$searchdev; ROUTINE zero_error_internal(devname : REF $BBLOCK) = BEGIN !*** ! This is the kernal mode routine to clear the error count. The device name is ! passed by descriptor. !*** LOCAL sts, mutex_adr, ucb : REF $BBLOCK, ddb : REF $BBLOCK, sb : REF $BBLOCK; EXTERNAL CTL$GL_pcb : REF $BBLOCK; ! ! Get the IO mutex for write. This will set IPL to ASTDEL. ! mutex_adr = SCH_STD$iolockw(.CTL$GL_pcb); ! ! Locate the device, and get its UCB. ! sts = IOC_STD$searchdev(.devname, ucb, ddb, sb); IF .sts THEN BEGIN ! ! We found it. Acquire the fork lock, which is used to serialize ! modifications to the UCB, and zero the count. ! $forklock(LOCK=.ucb[UCB$B_flck]); ucb[UCB$L_errcnt] = 0; $forkunlock(LOCK=.ucb[UCB$B_flck],NEWIPL=IPL$_astdel); END; ! ! Unlock the IO mutex. We are left at mode of caller (ASTDEL), so lower ! IPL afterwards. ! SCH_STD$iounlock(.CTL$GL_pcb); $enbint(SRC=0); .sts END; Terry Kennedy Operations Manager, Academic Computing terry@spcvxa.spc.edu St. Peter's College, Jersey City, NJ USA +1 201 915 9381 (voice) +1 201 435-3662 (FAX)