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 / SIMTEL / CPMUG / CPMUG082.ARK / NSBIOS.DOC < prev    next >
Text File  |  1984-04-29  |  16KB  |  250 lines

  1.  
  2.  
  3.            ***  North Star BIOS and Support Programs  ***
  4.  
  5. ***
  6. *** These routines copyright (c) 1980, 1981, 1982 by Steve Bogolub,
  7. *** 2338 S. Scoville Ave., Berwyn, IL 60402.  Jade Double D (tm)
  8. *** disk handlers contributed to the public domain for use on Jade
  9. *** equipment by special permission of Jade Computer Products.
  10. *** This software may be used freely for non-commercial purposes
  11. *** only, and may not be sold.
  12. ***
  13.  
  14.   In response to the lack of source routines available in the public domain for
  15. driving the North Star floppy disk controllers, a full set of routines for
  16. supporting these controllers under CP/M 2.2 (tm) was developed.  The original 
  17. intent was to allow convenient modification of the driver software when 
  18. non-standard drives or additional controllers were desired under the control 
  19. of a single CP/M 2.2 system.  The resulting routines fulfill these goals, and 
  20. at the same time provide format compatibility with the industry-standard 
  21. Lifeboat Associates double density and single density single-sided North Star 
  22. CP/M versions 1.4 and 2.2.
  23.  
  24.   The author's system includes a North Star MDS-A double density controller
  25. with two Shugart Associates SA-400 double density, single-sided disk drives,
  26. packaged in a standard North Star Horizon (tm) computer.  Additional hardware
  27. includes a Jade Double D (tm) double density disk controller with two Shugart
  28. Associates SA-800R double density, single-sided disk drives.  The primary
  29. serial I/O devices are provided by a QT IO+ (tm) board, with two serial Intel
  30. 8251-type devices and programmable baud rates, among other features.  The
  31. primary list device is a Teletype (tm) Model 40 printer, driven through the
  32. Horizon right serial port with the Model 40 simplified EIA interface (minimal
  33. handshake lines).  A total of 64K of static RAM memory is in the machine, of
  34. which 56K is utilized directly by CP/M 2.2, 4K is overlapped (and thus
  35. unavailable) by the two controllers and the boot PROM, and 4K is reserved in
  36. the address space above the controllers for special-purpose programs.  Every
  37. effort has been made to maintain compatibility with a standard Horizon
  38. configuration.    Therefore, while the author's system is fully supported, a
  39. system disk generated by these routines will boot up unmodified on a standard
  40. Horizon with a minimum of 56K of memory, double density controller, and at
  41. least one SA-400 disk drive or equivalent.
  42.  
  43.   The routines required to support CP/M 2.2 on a North Star controller include
  44. a BIOS module for CP/M 2.2, a system generation utility for writing out the
  45. system to the system tracks of a North Star diskette, and a format utility for
  46. initializing a diskette in the CP/M format.  Each of these routines is included
  47. in a separate module in the author's system.  All three modules are coded using
  48. the Intel 8080 assembler mnemonics and source format compatible with the
  49. assembler program ASM, which is provided as a standard utility with all copies 
  50. of Digital Research CP/M 2.2.  With one exception, all 8080-compatible code is 
  51. used.  The Z-80 (tm) "LD A,I" instruction is used on entry to the disk driver 
  52. routines in BIOS to determine the state of the Z-80 CPU interrupt enable 
  53. flip-flop for the purpose of saving and restoring it.  All other code in the 
  54. North Star routines is 8080-compatible, and even the single Z-80 instruction 
  55. should execute harmlessly on an 8080.
  56.  
  57.   The three primary source modules of the author's system are listed below:
  58.  
  59. (1) NBIOSxx.ASM     This is the BIOS module.  It supports both the North
  60.             Star and the Jade controllers, with the North Star
  61. drives being A: and B:, and the Jade drives being C: and D:.  The Jade Double D
  62. is a soft-loaded buffered controller containing its own resident Z-80.    The 1K
  63. of control code is stored on the North Star system tracks, and loaded out into
  64. the Jade Double D memory on a cold boot.  This BIOS provides the ability to
  65. read and write Lifeboat-compatible single and double density, single-sided
  66. 5 1/4" diskettes, as well as industry-standard IBM 3740-compatible single
  67. density, single-sided 8" diskettes, Altos double density Mode 2 8" format,
  68. Morrow Designs Disk Jockey (tm) 2D 1024 bytes/sector double density,
  69. single-sided 8" diskettes, and all standard Jade Double D formats for
  70. single-sided or double-sided 8" drives.  Due to the large amount of code 
  71. required to drive the North Star double density controller, NBIOSxx requires 
  72. an additional 2K of space beyond the 1.5K allocated in a standard Digital 
  73. Research CP/M 2.2 single density 8" system.  This compares favorably with 
  74. the memory requirements of the Lifeboat CP/M 2.2, which requires only 256 
  75. bytes less space.  Furthur documentation is provided within the source module.
  76.  
  77.   Due to the excellent design of the North Star double density controller,
  78. NBIOSxx is booted directly into its normal position in memory by the controller
  79. boot routine, using a small cold boot section in NBIOSxx itself to read the
  80. balance of the code into memory.  This scheme avoids the need for the separate
  81. "track zero" boot module required by most other controllers, including the
  82. North Star single density controller.
  83.  
  84. (2) NSGEN.ASM        This is the system generation utility.    It is used to
  85.             read or write the system area of a 5 1/4" diskette in a
  86. format compatible with NBIOSxx, and transfers from or to the TPA the CP/M CCP
  87. and BDOS modules, along with NBIOSxx and the Jade Double D control code.  The
  88. format of the system tracks is described furthur in this source module, and is
  89. intimately connected with corresponding code in NBIOSxx.  Only standard CP/M
  90. 2.2 BDOS and BIOS calls are used, allowing bootstrap operation under the 
  91. normal Lifeboat CP/M 2.2 operating system.
  92.  
  93. (3) NSCOPY.ASM        This utility provides the format function.  It will
  94.             standardly format 35-track single-sided drives in
  95. single or double density formats that are Lifeboat-compatible.    In addition,
  96. NSCOPY will standardly validate all formats by reading each track, format
  97. 80-track double-sided drives in double density, copy all tracks, the system
  98. tracks only, or the data tracks only from one 35-track drive to another, warm
  99. boot the CP/M 2.2 system, or cold boot the North Star controller.  In addition,
  100. NSCOPY can be modified with a one-byte configuration patch to support 40-track
  101. drives instead of 35-track, and provide all the same features.    NSCOPY contains
  102. its own dedicated North Star controller driver routines, and will utilize all
  103. contiguous memory up to the base of CP/M 2.2 BIOS, resulting in highly
  104. efficient and speedy operation noticeably faster than other North Star copy
  105. utilities.  Normal CP/M 2.2 BIOS calls are used for console I/O, allowing this
  106. program to run under the normal Lifeboat CP/M 2.2 operating system if desired.
  107.  
  108.  
  109.   The above modules provide everything needed along with a standard Digital
  110. Research or Lifeboat CP/M 2.2 to run.  Bootstrapping is obviously easier if a
  111. Lifeboat CP/M 2.2 is available, although the author was able to bootstrap the
  112. system using the standard North Star DOS, and Cromemco CDOS, along with a
  113. standard 8" release disk purchased directly from Digital Research.  This method
  114. of bootstrapping was not exceedingly difficult, but was certainly much harder
  115. than bootstrapping from an existing North Star CP/M 2.2 system.  Needless to
  116. say, in any case, an extensive knowledge of CP/M 2.2 is required, along with
  117. reasonable 8080 assembly language programming proficiency.
  118.  
  119.  
  120.   Two additional configurations evolved from the routines described above. The
  121. first differs only in the BIOS module.    This new BIOS, designated MBIOSxx to
  122. distinguish it from the author's normal BIOS, supports two Wangco 82 40-track
  123. double density, single-sided drives as A: and B:, and supports two MPI 92
  124. 80-track double density, double-sided drives as C: and D: (or the equivalent
  125. Tandon double-sided drive if the step rate is adjusted). The rest of the
  126. target configuration included the normal Horizon left serial port as the
  127. console device, and the Horizon right serial port with an Epson MX-80
  128. printer attached as the list device. In addition, a single-byte change
  129. to the system image allows this BIOS to fully support a PMMI 600 baud
  130. MM-103 modem. If the contents of location MODEM in the BIOS are set to
  131. zero when the BIOS is cold-booted, then instead of the normal local
  132. device handlers, the console, list, reader, and punch are attached to
  133. the PMMI modem, just like the public domain program BYE. In this
  134. configuration, the BIOS waits for the phone to ring. When it does, the
  135. phone is answered, and carriage returns must be struck for the BIOS to
  136. determine the baud rate (110,300,450,600, or 710). When the baud rate
  137. has been determined, a password is solicited. If the password is correct,
  138. a normal warm boot is done, and operation of CP/M will proceed as if
  139. the operator was local, except that console input will be accepted from
  140. either the PMMI or the Horizon left serial port, and console output will
  141. be sent to both the PMMI and the Horizon left serial port. This operation
  142. will stay in effect until either the phone is hung up, or a jump is made
  143. to the BIOS cold boot vector. A special trivial MBYE program is provided
  144. to do the latter for convenience.
  145.  
  146.   To accommodate the different step rates of the drives, a special step
  147. rate table is employed that provides timing loop counts for the step
  148. routine. The timings included in the BIOS are for a 4 MHz Z80 with no
  149. wait states.
  150.  
  151.   MBIOSxx supports all the North Star formats that NBIOSxx does, with the
  152. exception of Lifeboat 2.0, which used the now-obsolete 2k group size. This
  153. format was left out because it was retrofitted to NBIOSxx, and the author
  154. thought it was sufficiently rare that it was not worth the effort or drive
  155. table space to include it in MBIOSxx. It could certainly be added, using
  156. the drive select routine of NBIOSxx as a guide, but the memory space in
  157. MBIOSxx is very tight due to the PMMI support, and something would probably
  158. have to be removed to make the new drive table fit.
  159.  
  160.   Given the above slight limitation, and the fact that there is no support
  161. for a second disk controller in this BIOS, it is still certainly the best
  162. choice for a user with only a North Star controller, since it can be easily
  163. modified for 35- or 40-track drive usage, supports a standard Horizon with
  164. a fairly-standard printer (Epson MX-80), and can easily be modified for a
  165. variety of different 5 1/4" drives, both double and single sided, such as the
  166. standard North Star quad-type disks. However, such modifications require an
  167. intimate knowledge of how to configure CP/M 2.2 disk parameter blocks and
  168. skewing tables, and a knowledge of the stepping requirements of the target disk
  169. drive.    The normal NSCOPY and NSGEN utilities are used to support MBIOSxx,
  170. with the 1K space normally occupied by the Jade control code reserved in the
  171. TPA and on the disk by NSGEN but not normally used by MBIOSxx.  Note that
  172. because of the PMMI support, MBIOSxx uses about 3.5k of memory, just like
  173. NBIOSxx.  There is no significant advantage in attempting to remove the
  174. PMMI drivers to shrink the BIOS, since an entire 1k would have to be
  175. removed, and these drivers only account for about .5k of code.
  176.  
  177.  
  178.   The other additional configuration was created to support the author's North
  179. Star single density disk system.  That system consists of a North Star single
  180. density disk controller with up to two SA-400 drives, a 16x64 SSM VB1
  181. memory-mapped video display as the console output device, a parallel keyboard
  182. as the console input device, a Teletype Model 43 (or other compatible) serial
  183. printer as the list device, and a skimpy 21K of static RAM main memory.  I/O 
  184. devices on this system are memory-mapped.  As pointed out above, a separate 
  185. boot module is required by this hardware.  This configuration is incomplete, 
  186. in that no format utility corresponding to NSCOPY is provided that will run 
  187. with the single density controller.  The author's main Horizon system running 
  188. NSCOPY is used to format or copy diskettes for the single density system.  On 
  189. another user's system, the standard North Star DOS disk-copy and initialize 
  190. functions should suffice for those functions, and a disk utility such as Ward 
  191. Christensen's excellent DU can be used for clearing the disk directory before 
  192. use with CP/M.
  193.  
  194.   On the author's system, only 20K of main memory is contiguous.  Taking a page
  195. out of Lifeboat's book, the 1K of non-contiguous memory lends itself well to a
  196. user I/O area scheme.  Therefore, this system is implemented with the BIOS
  197. functions separated into two parts, roughly corresponding to the disk I/O
  198. functions in SDNBIOS, and the console and list functions in SDNUSER, resulting
  199. in the four modules described below:
  200.  
  201. (1) SDNBOOT.ASM     This routine resides on track zero, in North Star
  202.             physical sector 4.  It is read from there by the boot
  203. routine on the single density controller into memory at the fixed location
  204. 2000H.    When control is passed to SDNBOOT, it reads the various sections of
  205. SDNBIOS and SDNUSER into memory from the system tracks of the diskette.  Three
  206. such tracks are required for CP/M 2.2 on a single density disk.
  207.  
  208. (2) SDNBIOS.ASM     All disk I/O routines reside here.  Lifeboat-compatible
  209.             single density format is supported, but with a CP/M 2.2
  210. parameter block, rather than the Lifeboat single density pseudo-8" disk method.
  211. Disks can be read and written interchangeably by SDNBIOS, NBIOSxx, MBIOSxx,
  212. Lifeboat single density CP/M 1.4, and Lifeboat double density CP/M 2.2.  To
  213. overcome the severe speed loss due to lack of sector skewing, full track
  214. buffering is supported standardly, allowing quite respectable operation, with a
  215. penalty of a loss of 2.5K of system memory.
  216.  
  217. (3) SDNUSER.ASM     All console and list I/O routines reside here.    The VB1
  218.             is used as a glass teletype for console output, with
  219. the single concession of a backspace function on the current line.  Due to the
  220. extremely tight space considerations on this minimal machine, some functions
  221. actually reside in SDNBIOS, to utilize all possible space.
  222.  
  223. (4) SDNSGEN.ASM     This is the specialized system generation utility 
  224.             required for generating the single density system,
  225. corresponding to NSGEN for the double density system. Standard CP/M 2.2 BDOS
  226. and BIOS calls are used, allowing this program to be run on any
  227. Lifeboat-compatible system, single or double density.  Normally, the single
  228. density operation of NBIOSxx or MBIOSxx is very slow, due to the lack of
  229. skewing or track buffering under those BIOS'es.  To overcome this, SDNSGEN
  230. accesses alternate physical sectors, allowing respectable transfer speeds on
  231. the double density systems, with no penalty on the track-buffered single
  232. density system.
  233.  
  234.  
  235.    These modules were developed using the pertinant North Star controller
  236. documentation, along with a bit of fiddling around with some of the timing
  237. where the documention was not explicit enough to point out the problem areas
  238. (especially on the single density controller!).  They are placed in the public
  239. domain by the author, and may be freely distributed, but may not be sold. 
  240. Sections of NBIOSxx pertaining to the Jade Double D were developed from
  241. routines made available to Jade Double D owners by Jade Computer Products, and
  242. appear now in the public domain for use with Jade Double D controllers by
  243. special permission from Jade Computer Products.
  244.  
  245.  
  246.             Author:     Steve Bogolub
  247.             Date:        May 14, 1982
  248.  
  249.  
  250.