home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / vol_300 / 307_01 / adu.doc < prev    next >
Text File  |  1990-03-20  |  32KB  |  897 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.                          ■──────────────────────────■
  14.                                       AN
  15.                                    ADAPTABLE
  16.                                      DISK
  17.                                     UTILITY
  18.  
  19.                          ■───────────────────────────
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.                           AME Computing Systems 1989
  41.                                 16 Leyte Drive
  42.                              Surrey Downs  SA 5126
  43.                                    Australia
  44.  
  45.  
  46.  
  47. CONTENTS
  48. ■────────────────────────────────────────────────────────────────
  49.  
  50.                                                             Page
  51.  
  52. Section 1.  Overview                                        1
  53.  
  54.             1.0 Introduction                                1
  55.             1.1 Operation                                   1
  56.             1.2 Adjusting the PC's                          1
  57.                 Disk Format Tables                          1
  58.             1.3 Adapting the Utility                        1
  59.             1.4 Determining the Disk Format                 2
  60.  
  61. Section 2.  Commands                                        8
  62.             
  63.             2.1   Dump                                      8
  64.             2.2   Edit                                      8
  65.             2.3   Read a Sector                             8
  66.             2.4   Write a Sector                            9
  67.             2.5   Increment or Decrement                    9
  68.                   Sector or Track
  69.             2.6   Set/Specify Current                       9
  70.                   disk location
  71.             2.7   Vary disk parameter limits                10
  72.             2.8   Sector Translation and                    11
  73.                   Format Skew
  74.             2.9   Disk Copy                                 12
  75.             2.10  Modify Disk Base Table
  76.             2.11  Log Drive                                 12
  77.             2.12  Copy                                      12
  78.             2.13  Quit                                      12
  79.  
  80.  
  81. Section 3. Examples                                        13
  82.  
  83. Tables:  1. Contents of the PC's DISK_BASE table            3
  84.          2. Disk status bytes                               4
  85.  
  86. Listings:  1. C structure                                   5
  87.            2. Typical calling technique                     5
  88.            3. Functions                                     6
  89.         
  90.                            AN ADAPTABLE DISK UTILITY
  91.  
  92. SECTION 1.  OVERVIEW
  93.  
  94. 1.0   Introduction
  95.  
  96. There are many reasons for wanting to read non-standard formats.
  97. These range from wishing to look at backup disks created through
  98. such programmes as PC-BACKUP, FASTBACK, to reading other computer
  99. disk formats.  However, probably the most common reason is that
  100. the PC, to most people, was not their first machine.  Many of us
  101. started with CP/M and Apple IIs before graduating to the PC and
  102. we had to find some way of porting that old data to the PC.  If
  103. you still have the old computer, no problem, just load up a copy
  104. of MITE or PROCOMM on the PC and then with one of the many public
  105. domain CP/M communication packages, connect an RS-232 link
  106. between the computers, and that's it.  Many other utilities have
  107. in-built formats and work on the premise your disk format just
  108. 'must' be supported and have no inbuilt tools to allow you to
  109. adapt the package to your format. 
  110.  
  111. 1.1 Operation
  112.  
  113. ADU, for an Adaptable Disk Utility, will scan the disk, building
  114. up a disk parameter table. Once such a table is set up you can
  115. adjust any of the disk operating system dependencies such as
  116. system track offsets, before reading and editing.  The user
  117. interface follows other utilities by providing an inbuilt full
  118. screen editor, so that patching and editing the disk is a simple
  119. task.
  120.  
  121. It should be noted that this disk utility has been designed to
  122. specifically work with only floppy disk drives.  Hence even
  123. though you may specify greater than 2 drives, this does not infer
  124. that the system fixed disk can be scanned.  Thus, for example if
  125. drives A: and B: are 360k drives and drive C: is a fixed disk,
  126. and drive D: is a 3.5" floppy, ADU will ignore drive C:.  Hence
  127. under this senario you may log drives 0,1 or 3.  The reason for
  128. this is that ADU will always use INT 13H for all its disk I/O to
  129. ensure compatibility.
  130.  
  131. ADU is also limited by the physical limits of the PC's Floppy
  132. Disk Controller.  That is if the FDC can read 360k, 1.2M, 1.44M
  133. drives then it will function correctly provided the disk format
  134. recording method is Modified Frequency Modulation (MFM) or
  135. Standard Frequency Modulation (FM).  The recording methods used
  136. by Apple (GCR) is incompatible with the PC's disk controller and
  137. cannot therefore be used to read Apple disks.  The method
  138. normally used to overcome this problem is to design a device
  139. which is format insensitive and reads all the disk data
  140. irrespective of gaps and format fields etc.  Software is then
  141. used to re-construct the data.
  142.  
  143.  
  144. 1.2 Adjusting the PC's Disk Format Tables
  145.  
  146. The standard PC diskette format is made up of 40 tracks, each
  147. containing 9 sectors of 512 bytes/sector.  Vary this in any way
  148. and the PC chokes.  The PC will make a great deal of noise
  149. recalibrating and retrying but in vain, a point not lost on
  150. software vendors who protect their product through this form of
  151. copy protection.  For an interesting article on how to achieve a
  152. limited
  153. level of copy protection see Micro Systems/Journal, July/August
  154. 1986.
  155.   
  156. The first step in achieving a more flexible and unconstrained
  157. disk utility was to tell the PC's FDC to adapt to a non-PCDOS
  158. type disk format.  It is the IBM PC's BIOS with its inbuilt
  159. flexibility in allowing many of its functions to be table driven
  160. that solves the problem.  For instance, each time the BIOS is
  161. called to perform a disk function through INT 13H, it calls BIOS
  162. routine GET_PARM which indexes into a table called DISK_BASE. 
  163. DISK_BASE is a collection of FDC parameters which tells the BIOS
  164. in what manner the FDC chip must be programmed to correctly read
  165. the diskette.  Table 2 explains the variables and a partial
  166. listing from the disk utility ADU is included as listings 1 to 3
  167. in order to demonstrate how to vary the DISK_BASE pointer from
  168. within a high level language.
  169.  
  170. 1.3 Adapting the Utility
  171.   
  172. Some of the parameters relating to the GAP lengths must be
  173. determined empirically and are of most concern during attempts to
  174. read multiple sectors during a diskcopy or formatting process. 
  175. This is due to the fact that these GAPs are basically buffers
  176. designed to allow the controller's data separator the option of
  177. 'turning off' during splices or periods of unknown data.  If the
  178. Phase Locked Loop (PLL) within the data separator was not
  179. instructed to turn off, it may get out of synchronisation and
  180. thereby not be able to lock onto the identification (ID) marks. 
  181. An incorrect GAP setting can thus 'turn off' the data separator
  182. during an area of good data.  Errors of this type normally
  183. manifest themselves as 'Time out errors' (BIOS return code 80H). 
  184. The BIOS's diskette status area is maintained at address
  185. 0040:0041.  The diskette status data map is shown in Table 2.
  186.  
  187.  
  188.  
  189. 1.4 Determining the Disk Format
  190.  
  191. ADU determines the disk format by first replacing the current
  192. generic disk vector with an alternate set as shown in Listing 2. 
  193. Once this vector is in place, ADU calls the BIOS by using INT
  194. 13H.  The call to the BIOS's disk I/O routine is done with a
  195. generic set of parameters.  Thus, if the BIOS does not return an
  196. error then the set of parameters chosen is correct for the
  197. particular disk.  If, on the otherhand, the BIOS does return an
  198. error then the parameter you are trying to determine is adjusted. 
  199.  For example, the bytes/sector code would be continually varied
  200. from 00 to 05 on, say, track 0, sector 1 until a nil error is
  201. returned.  This obviously represents the bytes/sector. Once the
  202. number of bytes/sector is determined, it is a small matter to
  203. begin a sector 1 looking for the total number of sectors by
  204. incrementing the sector number performing a seek/verify until an
  205. error occurs.  This error would then represent the sector limit. 
  206. Next, look for a match on side 1 to determine the number of
  207. sides.  We're almost there:  all we need to know now is the
  208. number of tracks, set an upper limit and begin stepping out.  The
  209. number of sectors per block are user definable, as are all the
  210. other parameters, but defaults to 8 sectors per block.  The
  211. number of sectors/block is only important during the copying of
  212. CP/M type disks.  As with other parameters, the block size is
  213. able to be varied so if you don't want to work in blocks then
  214. just set sectors/block to one. 
  215.  
  216.  
  217.                                  
  218.                   
  219.                      
  220.                                                             
  221.      DB   11001111B ;SRT=C, HD UNLOAD=F                     
  222.      DB   2         ;HEAD LOAD=1,MODE=DMA                   
  223.      DB   37        ;WAIT AFTER OPERATION UNTIL             
  224.                     ;MOTOR TURNS OFF                        
  225.      DB   2         ;CODE FOR 512 BYTES/SECTOR              
  226.                     ;1=256,2=512,3=1024 ETC                 
  227.      DB   9         ;LAST SECTOR ON TRACK                   
  228.      DB   2AH       ;GPL IS GAP3 LENGTH FOR DATA            
  229.                     ;READ AND DETERMINES HOW LONG           
  230.                     ;VCO WILL 'IDLE'.  MUST BE              
  231.                     ;ADJUSTED.                              
  232.      DB   0FFH      ;DATA LENGTH, LEAVE AT 0FFH             
  233.      DB   50H       ;GAP3 LENGTH FOR FORMAT COMMAND         
  234.                     ;MUST BE ADJUSTED FOR SOME              
  235.                     ;DISK FORMATS.                          
  236.      DB   0F6H      ;FORMAT FILLER BYTE. CAN BE             
  237.                     ;ALTERED IF REQUIRED.                   
  238.      DB   25        ;HEAD SETTLING TIME (MILLI SECONDS)     
  239.      DB   4         ;MOTOR START TIME (1/8 SECONDS)         
  240.                                                             
  241. Table 1: Contents of the PC's DISK_BASE table.
  242.  
  243.                                                             
  244. Note:
  245.  
  246. The set of parameters contained in DISK_BASE are used by the
  247. BIOS for normal diskette operations. This paramater block is
  248. pointed to by the BIOS variable DISK_POINTER located at
  249. 0000:0078, which is equivalent to the address of interrupt
  250. 1EH. This pointer value can be redirected to point to a new
  251. set of parameters thus allowing the PC to access non DOS
  252. type formats. 
  253.            
  254.  
  255.   
  256. SEGMENT 0040:OFFSET   
  257.    
  258. OFFSET  LABEL            DESCRIPTION   
  259.    
  260. 003E    SEEK_STATUS      DRIVE RECALIBRATION STATUS   
  261.                          BITS 3-0 = DRIVE 3-0. DRIVE   
  262.                          NEEDS RECAL IF BIT = 0   
  263.    
  264. 003F    MOTOR_STATUS     MOTOR STATUS   
  265.                          BIT 3-0 = DRIVE 3-0 AND   
  266.                          INDICATES DRIVE IS   
  267.                          CURRENTLY RUNNING   
  268.    
  269. 0040    MOTOR_WAIT       COUNTER BEFORE DRIVE   
  270.                          TIME OUT. JAMMING A    
  271.                          LOWER VALUE THAN 37 WILL   
  272.                          REDUCE THE NORMAL WAIT TIME.   
  273.    
  274. 0041    DISKETTE_STATUS  BIOS RETURNS STATUS BYTE HERE   
  275.                          TIME_OUT       80H   
  276.                          BAD_SEEK       40H   
  277.                          BAD_CONTROLLER 20H   
  278.                          BAD_CRC        10H   
  279.                          DMA_BOUNDARY   09H   
  280.                          BAD_DMA        08H   
  281.                          SECTOR_NOT_FND 04H   
  282.                          WRITE_PROTECT  03H   
  283.                          BAD_ADDR_MARK  02H   
  284.                          BAD_CMD        01H   
  285.    
  286. 0042    CONTROLLER_STAT  AN AREA OF 7 BYTES IS RESERVED   
  287.                          FOR BIOS TO FILL WITH THE    
  288.                          CONTROLLER STATUS BYTES.  SEE   
  289.                          THE I8272 DATA SHEET FOR THE   
  290.                          VALUES RETURNED.   
  291.    
  292.    
  293. Table 2: Disk Status Bytes.   
  294.              
  295. Note:
  296.  
  297. The PC's BIOS maintains a set of status bytes in the PC's
  298. low memory area.  Data segment 0040  
  299. is used to store these and other variables.  The hardware
  300. disk analyser makes use of these bytes.  
  301.   
  302.   
  303.  
  304.  
  305.  
  306. ■───────────────────────────────────────────────────────────
  307. ──────────■
  308. Listing 1.  C structure to define the parameters
  309.           contained in the PC BIOS's DISK_BASE.    
  310.     
  311.     
  312. typedef struct {                       
  313.      unsigned char srt;            /* Step rate            
  314. */    
  315.      unsigned char hld;            /* Head load time       
  316. */    
  317.      unsigned char motor_wait;     /* Motor Wait time      
  318. */    
  319.      unsigned char bytes_sect;     /* Bytes/Sector code    
  320. */    
  321.      unsigned char eot;            /* Last sector          
  322. */    
  323.      unsigned char rw_gap;         /* Gap 3                
  324. */    
  325.      unsigned char dtl;            /* Data length norm 0xff
  326. */    
  327.      unsigned char format_gap;     /* Gap used in format   
  328. */    
  329.      unsigned char format_fill;    /* Format fill (f6h)    
  330. */    
  331.      unsigned char hs;             /* Head step period     
  332. */    
  333.      unsigned char motor_start;    /* Motor start time     
  334. */    
  335. } disk_base;                       /* disk_base template   
  336. */    
  337.     
  338. /*    
  339.      Declarations to user disk_base.    
  340. */    
  341.     
  342. disk_base  alien_base, dos_base;   /* disk base structures 
  343. */    
  344. disk_base  far *pc_disk_vector;    /* pointers to both the 
  345. */    
  346. disk_base  far *alien_disk_vector; /* standard and alien   
  347. */    
  348.                                    /* disk bases           
  349. */  
  350. ■───────────────────────────────────────────────────────────
  351. ───────────
  352.  
  353.  
  354.  
  355. ■───────────────────────────────────────────────────────────
  356. ──────────────■
  357.  
  358. Listing 2.  Typical calling technique to routines 
  359.           which setup alien disk_base by filling
  360.           disk_base with alternate parameters, and
  361.           then altering the disk_parameter pointer
  362.           to point to the new DISK_BASE. (See listing 3)
  363.   
  364.    
  365. pc_disk_vector = get_disk_vector(); /* save standard table 
  366. */   
  367. set_alien_parms();                  /* fill the alien      
  368. */   
  369.                                     /* disk_base with some 
  370. */   
  371.                                     /* initial values      
  372. */   
  373. set_disk_vector(alien_disk_vector); /* replace standard
  374. table */  
  375.                                     /* with alien table    
  376. */   
  377.  
  378.  
  379. ■───────────────────────────────────────────────────────────
  380. ─────────■
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388. ■───────────────────────────────────────────────────────────
  389. ───────────
  390.  
  391.  
  392. Listing 3.        Functions which are called by both ADU.C
  393.             and DE.C to modify the disk_base parameters
  394.             and to manipulate the disk_parameter
  395.             pointer to point to the modified disk_base.
  396.             See listing 2 for method of interfacing.  
  397.  
  398. /*
  399.       Get the current disk vector by asking DOS    
  400.    to fetch the interrupt vector from 0x1E.  The    
  401.    pointer is returned, and is saved by the calling    
  402.    module.
  403. */
  404.    
  405. disk_base far *get_disk_vector() {    
  406. struct SREGS segregs;    
  407. disk_base far *longptr;    
  408. unsigned long ls,lo;    
  409.     
  410.      inregs.h.ah = 0x35;           /* DOS function number */ 
  411.   
  412.      inregs.h.al = 0x1E;           /* Disk vector number */ 
  413.   
  414.      intdosx (&inregs,&outregs,&segregs);    
  415.      ls = (unsigned long)(segregs.es << 16);   
  416.      lo = (unsigned long)outregs.x.bx;    
  417.      longptr = (disk_base far *)(ls | lo);   /* convert to
  418. the */  
  419.   
  420.                                              /* correct type
  421. */    
  422.      return (longptr);    
  423. }    
  424. /*    
  425.      Replace current disk vector with the value    
  426.      pointed to by vectptr.  This routine is normally    
  427.      used to swap between the Alien and PC disk vectors.    
  428. */    
  429.     
  430. set_disk_vector(vectptr) disk_base far *vectptr; {    
  431. struct SREGS segregs;    
  432.     
  433.      inregs.h.ah = 0x25;    
  434.      inregs.h.al = 0x1E;    
  435.      inregs.x.dx = FP_OFF(vectptr);    
  436.      segregs.ds  = FP_SEG(vectptr);    
  437.      intdosx (&inregs,&outregs,&segregs);    
  438.      return outregs.x.ax;    
  439. }    
  440. /*    
  441.      Initialise all default variable settings.  Used    
  442.      during initial programme activation and during logs.   
  443.  
  444. */    
  445. set_alien_parms() {    
  446.     
  447. /* Standard DOS format   */    
  448.     
  449.      dos_base.srt = 0xcf;              
  450.      dos_base.hld = 2;    
  451.      dos_base.motor_wait = 25;    
  452.      dos_base.bytes_sect = 2;    
  453.      dos_base.eot = 8;    
  454.      dos_base.rw_gap = 0x2a;    
  455.      dos_base.dtl = 0xff;    
  456.      dos_base.format_gap = 0x50;    
  457.      dos_base.format_fill = 0xf6;    
  458.      dos_base.hs = 25;    
  459.      dos_base.motor_start = 4;    
  460.          
  461. /*    
  462.  Basic ALIEN disk data.  Most parameters are    
  463.  modified on the fly during the disk    
  464.  identification process.    
  465. */    
  466.     
  467.      alien_base.srt = 0xcf;    
  468.      alien_base.hld =  2;    
  469.      alien_base.motor_wait = 0x25;    
  470.      alien_base.dtl = 0xff;    
  471.      alien_base.format_fill = 0xf6;    
  472.      alien_base.hs = 25;    
  473.      alien_base.motor_start = 4;    
  474.   
  475. /* Gap tables can be obtained from 8272 data sheet */ 
  476.    
  477.      if (alien_base.eot <= 9) {         /* standard format
  478. */    
  479.           alien_base.rw_gap = 0x2a;    
  480.           alien_base.format_gap = 0x50;    
  481.      }                                  /* see 8272 data
  482. sheet */  
  483.   
  484.      else {                             /* for other
  485. formats*/    
  486.           alien_base.rw_gap = 0x02;    
  487.           alien_base.format_gap = 0x20;    
  488.      }     
  489. ■───────────────────────────────────────────────────────────
  490. ─────────■
  491.  
  492.  
  493.  
  494.      
  495. SECTION 2: COMMANDS
  496.             
  497. This section describeS each command including examples
  498. of each command. Apart from the disk commands, the
  499. function keys F1, F3 and F4 provide the following
  500. utility:
  501.  
  502.       F1 will give you help.      
  503.       F3 will re-issue the command without CR.     
  504.       F4 will re-issue the command with CR.     
  505.      
  506. All commands are either single or double letter. 
  507. Capital letters in the following sections indicate the
  508. number of significant  letters in the command. Commands
  509. may be separated by a semicolon.  For example, +S;R;E 
  510. will increment the sector, read it in, then go to edit
  511. mode. 
  512.  
  513.  
  514. 2.1  Dump 
  515.  
  516. Dump has no arguments and will dump the current buffer
  517. contents to the screen in both hex and ascii formats. 
  518. No editing facilities are provided within Dump, as this
  519. command is normally used when searching the disk for
  520. data sequences, etc.   To assist searching for
  521. particular text issue the command >>+s;r;d. Pressing F4
  522. will interrupt the dump and increment the sector.  Be
  523. aware that this command will not increment the sector
  524. past the last sector on the disk.       
  525.         
  526.      
  527. 2.2  Edit
  528.  
  529. The Edit command has no arguments, and will allow full
  530. screen editing of the current buffer's contents.  The
  531. following keys on the PC are supported in this mode:
  532.  
  533.       Left Arrow:             Move the cursor left
  534.       Right Arrow:            Move the cursor right
  535.       Up Arrow:         Move the cursor towards the top of
  536. the                                       buffer
  537.       Down Arrow:             Move the cursor towards the
  538. bottom of the                                   buffer
  539.       End:              Moves the cursor to the end of the
  540. buffer
  541.       Home:                   Move the cursor to the
  542. beginning of the                                            
  543. buffer
  544.       Esc:              Exits the Edit session WITHOUT
  545. saving to                                       disk
  546.       F5:               Writes buffers contents to disk
  547.       F6:               Reads disk sector to buffer for
  548. editing etc
  549.  
  550.  
  551. 2.3  Read a Sector
  552.  
  553. Read  [T] [S] [H]:
  554.  
  555. The Read command will read either the currently
  556. selected disk sector into memory, or the command line
  557. sector location.  If a command line option is used the
  558. default ADU Track, Sector and Head parameters are
  559. altered to the ones selected as part of the Read
  560. command.  Either decimal or hexadecimal numbers may be
  561. entered.  For example:
  562.  
  563.       Read 0x20 9 0     will read in sector 9, side 0 of
  564. track 32                                        into memory.
  565.       Read 21,3,1             will read in sector 3, side 1
  566. of track 21                                           into
  567. memory.
  568.  
  569. 2.4  Write a Sector
  570.  
  571. Write  [T] [S] [H]:
  572.  
  573. The Write command will write the current buffer
  574. contents to the currently selected disk sector.  If a
  575. command line option is used the default ADU Track,
  576. Sector and Head parameters are altered to the ones
  577. selected as part of the Write command.  Either decimal
  578. or hexadecimal numbers may be entered.  For example:
  579.  
  580.       Write 0x20 9 0    will read in sector 9, side 0 of
  581. track 32                                        into memory.
  582.       Write 21,3,1            will read in sector 3, side 1
  583. of track 21                                           into
  584. memory.
  585.  
  586.  
  587. 2.5  Increment or Decrement Sector or Track
  588.  
  589. +S,-S
  590.  
  591. This command will decrement or increment the current
  592. sector by unity.  If an attempt is made to increment or
  593. decrement outside the selected sector range an error
  594. message is generated.
  595.  
  596.  
  597. +T,-T
  598.  
  599. This command will decrement or increment the current
  600. track by unity.  If an attempt is made to increment or
  601. decrement outside the selected track range an error
  602. message is generated.
  603.  
  604.  
  605. 2.6  Set/Specify Current disk location
  606.  
  607. The set command allows a sector, track, or block to be
  608. selected without having to use either the increment or
  609. decrement command.  The set command is restricted to
  610. the allowable disk parameter limits.  
  611.  
  612. Set Block (SB):  Sb N
  613.       
  614. The set block command will set the current block number
  615. to N.  This has the effect of calculating the relevant
  616. track, side and sector number and setting the
  617. parameters accordingly.
  618.  
  619. Set Track (ST): ST N:
  620.  
  621. The set track command will set the current track number
  622. to N.
  623.  
  624. Set Sector (SS): SS N:
  625.  
  626. The set Sector command will set the current track
  627. number to N.
  628.  
  629. Set Head (SH):  SH N     
  630.      
  631. The set head command will set the current head number
  632. to N.
  633.  
  634.  
  635. 2.7  Vary disk parameter limits  
  636.  
  637. The Vary Parameter command allows a configuration of
  638. disk parameters to be selected which are outside of
  639. those which were detected by the disk utility as it
  640. logged the disk.  This is a useful command if it is
  641. considered the disk has an un-usual formatting scheme. 
  642. The vary command varies the internal ADU parameters
  643. whereas the Set command varies the current controller
  644. head position.  For example:
  645.  
  646.       VT 41             Vary number of tracks to 41
  647.       VO 2        Vary system offset to 2
  648.  
  649. Vary Block  VB N:
  650.  
  651. The Vary block command will vary the number of
  652. calculated blocks on the disk.  The default
  653. sectors/block is assumed to be 8.  If you do not wish
  654. to work in terms of blocks (used in C/PM) you may use
  655. VB to set the sectors/block to 1.
  656.  
  657. Vary Track  VT N:
  658.  
  659. The Vary Track command will vary the number of tracks
  660. on the disk from that which was calculated at log.  For
  661. example a 40 track drive can be set to 41 in order to
  662. look at the outer tracks.
  663.  
  664. Vary siZe  VZ N:
  665.  
  666. The Vary siZe command will vary the number of bytes per
  667. sector. For example to vary from the standard value of
  668. 512 bytes/sector, for example VZ 1024
  669. would set the number of bytes/sector to 1024.
  670.  
  671. Vary End of Track  VE N:
  672.  
  673. The Vary End of track command will vary the number of
  674. sectors/track on the disk.  For example if a DOS disk
  675. is scanned, and ADU has determined the disk has 9
  676. sectors/track VE 10, will allow you to look for higher
  677. numbered sectors on other tracks.
  678.  
  679. Vary Heads  VH N:
  680.  
  681. The Vary Heads command allows the number of heads to be
  682. altered.
  683.  
  684. Vary Drives  VD N:
  685.  
  686. This command allows the number of Drives in a system
  687. configuration to be varied from the current default
  688. which is two.  That is A and B.
  689.  
  690. Vary Offset  VO N:
  691.  
  692. The Vary Offset command allows the block offset to be
  693. varied.  The block offset is normally the beginning of
  694. the data on the disk, and is a way of jumping over the
  695. system area on the disk.  If this is not desirable then
  696. the VO 0 command would allow ADU to begin calculating
  697. blocks from track 0, sector 1, of side 0.  Also, for
  698. example if you wished to map the disk from a the
  699. perspective of the sectors of the disk then the command
  700. VO 0; VB 1 would allow ADU to map blocks to sectors. 
  701. Hence the number of blocks would be the number of
  702. sectors on the disk.  This would allow you to copy
  703. every sector of the disk into a DOS file.  
  704.  
  705. Taking the example one step further.  Assume you wished
  706. to copy the first sector of every track on side 0 to a
  707. DOS file called side0.doc, the following command
  708. sequence would be used:
  709.  
  710.       VO 0; VB 1; VE 1; VH 1; C C:side0.doc 0/39
  711.  
  712.  
  713. 2.8  Sector Translation and Format Skew
  714.  
  715. Some disk systems employ interleaving through either
  716. software or hardware in order to speed the response of
  717. the disk access.   This technique is essential in a
  718. matching of the CPU speed to the disk controller speed
  719. so that the minimum latency is obtained during disk
  720. accesses. 
  721.  
  722. ADU supports hardware skew when formatting a disk, so
  723. that if a disk needs to be copied which employs a
  724. hardware sector interleaving then it will be necessary
  725. to use the Format Skew (FS) command to vary the
  726. physical location of the sectors on the disk's track.              
  727.    
  728.  
  729. When reading a disk which has employed software skew
  730. then it follows that the data coming off the disk will
  731. not be in sequence, hence the Sector Translation (SX)
  732. command can be used to rearrange the sequence of
  733. sectors on being read off the disk.  This allows you to
  734. ensure the data being search or copied will be
  735. contiguous.
  736.  
  737. Format Skew  FS [n1,n2,n3.....]
  738.  
  739. This command allows the Format process to work
  740. correctly when carrying out a "disk copy" of an Alien
  741. Disk.  Once you have determined the skew the source
  742. disk has used, using the Sector Translate (SX) command
  743. then the FS command is used to key in the correct
  744. sector sequence, for example
  745.  
  746.       FS 1,3,5,7,9,2,4,6,8
  747.  
  748. programmes ADU with a sector interleaving of 2. 
  749.  
  750. The single command of FS will output the current skew
  751. table onto the status line.
  752.  
  753. Sector Translate SX [n1,n2,n3.....]
  754.  
  755. This command allows you to experiment with the Disk's
  756. sector translation in order to ensure that the data
  757. being read off the disk is contiguous.  This command
  758. provides an important tool when attempting to copy
  759. files off an alien disk to a DOS file or attempting to
  760. carry out a "Disk Copy".
  761.  
  762. If a text file exists on the alien disk of greater in
  763. length than one sector then it should be possible to
  764. vary the sector table until the text appears contiguous
  765. when using a command sequence such as +s;r;e.  If you
  766. wish to make a disk copy of the disk then the format
  767. skew (FS) may also have to be used.
  768.  
  769. The single command of SX will output the current
  770. translation table onto the status line.
  771.  
  772.  
  773.  
  774. 2.9  Disk Copy DC
  775.  
  776. The current implementation of Disk Copy assumes you
  777. will be copying from the A drive to the B drive and
  778. that furthermore both A and B drives have compatible
  779. hardware.  This disk copy process will begin by reading
  780. disk A on a cylinder per cylinder basis before
  781. formatting the B disk using the current disk and format
  782. skew tables.  After a successful cylinder format,
  783. diskcopy will then write the cylinder to the disk in
  784. drive B.
  785.  
  786. If the Disk Copy command appears to time out, then this
  787. could be due to the controller timing out due to an
  788. incorrect Format Skew.  Vary the format skew using the
  789. FS command.
  790.  
  791.  
  792. 2.10  Modify Disk Base Parameters  DB [p1,p2,p3....]
  793.  
  794. The Disk Base command allows the PC's disk base
  795. parameter Block to be modified independently of this
  796. programme's Log facility.  Thus if the disk scan is not
  797. successful for any reason, then the disk parameters may
  798. be adjusted or tunned to a particular disk.
  799.  
  800. The command DB without parameters will display the
  801. current contents of the table.  If there is any doubt
  802. about the purpose of these values, refer either to the
  803. IBM PC Technical Reference Manual, the Intel 8272 data
  804. sheet.  Table 1 gives a succinct summary of the purpose
  805. of the parameters. 
  806.  
  807. 2.11  Log Drive   L [N]
  808.  
  809. The log command allows a new disk to be analysed.  If
  810. no drive is specified then the existing drive is used. 
  811. The number of drives allows is variable using the Vary
  812. Drive command.  The default value is always two.
  813.  
  814.    
  815. 2.12  Copy Command  C N:fn Blocks Range
  816.  
  817. This command allows a range of blocks to be copied from
  818. the alien disk to a contiguous DOS file.  The block
  819. size is dependent on the user and can be set to one
  820. sector representing a block by using the command VB 1. 
  821. This is a very useful command if a file resides on an
  822. obscure formatted disk.  Determining the format is
  823. usually straight forward and coupled with this command
  824. allows the old file to be easily ported to the PC.  If
  825. you wish to copy individual sectors, rather than the
  826. number of sectors which make up a block, then set the
  827. block size to 1 sector/block using the VB 1 command.
  828.  
  829. For example to copy a file client.doc from an alien
  830. disk to a your a DOS disk in your B drive use the
  831. command:
  832.  
  833.             C B:client.doc 2,3,4,6/39.
  834.  
  835. This command sequence copies blocks 2,3,4 and 6 to 39
  836. inclusive from the alien disk to the B drive under the
  837. file name client.doc
  838.  
  839.    
  840. 2.13  Quit Command:  Q
  841.  
  842. The quit command restores all the PC's environment to
  843. that which existed prior to ADU being invoked and then
  844. exits ADU.
  845.  
  846.  
  847.  
  848.  
  849. SECTION 3: EXAMPLES
  850.  
  851.  
  852.  
  853. >>C c:junk.dat 2/32        ; copies blocks 2 to 32 from
  854. alien disk 
  855.                            ; into file junk.dat on
  856. drive C: 
  857.  
  858. >>R 32,2,0;E               ; reads data into buffer
  859. from track 32, 
  860.                            ; sector 2, side 0, and then
  861. enters edit mode 
  862. >>W                        ; ...after editing W will
  863. write back to disk 
  864.                            ; using the current
  865. Track,sector and side. 
  866.  
  867. >>+T;R;D                   ; Increment Track, read data
  868. into buffer and 
  869.                            ; then dump to screen. 
  870.  
  871. As a final example, suppose you want, for some reason,
  872. to copy only  sector 1 from each track on side 0 to a
  873. file on say drive C, for analysis, Then the following
  874. commands will allow you to do it: (note they could all
  875. be on one line!) 
  876.  
  877. >>Vb 1                     ; set sectors per block to 1
  878.  
  879. >>Ve 1                     ; set disk to 1 sector per
  880. track 
  881. >>Vh 1                     ; set disk to single sided
  882. ie one head 
  883. >>Vo 0                     ; set first block offset to
  884. track 0 
  885. >>C C:sects.1 0/39         ; copy blocks 0 to 39 to
  886. file sects.1 
  887.                            ; on drive C:               
  888.                     
  889.  
  890. >>Vz 1024                  ; vary sector size, useful
  891. for looking 
  892.                            ; at strange disks which are
  893. for example 
  894.                            ; copy protected. 
  895.  
  896.  
  897.