Path: utzoo!mnetor!uunet!cbmvax!carolyn From: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Newsgroups: comp.sys.amiga Subject: Re: Telling AmigaDOS to be quiet for a bit Message-ID: <3130@cbmvax.UUCP> Date: 12 Jan 88 14:57:06 GMT References: <952@rocky.STANFORD.EDU> Reply-To: carolyn@cbmvax.UUCP (Carolyn Scheppner CATS) Organization: Commodore Technology, West Chester, PA Lines: 92 In article <952@rocky.STANFORD.EDU> rokicki@rocky.STANFORD.EDU (Tomas Rokicki) writes: >Howdy! I just wrote a program which copies disks and verifies the copies, >and allows quick multiple copies if you have a meg free. (This is for >those BADGE Killer Demo Disks, and the orders keep coming in.) The only >problem I'm having is the damn validator which is always running. Is >there a way to tell AmigaDOS to ignore a particular drive for a while? >For instance, DiskCopy does this, with those cute little DF1:BUSY things. >Any help? Here's what diskcopy and format do to Inhibit DOS from validating the drive. Note that diskcopy updates the root block of the copy with a new creation date and last-accessed date so that it is not an EXACT copy when the drives are uninhibited. You must never have two exact copy disks in the drives unless the drives are inhibited. And be very very careful to never leave a drive in an inhibited state when you exit. /* Action Inhibit routine * * Inhibits validator from validating a drive * * DO NOT Uninhibit while two exact copy disks are in drives * Make sure you DO uninhibit any inhibited drives before exit or abort */ #include "exec/types.h" #include "exec/memory.h" #include "exec/ports.h" #include "libraries/dos.h" #include "libraries/dosextens.h" #define DOSTRUE (-1L) #define DOSFALSE (0L) /* Sample calling code fragment */ char *name = "df0:"; struct MsgPort *dproc; BOOL Inhibited = FALSE; main() { if(!(dproc = DeviceProc(dname))) cleanexit("Can't access unit\n",RETURN_FAIL); if(!(Inhibited = ActionInhibit(DOSTRUE,dproc))) cleanexit("Can't inhibit unit\n",RETURN_FAIL); /* Do trackdisk level stuff */ if(Inhibited) ActionInhibit(DOSFALSE,dproc); } /* Action Inhibit routine */ ActionInhibit(toggle, diskProc) LONG toggle; struct MsgPort *diskProc; { struct StandardPacket *sp; struct MsgPort *rp; int error; if(!(sp = (struct StandardPacket *) AllocMem(sizeof(struct StandardPacket),MEMF_PUBLIC|MEMF_CLEAR))) return(0); sp->sp_Msg.mn_Node.ln_Name = (char *)&sp->sp_Pkt; sp->sp_Pkt.dp_Link = &sp->sp_Msg; sp->sp_Pkt.dp_Port = rp = &((struct Process *)FindTask(0))->pr_MsgPort; sp->sp_Pkt.dp_Type = ACTION_INHIBIT; sp->sp_Pkt.dp_Arg1 = toggle; PutMsg(diskProc, &sp->sp_Msg); if((ULONG)WaitPort(rp) != (ULONG)&sp->sp_Msg) return(0); Remove(&sp->sp_Msg); error = sp->sp_Pkt.dp_Res1 ? 1 : 0; FreeMem(sp, sizeof(struct StandardPacket)); return(error); } /* end */ -- =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Carolyn Scheppner -- CATS >>Commodore Amiga Technical Support<< UUCP ...{allegra,ihnp4,rutgers}!cbmvax!carolyn PHONE 215-431-9180 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=