Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!rutgers!cbmvax!andy From: andy@cbmvax.UUCP (Andy Finkel) Newsgroups: comp.sys.amiga Subject: Re: StepRate ... a utility that makes your floppies FASTER! Message-ID: <2459@cbmvax.UUCP> Date: Fri, 9-Oct-87 16:00:14 EDT Article-I.D.: cbmvax.2459 Posted: Fri Oct 9 16:00:14 1987 Date-Received: Mon, 12-Oct-87 06:46:43 EDT References: <15607@amdahl.amdahl.com> Reply-To: andy@cbmvax.UUCP (Andy Finkel) Organization: Commodore Technology, West Chester, PA Lines: 224 Keywords: stepping rate improvement speedup faster floppy In article <15607@amdahl.amdahl.com> kim@amdahl.amdahl.com (Kim DeVaughn) writes: >The author says he can halve the access time on his drives ... down to >about 1500 ticks (from the stock AmigaDOS* value of 3000). Actually, I send along a C program that does this very thing, to the moderated amiga source group awhile ago, but I guess it was during the "time of troubles" I did it while tracking down a bug. First the bug... in the file exec/devices.h a member of the Unit structure was wrong...it should be struct MsgPort unit_MsgPort; NOT *unit_MsgPort. Now a warning...you can trash disks and hurt drives by using very low values. Check the drive mfgrs specs to be sure. We/I take no responsibility once you start playing. >* - I still know of no better term for the Amiga OS as a whole, than AmigaDOS; > especially since that's what the default CLI window is titled. I like the term ROM KERNAL for the OS as a whole. >To get at these parameters, you open the TrackDisk.Device and >this device tells you where the parameters are. Of course, the folks >who wrote Amigados & kickstart tried to hide this parameter, so there >isn't a name for it in the system include files. Mr. Kegelmann found >the right longword though. Mr Kegelmann should have looked in the include files...there's one with the catchy name of trackdisk.h that has the info he wanted... ie: struct TDU_PublicUnit { struct Unit tdu_Unit; /* base message port */ UWORD tdu_Comp01Track; /* track for first precomp */ UWORD tdu_Comp10Track; /* track for second precomp */ UWORD tdu_Comp11Track; /* track for third precomp */ ULONG tdu_StepDelay; /* time to wait after stepping */ ULONG tdu_SettleDelay; /* time to wait after seeking */ UBYTE tdu_RetryCnt; /* # of times to retry */ }; > >The initial value of the ticks between steps (eghad, what buzzwords!) >is set to 3000 (base 10; I mean decimal!) by kickstart. Its microseconds, by the way. Anyway, enough complaining. Here's the program. It also lets you play with the settle time. #include "exec/types.h" #include "exec/libraries.h" #include "exec/ports.h" /************************************************************* * This program allows you to read and modify the step delay * and settle delay times for units of the trackdisk device * SetDelay * by Andy Finkel * Copyright 1987 Commodore-Amiga, Inc. * Permission to distribute and use given provided * that this notice remains intact. * * The following is a replacement for a broken include file, included * here for clarity * Don't you do this! Instead, fix your exec/devices.h file ! * Change that *unit_MsgPort to a unit_MsgPort *****************************************************************/ /*#include "exec/devices.h"*/ #define EXEC_DEVICES_H /****** Device ******************************************************/ struct Device { struct Library dd_Library; }; /****** Unit ********************************************************/ struct Unit { struct MsgPort unit_MsgPort; /* queue for unprocessed messages */ UBYTE unit_flags; UBYTE unit_pad; UWORD unit_OpenCnt; /* number of active opens */ }; #define UNITF_ACTIVE (1<<0) #define UNITF_INTASK (1<<1) #include "exec/io.h" #include "devices/trackdisk.h" #include "libraries/dos.h" #include "libraries/dosextens.h" #define TOUPPER(c) ((c)>='a'&&(c)<='z'?(c)-'a'+'A':(c)) struct MsgPort *trackport=NULL; struct IOExtTD *trackreq=NULL; struct TDU_PublicUnit *unit=NULL; extern UBYTE *strcpy(); extern UBYTE *strcat(); main(argc,argv) int argc; UBYTE *argv[]; { int unitno=0,s; struct Process *process; UBYTE buf[10]; if((*argv[argc-1]=='?') || (argc < 2)) { printf("Usage: %ls [Unit] [Step delay] [Settle Delay]\n"); cleanup(0); } process=(struct Process *)FindTask(NULL); unitno=atoi(argv[1]); if((unitno<0) || (unitno > 4)) { printf("Bad args\n"); cleanup(10); } strcpy(buf,"df"); /* is there the unit requested ? */ strcat(buf,argv[1]); /* (cheap way, I know) */ strcat(buf,":"); process->pr_WindowPtr= (struct Window *)-1; /* quietly, please */ s=DeviceProc(buf); process->pr_WindowPtr= NULL; if(!s) { printf("Error: no unit %ld\n",unitno); cleanup(20); } if(!(trackport = (struct MsgPort *)CreatePort(0, 0)))cleanup(20); if(!(trackreq = (struct IOExtTD *)CreateExtIO(trackport,sizeof(struct IOExtTD))))cleanup(20); if (OpenDevice(TD_NAME, unitno, trackreq, 0))cleanup(20); unit= trackreq->iotd_Req.io_Unit; if(!unit)cleanup(20); if(argc >= 3) unit->tdu_StepDelay= atoi(argv[2]); if(argc >= 4) unit->tdu_SettleDelay= atoi(argv[3]); printf("step delay is %ld, settle delay is %ld\n",unit->tdu_StepDelay,unit->tdu_SettleDelay); cleanup(0); } cleanup(err) int err; { if (trackport) { GetMsg(trackport); CloseDevice(trackreq); DeleteExtIO(trackreq,sizeof(struct IOExtTD)); DeletePort(trackport); } exit(err); } atoi( s ) char *s; { int num = 0; while (*s && (*s == ' '))s++; /* eat leading spaces */ if( *s == '+' ) s++; else if( *s == '-' ) { s++; } while( *s >= '0' && *s <= '9' ) { num = num * 10 + *s++ - '0'; } while( *s >= '0' && *s <= '9' ) { num = num * 10 + *s++ - '0'; } return( num ); } UBYTE * strcpy(dest, source) UBYTE *dest; UBYTE *source; { UBYTE *orig = dest; while (*dest++ = *source++); return( orig ); } UBYTE * strcat( s, new ) UBYTE *s, *new; { UBYTE c; UBYTE *orig = s; while( *s ) s++; do { c = *s++ = *new++; } while( c ); return( orig ); } -- andy finkel {ihnp4|seismo|allegra}!cbmvax!andy Commodore-Amiga, Inc. "Interfere? Of course we'll interfere. Always do what you're best at, I always say." Any expressed opinions are mine; but feel free to share. I disclaim all responsibilities, all shapes, all sizes, all colors.