home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
576.lha
/
DisDF_v1.1
/
DisDF.doc.pp
/
DisDF.doc
Wrap
Text File
|
1991-11-08
|
7KB
|
194 lines
/* DisDF.doc V1.1
NAME
DisDF
SYNOPSIS
DisDF [0] [1] [2] [3] [c] [-d|e|s] [-f] [-h] [v]
DESCRIPTION
For those who don't use floppies much
and for whom NoClick is ineffective
stops that empty floppy drive noise !!!
by disabling the floppy drive tasks.
When called a first time, or anytime with the disable option, DisDF
removes each specified floppy drive's 'trackdisk.device' task from
exec's task lists and moves it to the tail of the TaskWait list in the
TS_REMOVED state so that it never runs, thus disabling the floppy drive.
When called a second time, or anytime with the enable option, DisDF moves
each specified floppy drive's 'trackdisk.device' task to the tail of the
TaskReady list in the TS_WAIT state so that it can run, thus re-enabling
the floppy drives.
DisDF also changes a disabled 'trackdisk.device' task's priority to -123 so
that it can be spotted as disabled in task lists where task states aren't
shown.
options
# floppy drive number to enable or disable.
Default is all drives DF0: to DF3:.
-c change priorities only and run a higher priority busyloop task.
See 'warnings' below.
-d disable (instead of toggle).
If no drives are specified, all will be disabled.
-e enable (instead of toggle).
If no drives are specified, all will be enabled.
-f additionally disable the 'File System' task of a disabled drive.
( this task uses CPU time even when the drive is disabled ).
See warnings below. Need not be specified when enabling the drive.
-h or any wrong argument puts usage to stdout, exits with Fail code 10.
-s status only; put current drive status messages to stdout, do not
modify drive tasks.
-v verbose; put drive status messages to stdout after tasks are modified.
RETURNS
Fail code and message :
$0000 floppy disks disabled
floppy disks enabled
success; message if -d or -e option, otherwise silent.
$000A Command line argument error; usage is put to stdout.
$000B CreateExtIO() error
$000C CreatePort() error
these library functions called by DisDF can fail due to memory
shortage; try again.
$000D no floppy drive found
DisDF calls OpenDevice() for DF0 to DF3; in case of error it
assumes that drive is not mounted; if none are mounted, it exits
with this message.
----- DFn not mounted
(message only) Drive DFn was specified in the command line but
is not mounted.
$000E not enough memory
an AllocMem call failed; try again.
Fail codes greater than $000F indicate a sum of failures as follows :
$00x0 DFn device process missing.
DisDF failed to find for each mounted drive a device process
using library function DeviceProc("DFn:");
$0y00 DFn trackdisk.device task missing.
DisDF failed to find for each mounted floppy drive a trackdisk.
device task in exec's task lists.
$z000 DFn File System task missing.
DisDF failed to find for each mounted floppy drive a File System
task in exec's task lists; this is the same task as the 'device
process' found above with DeviceProc().
z, y, x above are each 8+4+2+1 for drives DF3+ DF2+ DF1+ DF0 respectively.
Such errors indicate that something went drastically wrong, and it is
probably best to reboot immediately unless you know why they occured.
y and z errors can occur when some tasking utilities simply remove tasks
from exec's task lists to 'kill' or 'freeze' them, but leave their
associated structures in the system; in such cases, if the utility can
put the task back in a list ('warm' or 'ready' it), you probably needn't
reboot.
EXAMPLES
DisDF ;toggle all floppy drives off/on.
DisDF -f ;toggle all floppy drives off/on, also 'File System' tasks.
DisDF -d ;disable all floppy drives.
DisDF -s ;type current drive status to stdout.
DisDF -d -f ;disable all floppy drives and their 'File System' tasks.
DisDF -e -v ;enable all floppy drives and show status.
DisDF 0 2 ;toggle DF0: and DF2: off/on, leave others unchanged.
DisDF 0 2 -d -f ;disable DF0: and DF2: and their 'File System' tasks,
leave other drives unchanged.
DisDF -d 2 -f 0 ;same as above ( order of args is irrelevent ).
DisDF 0 2 -e ;enable DF0: and DF2:, leave other drives unchanged.
DisDF -h
DisDF ?
DisDF 1 2 3 4 ;type usage to stdout ( 4 is invalid argument ).
From the Workbench, use a project icon with default tool DisDF.
If you're not into workbench and icons but want to try this :
- from a CLI, Copy DH0:Pointer.info to DH0:DisDF.info;
- open DH0: on the workbench and click once on the new icon
(it's under the 'Pointer' icon...)
- select Info from the Workbench menu, opening a panel
- in the 'Default Tool' box type 'SYS:utilities/DisDF', or DisDF is
- delete the Tool Type with the 'Del' gadget
- exit the Info panel with 'Save'
- close and reopen DH0:
Double-clicking on the new icon (it's still under the 'Pointer' icon...)
should now toggle the drives off/on.
AUTHOR
V1.0 July 22 1991, V1.1 Aug 4 1991 by
Patrick F. Misteli, 72 chemin Ami-Argand, 1290 Versoix Geneva, Switzerland.
Anyone who gets a hold of this is free to do whatever can be done with it.
WARNINGS
Do not use the -f (File System) option if running the Workbench.
Do not use the -f (File System) option if you expect to run commands that
look for floppy drives, such as Info.
These will hang if the File System tasks disabled.
If this happens you must reboot unless :
-you can start another CLI ( with a hot key ) from which you can re-enable
the drives, or
-you installed DisDF under a hot key that enables all drives, e.g. a
"DisDF -e" script, or
-you can start a tasking utility that can move the File System tasks into
the TaskReady list, preferably with priority 10.
LoadWB needs both the 'File System' and 'trackdisk.device' tasks,
so all drives must be enabled; if not, proceed as above.
If you have qualms about DisDF's brutally modifying task states that
exec so carefully maintains, a 'system safe' alternative involves
running a busywait loop at priority -122, then setting the floppy drive
tasks' priority to -123 to disable the drives, and back to their normal
value to enable them. i.e run DisDF with the -c (chicken) option.
SEE ALSO
NoClick, TaskControl, Xoper, AskTask, TrackSalve, Who, Taskx.
One can do the same as DisDF with programs such as TaskControl, Xoper,
TrackSalve, and AskTask by 'freezing' the trackdisk tasks; some of these
can be run from a script, but stay resident (Xoper); or they remove the
tasks from the lists so that other tasks can't find them. Disabling a
particular drive might be a little tedious (use Who to get tasknumbers).
BUGS
"...?" ("The Shadow knows.")
V1.1 Aug 4 1991
fixed exit() to permexit() in addbusytask().
fixed exit codes to int.
end DisDF.doc ---------------------------------------------------------- */