home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / JSAGE / ZSUS / TCJ / TCJ40TP.WS < prev    next >
Text File  |  2000-06-30  |  17KB  |  361 lines

  1.  
  2. [Note from Jay Sage:  When I met Terry Pinto in Portland in May, he told me 
  3. about the technique he had developed to overcome the 88 Mbyte limit on the 
  4. Ampro Little Board he uses to run his remote access computer system.  My 
  5. immediate response was, "Please write it up for TCJ!"  And here it is.]
  6.  
  7.  
  8.                                 86 YOUR 88!
  9.                 Discard the 88Mb limit on your Ampro LB Z80
  10.  
  11.                                by Terry Pinto
  12.                         The Computer Journal, Issue 40
  13.                           Reproduced with permission
  14.                            of author and publisher
  15.  
  16.  
  17.  
  18.      That old saying that "Necessity Is The Mother Of Invention" certainly 
  19. holds true.  After purchasing my Ampro, I noticed that I was limited to a 
  20. maximum of 88Mb of hard disk space.  My feelings then were, WHO CARES!  How 
  21. could I ever fill that much space!  I found a good price on a Priam V150 
  22. 60Mb RLL certified hard disk and added it to the system.  Well, you guessed 
  23. it.  It certainly didn't take long to fill up the disk.  I run a BBS, 
  24. Access Programming RAS, and my users were slowly eating away any free disk 
  25. space I had.  The time had come to enlarge the system.  The problem was 
  26. that I couldn't justify the expense of expanding to an 88Mb drive just to 
  27. gain the additional space, and the extra 20Mb was a small addition that 
  28. would disappear rapidly.  The only solution was to engineer a way to 
  29. utilize the fact that the Adaptec 4070 controller I used could support two 
  30. hard disk drives.  I purchased a copy of the source code to the Ampro BIOS 
  31. and set to work writing HDS v1.00 (Hard Disk Select).
  32.  
  33.      Before explaining how HDS works, a brief description of Ampro's drive 
  34. table is in order.  This table contains the information necessary to relate 
  35. the logical drives to the physical drives on the system and to select the 
  36. driver routine needed for each logical drive.  The table is arranged in 16 
  37. groups of 4 bytes each for logical drives A-P.  The information in byte 2 
  38. is used to select the physical drive on the controller (see Tables 1 and 
  39. 4).  Setting bits 7, 6, and 5 to a value of 000 will select physical drive 
  40. 0 on the controller while a value of 001 will select physical drive 1.
  41.  
  42.      Provided that both drives are physically compatible (for example, the 
  43. same make and model) and are partitioned identically, simply changing bit 5 
  44. in byte 2 from 0 to 1 for a given logical drive (partition) will cause the 
  45. system to access (read/write) the drive set up as SCSI drive 1 in place of 
  46. the drive set up as SCSI drive 0.  As you can see, the fact that both 
  47. drives are partitioned the same is VERY IMPORTANT!  The only thing I 
  48. attempt to do with HDS is to tell the controller to use the other hard 
  49. disk.  HDS gives you double the disk space without the loss of any 
  50. additional TPA.
  51.  
  52. ----------------------------------------------------------------------è
  53. Drive A   01 00 C6 00    Floppy Drives A-D
  54. Drive B   01 11 C6 00    
  55. Drive C   01 22 86 00    
  56. Drive D   01 33 86 00    
  57. Drive E   02 44 00 FF    Foreign Format Drive E
  58. Drive F   03 50 0A 01    Hard Disk Drives F-P
  59. Drive G   03 60 0A 01    
  60. Drive H   03 70 0A 01
  61. Drive I   03 80 0A 01
  62.            |  |  |  |
  63.            |  |  |  +--- SCSI Address
  64.            |  |  +------ Drive Type Identifier
  65.            |  +--------- Physical Offset and Drive Unit Number
  66.            +------------ Disk Drive ID  0 = Not Installed
  67.  
  68. Table 1.  Physical Driver Table
  69.  
  70. ----------------------------------------------------------------------
  71.  
  72.           00 = Reserved for errors
  73.           01 = Floppy Drive
  74.           02 = Foreign Format Drive
  75.           03 = Hard Disk Drive
  76.           04 = Currently Undefined
  77.           05 = Currently Undefined
  78.           06 = Currently Undefined
  79.           07 = RAM Disk (N/Systems)
  80.  
  81. Table 2.  Values of the Disk Driver ID (byte 0)
  82.  
  83. ----------------------------------------------------------------------
  84.           
  85.           Bits 7654 Offset to base 0-F
  86.  
  87.           Bits 3210 Physical device address to be passed to the 
  88.                     respective driver.
  89.                
  90.                     (For floppies, this is the drive unit#.  For 
  91.                     hard disks, these are reserved.)
  92.  
  93. Table 3.  Physical offset from start of disk parameter headers
  94.           and the drive unit number (byte 1).
  95.  
  96. ----------------------------------------------------------------------
  97.      Floppy Usage:
  98.                Bit: 76543210
  99.      Density        X         0=Single 1=Double
  100.      Sides           X        0=Single 1=Double
  101.      Sector#'s        X       0=Same 1=Contiguous
  102.      Track Cnt         X      0=Down 1=Down Front - Up Back
  103.      Alloc Unit         XX    00=1k  01=2k  10=4k  11=8kè     Sector Size          XX  00=128 01=256 10=512 11=1024
  104.  
  105.      Hard Disk Usage:
  106.                Bit: 76543210
  107.      LUN            XXX       Logical unit number (0-7)
  108.      Reserved          X
  109.      Alloc Unit         XX    00=1k  01=2k  10=4k  11=8k
  110.      Sector Size          XX  00=128 01=256 10=512 11=1024
  111.  
  112. Table 4.  Drive Type Identifier (byte 2).
  113.  
  114. ----------------------------------------------------------------------
  115.  
  116.                Bit: 76543210
  117.      SCSI address 0        X  This  is  the  actual  bit  pattern 
  118.      SCSI address 1       X   supplied  during  the  SCSI  select 
  119.      SCSI address 2      X    routine.   No   internal    address 
  120.      SCSI address 3     X     translation or bit scaling is done.
  121.      SCSI address 4    X        
  122.      SCSI address 5   X         
  123.      SCSI address 6  X          
  124.      SCSI address 7 X           
  125.  
  126. Table 5. SCSI bus address for hard disks (byte 3).
  127.  
  128. ----------------------------------------------------------------------
  129.  
  130.                               Hard Disk Select
  131.  
  132.      The Ampro BIOS can be set up to accommodate hard disk space up to 
  133. 88Mb. This is due to the fact that a CP/M system can address sixteen 
  134. drives, A-P, of up to a maximum of 8Mb of space each.  Ampro defines drives 
  135. A-D as floppy drives and drive E as the foreign format floppy.  These 
  136. allocations are predefined and cannot be changed, although by using the 
  137. SWAP utility they can be moved around.  For the purposes of this article, 
  138. we will assume that the original drive mapping is intact and that you have 
  139. not used SWAP to redefine the drive parameter tables.  In fact, the use of 
  140. SWAP is not restricted, and you may feel free to swap your drives at will 
  141. either before or after running HDS.
  142.  
  143.      With five drives being predefined, this leaves us eleven drives of 8Mb 
  144. each, which gives us 88Mb of space.  This will leave a TPA of about 56k.  
  145. If you have elected to size your system to allow 88Mb of space, you may use 
  146. HDS to 'mount' any eleven drives available to the system.  What this means 
  147. is that although you may have 22 logical drives attached to the system, you 
  148. may only define eleven of them as currently active.  This action is 
  149. referred to as 'mounting' the drive.  HDS will allow you to select any 
  150. eleven drives available and make them active on the system.  You may select 
  151. an individual logical drive, a group of logical drives, or an entire 
  152. physical drive.  HDS will accept options passed on the command line 
  153. describing what actions you want to take.
  154. èSyntax:  HDS [n|d]  (one option allowed - global select has priority)
  155.               n=logical drive number (global select)
  156.               d=list of drives to select
  157.  
  158.      When HDS selects a drive from the appropriate hard disk, it toggles
  159. the selection. To reset the drive, you must either reselect the drive, or
  160. do a global select to drive 0. You should either select a global option
  161. or a set of individual drives. If both options are specified, the global
  162. select will occur.
  163.  
  164. Examples:  HDS fghi  selects drives F,G,H and I from HD 1
  165.            HDS bij   (the drives do not need to be consecutive)
  166.            HDS c     selects drive C from HD 1
  167.            HDS 0     global select to HD 0 (reset).
  168.            HDS       shows map of system
  169.  
  170.      In the first example above, HDS will attach drives F,G,H and I from 
  171. logical drive 1 to the system replacing their counterparts on drive 0. The 
  172. drives do not have to be contiguous, as the second example shows. In this 
  173. example, drives B, I, and J are attached, replacing their counterparts on 
  174. drive 0.  In the third example, just drive C is exchanged.  In the fourth 
  175. example, a global select is issued to select all drives on logical hard 
  176. disk 0.  This can be used as a quick method of reseting the system. The 
  177. last example, HDS is run without a command line argument. This causes the
  178. system to display a map of the available drives on the system and how they
  179. are selected.
  180.  
  181.      HDS will monitor both the QUIET flag and the WHEEL byte in order to 
  182. control the display features and to provide system security.  The use of 
  183. the global select function requires that the wheel byte be set, if selected 
  184. during assembly. If the wheel byte is not set, the user is given an illegal 
  185. function error and control is returned to the operating system.  To give 
  186. you a higher level of security, I have provided a bitmap of the drives on 
  187. the system. Setting any of the drives in this bitmap will secure the drive 
  188. and will require that the wheel byte be set to mount that drive.
  189.  
  190.                          ABCDEFGH IJKLMNOP
  191. Example:  DRVMAP:   DB   01000000 00000000b
  192.  
  193.      In the example above, drive B has been set as secure.  This means that 
  194. if the wheel byte is not set, the user could not issue a command of 'HDS 
  195. B'. Attempting it would generate the illegal function error and return the 
  196. user to the operating system.
  197.  
  198.      For use on a remote access system, I've tied the display functions of 
  199. HDS to the QUIET flag.  When the quiet flag is on, no screen output is 
  200. generated during the selection of drives.  This will enable you to include 
  201. HDS in an alias and have it totally transparent to the user.  With the 
  202. QUIET flag off, a signon message will appear each time you run HDS.  The 
  203. same is true for the display function of HDS.  If you call HDS without a 
  204. command line option, it will give you a map of what drives are selected and 
  205. from which physical drive.  Table 6 shows an example of a typical run of èHDS.
  206. ----------------------------------------------------------------------
  207.  
  208. A0:BASE>HDS
  209. Hard Disk Select v1.03 (c) 05/17/89
  210. Written by Terry Pinto
  211. ZCPR v33   ZRDOS v19   Ampro BIOS v38   PHYTAB D072H
  212. (Type 3 - Loaded at 8000H)
  213. Selected Drives
  214.  
  215. A - Floppy Drive
  216. B - Floppy Drive
  217. C - Floppy Drive (not installed)
  218. D - Floppy Drive (not installed)
  219. E - Foreign Format Drive
  220. F - Drive 0
  221. G - Drive 0
  222. H - Drive 0
  223. I - Drive 0
  224. J - Drive 0
  225. K - Drive 0
  226. L - Drive 0
  227. M - Drive 0
  228. N - RAM Disk
  229. O - Does Not Exist
  230. P - Does Not Exist
  231.  
  232. Table 6.  Example of screen display after running HDS.
  233.  
  234. ----------------------------------------------------------------------
  235.  
  236.      You can see from the output that HDS reads the parameter table to 
  237. determine if a drive is on the system and, if so, what kind of drive it is.  
  238. Notice that all four floppy drives are always defined by Ampro but that on 
  239. this system drives C and D are 'not installed'.  The foreign format floppy 
  240. is drive E and is used for the reading/writing of disks formatted for other 
  241. systems.  The display shows that hard disk drives F-M are defined and are 
  242. currently the drives residing on the hard disk defined on your system as 
  243. being physical drive 0.  Drive N is defined as a RAM Disk (N/Systems) and 
  244. drives O and P do not exist on the system.
  245.  
  246.      If you select drives FGH and I, you get the output shown in Table 7. 
  247. Notice that the drive identifier for drives F,G,H and I now show that these 
  248. drives are currently attached from the hard disk defined on your system as 
  249. physical drive 1.
  250.  
  251. ----------------------------------------------------------------------
  252.  
  253. A0:BASE>HDS FGHI
  254. Hard Disk Select v1.03 (c) 05/17/89
  255. Written by Terry Pinto
  256. ZCPR v33   ZRDOS v19   Ampro BIOS v38   PHYTAB D072Hè(Type 3 - Loaded at 8000H)
  257. Selected Drives
  258.  
  259. A - Floppy Drive
  260. B - Floppy Drive
  261. C - Floppy Drive (not installed)
  262. D - Floppy Drive (not installed)
  263. E - Foreign Format Drive
  264. F - Drive 1
  265. G - Drive 1
  266. H - Drive 1
  267. I - Drive 1
  268. J - Drive 0
  269. K - Drive 0
  270. L - Drive 0
  271. M - Drive 0
  272. N - RAM Disk
  273. O - Does Not Exist
  274. P - Does Not Exist
  275.  
  276. Table 7.  Example of screen display after running HDS a second time.
  277.  
  278. ----------------------------------------------------------------------
  279.  
  280.      After the selection of the requested drives, it is necessary for HDS 
  281. to perform a disk reset to log in the newly defined drives.  To accomplish 
  282. this, HDS must know what type of DOS you are using.  A check is done to 
  283. determine if you are running vanilla CP/M 2.2, ZRDOS, or ZSDOS.  In either 
  284. case, an appropriate disk reset is called upon to log in the new drives. 
  285. During the check process, HDS also determines if you are running a vanilla 
  286. CP/M or a ZCPR3 system and gets the version number.  This is necessary to 
  287. enable HDS to find the physical tables in your BIOS.  The type of system 
  288. you are running will be displayed during the signon if the QUIET flag is 
  289. off. For now, HDS only detects Z33, Z34, and CP/M operating systems.  
  290. Future versions may include detection of CP/M plus.  
  291.  
  292. Online examples from Access Programming...
  293.  
  294.      To enable an easier way for the remote user to use HDS, I've placed
  295. the following alias' in my ALIAS.CMD file. (The case switching symbols
  296. have been eliminated to make the alias a little easier to read).
  297.  
  298. HDSEL echo;The Following Hard Disk Selections are Available;echo;echo
  299.       AMPRO;echo;MSDOS;echo;ZCPR;echo;SYSTEM;if wh;echo;EXTEND;fi;echo
  300. AMPRO  echo;Loading AMPRO Drivers - Please Wait...;hds 0;hds c
  301. MSDOS  echo;Loading MSDOS Drivers - Please Wait...;hds 0;hds dfghi
  302. ZCPR   echo;Loading ZCPR Drivers - Please Wait...;hds 0
  303. SYSTEM echo;Loading SYSTEM Drivers - Please Wait...;hds 0
  304. EXTEND echo;Loading EXTENDED Drivers - Please Wait...;hds 1
  305.  
  306. The HDSEL command will display the following selections:
  307. èA0:RCPM>HDSEL
  308.  
  309. The Following Hard Disk Selections are Available
  310.  
  311. AMPRO
  312. MSDOS
  313. ZCPR
  314. SYSTEM
  315. EXTEND
  316.  
  317. A0:RCPM>
  318.  
  319. This give my users an online guide to what is available. Running AMPRO
  320. will attatch drive C from HD 1. This is where all the Ampro specific
  321. file are located on my system. MSDOS will load drives D, F, G, H and I
  322. from HD 1 and allow the users to access the MSDOS programs stored there.
  323. ZCPR and SYSTEM actually perform the same function for now. ZCPR will
  324. grant access to the ZCPR specific files on HD 0. The SYSTEM command will
  325. serve as a system reset. I've made BYE an alias on my system allowing me
  326. to include the command 'HDS 0' in the signoff module. This effectively 
  327. resets my system for the next caller. This allows me to maintain a 
  328. default status so that each new caller will enter the operating system
  329. with the same drives attatched. The EXTEND command selects all drives 
  330. from HD 1 to the system. Much of my commercial software is kept here so
  331. I've set HDS to require that the wheel byte be set to do a global select
  332. to drive 1. I've also set up drive B as a secure drive. This is done by
  333. setting the corresponding bit in the drive bitmap to 1. If HDS detects
  334. the security bit on any drive passed on the command line, access will be
  335. denied.
  336.  
  337.                             ACKNOWLEDGEMENTS
  338.  
  339.      Many hours of research have gone into the development of HDS. Release
  340. of this software would not have been possible without the information that
  341. was obtained from the source code of version 3.8 of the Ampro BIOS. Much 
  342. of the information describing the bit selections necessary for HDS were 
  343. quoted directly from the source code listing.
  344.  
  345. If you would like a copy of HDS or have any questions about the software
  346. or its operation, please contact:
  347.  
  348. Terry Pinto
  349. Access Programming RAS
  350. 14385 SW Walker Rd. B3
  351. Beaverton, OR  97006
  352.  
  353. (503) 646-4937  6:00pm-10:00pm PST
  354. (503) 644-0900  300/1200/2400 8N1
  355. PCP ORPOR  StarLink 9164/222 (local exchange)
  356.  
  357. [This article was originally published in issue 40 of The Computer Journal,
  358. P.O. Box 12, South Plainfield, NJ 07080-0012 and is reproduced with theèpermission of the author and the publisher. Further reproduction for non-
  359. commercial purposes is authorized. This copyright notice must be retained.
  360. (c) Copyright 1989, 1991 Socrates Press and respective authors]
  361.