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