home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / cpm68k / syshacks.lbr / DECIO.DQC / DECIO.DOC
Encoding:
Text File  |  1986-05-22  |  6.6 KB  |  267 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                    CPMBIOS.S Patch For DEC Rainbow Disk I/O
  18.                    CPMBIOS.S Patch For DEC Rainbow Disk I/O
  19.                    CPMBIOS.S Patch For DEC Rainbow Disk I/O
  20.  
  21.  
  22.  
  23.  
  24.                                  Robert Heller
  25.                                  Robert Heller
  26.                                  Robert Heller
  27.  
  28.  
  29.                                Fri May 16, 1986
  30.                                Fri May 16, 1986
  31.                                Fri May 16, 1986
  32.  
  33.  
  34.  
  35.  
  36.                       (c) Copyright 1986 by Robert Heller
  37.                       (c) Copyright 1986 by Robert Heller
  38.                       (c) Copyright 1986 by Robert Heller
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.                             Chapter 1: Introduction
  97.  
  98.  
  99.  
  100.                I  wrote  this  patch  to provide a means to move files
  101.  
  102.  
  103.           between my Stride 440 and various  other  CP/M-68K  machines
  104.  
  105.  
  106.           in the  area.   In an adjacent office to where I work at the
  107.  
  108.  
  109.           University  of  Massachuttes,  there  is   a   DEC   Rainbow
  110.  
  111.  
  112.           connected  to  one  of  the  University's VAXes via a serial
  113.  
  114.  
  115.           line.  It is posible to reliably and quickly transfer  files
  116.  
  117.  
  118.           between  the  Rainbow and the VAX using Kermit at 9600 BAUD.
  119.  
  120.  
  121.           On one of our VAXes we have a pair of 8" floppy drives.   We
  122.  
  123.  
  124.           have  a  program  that  will  read  and  write single-sided,
  125.  
  126.  
  127.           single-density 8" CP/M format floppies.  The other  CP/M-68K
  128.  
  129.  
  130.           systems  in  the  area have 8" drives and can read and write
  131.  
  132.  
  133.           this format.  Since the DEC Rainbow uses  96TPI  drives  and
  134.  
  135.  
  136.           run  CP/M-80/86,  it  seemed  like it should be easy to move
  137.  
  138.  
  139.           files between my Stride and the Rainbow.  After  doing  some
  140.  
  141.  
  142.           "nibble"  analysis of a disk formatted and written to by the
  143.  
  144.  
  145.           Rainbow,  I  discovered  that  the   Rainbow   uses   sector
  146.  
  147.  
  148.           skewing.   It  was then merely a matter of modifing Stride's
  149.  
  150.  
  151.           CPMBIOS.S file to provide a  sector  translate  table,  when
  152.  
  153.  
  154.           using Rainbow disks.
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                             Chapter 2: The Patches
  207.  
  208.  
  209.  
  210.                I  wanted  to make the fix transparent and unobtrusive.
  211.  
  212.  
  213.           I also didn't want  to  have  multiple  version  of  CPM.SYS
  214.  
  215.  
  216.           eating up  disk space.  Since the RX50 drives on the Rainbow
  217.  
  218.  
  219.           are single-sided and the Rainbow uses a 10-sector format,  I
  220.  
  221.  
  222.           set  the  patch  to  conditionally (at startup time) include
  223.  
  224.  
  225.           the  sector  translate  table,  based   on   the   low-level
  226.  
  227.  
  228.           configuration of  the  drive.  That way I could setup one or
  229.  
  230.  
  231.           the other floppy drive as a Rainbow format drive  with  UTIL
  232.  
  233.  
  234.           (or  MU.UTIL)  by  simply  setting  up  the  drive  as  a 10
  235.  
  236.  
  237.           sectored single sided drive with a skew for format of 2.
  238.  
  239.  
  240.  
  241.           2.1 The Executable Part Of The Patch
  242.  
  243.  
  244.  
  245.                This patch  goes  in  the  _init  routine  at  the  q22
  246.                                           _init                    q22
  247.                                           _init                    q22
  248.  
  249.  
  250.           label.
  251.  
  252.  
  253.  
  254. ***
  255.  
  256.  
  257. * RPH:  do DEC Rainbow hack
  258.  
  259.  
  260. *
  261.  
  262.  
  263. * first check for floppy disk (only mess with floppies!)
  264.  
  265.  
  266. *
  267.  
  268.  
  269. q22:
  270.  
  271.  
  272.         cmp.b   #4,devnum       * left floppy?
  273.  
  274.  
  275.         beq     RPH1            * br if so
  276.  
  277.  
  278.         cmp.b   #5,devnum       * right floppy?
  279.  
  280.  
  281.         bne     RPH99           * br if not
  282.  
  283.  
  284. *
  285.  
  286.  
  287. * now check sectors/track and # tracks
  288.  
  289.  
  290. *
  291.  
  292.  
  293. RPH1:
  294.  
  295.  
  296.         cmp.w   #40,spt(a5)     * 40 sectors/track?
  297.  
  298.  
  299.         bne     RPH99           * br if not
  300.  
  301.  
  302.         cmp.w   #80,dsktrk+intdef * 80 tracks?
  303.  
  304.  
  305.         bne     RPH99           * br if not
  306.  
  307.  
  308. *
  309.  
  310.  
  311. * now get disk conf info to check skew factor
  312.  
  313.  
  314. *
  315.  
  316.  
  317.         movem.l d0/a0,-(A7)     * save registers (just in case)
  318.  
  319.  
  320.         lea     rphfcnf,a0      * get floppy conf. argblock
  321.  
  322.  
  323.         move.w  dskchan(A6),rphfcnf+14 * stash logical channel # in
  324.  
  325.  
  326. *                                 req. packet.
  327.  
  328.  
  329.         moveq   #readch,D0      * read chan conf
  330.  
  331.  
  332.         trap    #biosl          * hit it
  333.  
  334.  
  335. *
  336.  
  337.  
  338. * check skew factor
  339.  
  340.  
  341. *
  342.  
  343.  
  344.         cmp.b   #2,rphfcon+4    * skew = 2?
  345.  
  346.  
  347.         bne     RPH88           * br if not
  348.  
  349.  
  350. * skew == 2, blast in translate table for DEC Rainbow CP/M-86/80 disks
  351.  
  352.  
  353.         lea     DECxlat,a0      * compute address
  354.  
  355.  
  356.         move.l  a0,xlt(A4)      * setup xlt table
  357.  
  358.  
  359. * done. clean up, etc.
  360.  
  361.  
  362. RPH88:
  363.  
  364.  
  365.         movem.l (A7)+,d0/a0     * restore registers
  366.  
  367.  
  368.  
  369. *
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384. *       The following code determines the size of the disk allocation
  385.  
  386.  
  387. *       vector, in bytes.  This is based on the number of blocks on the disk.
  388.  
  389.  
  390. *       One bit per block in the allocation vector is allocated.
  391.  
  392.  
  393. *
  394.  
  395.  
  396. *       The '16+1' factor added below is to make sure that if the last word
  397.  
  398.  
  399. *       of the allocation vector is only partially used, it is actually
  400.  
  401.  
  402. *       allocated.
  403.  
  404.  
  405. *
  406.  
  407.  
  408. RPH99:
  409.  
  410.  
  411.  
  412.  
  413.           2.2 The Non-Executable Part Of The Patch
  414.  
  415.  
  416.  
  417.                The  non-executable  part  of the patch consists of the
  418.  
  419.  
  420.           translate table and the  configuration  request  packet  and
  421.  
  422.  
  423.           buffer.
  424.  
  425.  
  426.  
  427.                This goes into the .data segment:
  428.                                   .data
  429.                                   .data
  430.  
  431.  
  432.  
  433. rphfcnf:
  434.  
  435.  
  436.         .dc.w   128             ; config chan
  437.  
  438.  
  439.         .dc.w   0               ; error word
  440.  
  441.  
  442.         .dc.l   32              ; size in bytes
  443.  
  444.  
  445.         .dc.l   rphfcon         ; conf block
  446.  
  447.  
  448.         .dc.w   0               ; logical block number
  449.  
  450.  
  451.         .dc.w   0               ; control word (filled in later)
  452.  
  453.  
  454.         .even
  455.  
  456.  
  457. DECxlat:
  458.  
  459.  
  460.         .dc.b    0, 1, 2, 3     * first phy sector
  461.  
  462.  
  463.         .dc.b    8, 9,10,11     * third phy sector
  464.  
  465.  
  466.         .dc.b   16,17,18,19     * fifth phy sector
  467.  
  468.  
  469.         .dc.b   24,25,26,27     * seventh phy sector
  470.  
  471.  
  472.         .dc.b   32,33,34,35     * ninth phy sector
  473.  
  474.  
  475.         .dc.b    4, 5, 6, 7     * second phy sector
  476.  
  477.  
  478.         .dc.b   12,13,14,15     * fourth phy sector
  479.  
  480.  
  481.         .dc.b   20,21,22,23     * sixth phy sector
  482.  
  483.  
  484.         .dc.b   28,29,30,31     * eigth phy sector
  485.  
  486.  
  487.         .dc.b   36,37,38,39     * tenth phy sector
  488.  
  489.  
  490.  
  491.  
  492.                And this goes into the .bss segment:
  493.                                       .bss
  494.                                       .bss
  495.  
  496.  
  497.  
  498. * space for disk conf. info
  499.  
  500.  
  501. rphfcon:
  502.  
  503.  
  504.         .ds.b   32
  505.  
  506.  
  507.  
  508.  
  509.  
  510.  
  511.  
  512.  
  513.  
  514.  
  515.  
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                 .bss
  527.  
  528.  
  529.  
  530. * space for disk conf. in