home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / telecomm / hsmoda04 / drvin.txt < prev    next >
Text File  |  1994-01-02  |  14KB  |  325 lines

  1. DRVIN.PRG
  2. =========
  3.  
  4. (Note for the English reading people: The English version is appended on 
  5. the German, look for it!)
  6.  
  7. (Ich habe keine Zeit, alles ausführlich einzutippen. Wenn jemand Treiber 
  8. für andere Hardware oder einen "Treiberadapter" für Mint schreiben will, 
  9. kann er sich gern an mich wenden. Assemblerkenntnis setze ich allerdings 
  10. voraus. Irgendwann wird hier die vollständige Doku der Funktionen 
  11. erscheinen.)
  12.  
  13.  
  14. Dieses Programm (DRVIN) unterstützt nachladbare Gerätetreiber. Es muß vor 
  15. diesen Treibern geladen werden. DRVIN und Treiber müssen vor den 
  16. Programmen geladen werden, die die Treiber nutzen sollen. DRVIN gehört in 
  17. den AUTO-Ordner (für Spezialisten: oder in eine äquivalente 
  18. Programmsammelecke). Man kann es zu Testzwecken auch vom Desktop aus 
  19. starten. Es sollte aus Geschwindigkeitsgründen möglichst weit hinten im 
  20. AUTO-Ordner stehen.
  21.  
  22.  
  23. TOS
  24. ---
  25. DRVIN läuft unter allen mir bekannten TOS-Versionen.
  26.  
  27. Mag!X
  28. -----
  29. DRVIN läuft unter Mag!X ab Version 2.00. Mit älteren Mag!X-Versionen müßte 
  30. es ebenfalls funktionieren, dies wurde aber nicht getestet. Bei 
  31. Mag!X-Versionen >2.00 sind einige Funktionen von DRVIN unnötig und werden 
  32. nicht verwendet. Möglicherweise wird es ein Mag!X geben, das alle 
  33. Funktionen von DRVIN enthält. Dann ist DRVIN überflüssig und die Treiber 
  34. werden ohne DRVIN gestartet.
  35.  
  36. MiNT
  37. ----
  38. Wenn man DRVIN und die Treiber vor MiNT startet, bleibt nur wenig von den 
  39. Funktionen übrig. Deshalb sollte man DRVIN und die Treiber nach MiNT 
  40. starten. Dabei realisieren sie alle ihre Funktionen wie unter TOS, aber 
  41. nicht mehr. Umlenkungen oder sonstige Spielerchen sind mit den Filehandles 
  42. dieser Geräte nicht möglich. Ich weiß nicht, ob die Umschaltung des 
  43. AUX-Gerätes für den aktuellen Prozeß dann noch funktioniert. Ich benutze 
  44. weder MiNT noch MultiTOS. Solange sich kein MiNT-Freak findet, der die 
  45. Anpassung und Unterstützung übernimmt, wird es wohl kaum speziell an MiNT 
  46. angepaßte Versionen geben.
  47.  
  48.  
  49. Aufbau
  50. ------
  51. DRVIN besteht aus drei wesentlichen Teilen: dem Anlegen des RSVF-Cookies, 
  52. der neuen Bconmap- und MAPTAB-Verwaltung für BIOS und XBIOS sowie den 
  53. Basisroutinen für die Installation einfacher Mag!X-kompatibler 
  54. Gerätetreiber.
  55.  
  56.  
  57. RSVF-Cookie
  58. -----------
  59. Es wird ein RSVF-Cookie angelegt, dessen Wert auf zwei 0-LONGs zeigt, also 
  60. auf ein Ende-Objekt. So brauchen Gerätetreiber keinen Cookie mehr 
  61. anzulegen, sondern sich nur noch in die RSVF-Listen einzuhängen. Der 
  62. RSVF-Cookie liefert eine Struktur zur Anzeige grundlegender Informationen 
  63. über Schnittstellen. Zur Beschreibung des RSVF-Cookies siehe Textfile 
  64. RSVF_COO.TXT.
  65.  
  66.  
  67. MAPTAB-Verwaltung
  68. -----------------
  69. Dieser Programmteil hängt im BIOS- und XBIOS-Trap und bearbeitet die 
  70. XBIOS-Funktionen Bconmap, Rsconf und Iorec(für AUX). Es werden die 
  71. BIOS-Funktionen Bconstat, Bconin, Bcostat und Bconout für Gerät AUX sowie 
  72. alle Geräte ab einschließlich 6 aufwärts bearbeitet. Bconmap und eine 
  73. MAPTAB werden unter jeder TOS-Version angelegt. Die Routinen des aktuell 
  74. per Bconmap eingestellten Gerätes werden zusätzlich in die xco*-Vektoren 
  75. (außer bei TOS1.00) kopiert, dort aber nicht benutzt. Es werden zwei neue 
  76. Bconmap-Unterfunktionen mit den Opcodes -300 und -301 zum Überschreiben 
  77. eines MAPTAB-Eintrages und zum Anhängen an die MAPTAB bereitgestellt.
  78.  
  79. Die Länge der MAPTAB ist nicht mehr fest begrenzt. ### Momentan liegt die 
  80. Maximallänge in DRVIN.PRG bei 10 Einträgen, ist aber nur eine konstante 
  81. Variable in der Assemblerquelle und jederzeit erweiterbar.
  82.  
  83.  
  84. GEMDOS-Teil
  85. -----------
  86. Der sieht von außen aus wie die bisherigen HSMODEM1-Versionen und von 
  87. innen wie eine (### momentan noch) stark abgerüstete Mag!X-Beta. 
  88. Es werden Fopen, Fread, Fwrite, Fclose, Fcntl an den Treiber 
  89. weitergeleitet, aber alles mit fileptr == NULL.
  90.  
  91.  
  92. Aktionen
  93. --------
  94. Wird DRVIN auf TOS > 2.00 oder auf Mag!X >= 2.00 losgelassen, dann kopiert 
  95. es die alten Routinen aus den alten MAPTABs, so daß eine Funktion der 
  96. (X)BIOS-Aufrufe mit den alten TOS-Routinen gegeben ist, auch ohne 
  97. installierte Treiber. Bei TOS1.00 sieht es ganz übel aus, man muß den 
  98. MFP-Treiber nachladen, sonst geht SerialI/O nicht mehr (nur Zeiger auf 
  99. IOREC wird übertragen). Bei 1.00 < TOS < 2.00 geht es etwas, da nur Rsconf 
  100. nicht übertragen wird, aber deshalb muß man trotzdem den MFP-Treiber 
  101. nachladen.
  102.  
  103.  
  104. Mag!X- (und DRVIN-) freundliche Bco*-Routinen
  105. ---------------------------------------------
  106. veränderbare Register A0-A2/D0-D2 (auch bei Rsconf)
  107. Bconout muß mit dem Befehl
  108. move.b 7(sp),d0
  109.     oder auch:
  110. move.w 6(sp),d0
  111. beginnen und wird meist hinter diesem (Startadr+4) mit Parameter in d0.b 
  112. aufgerufen
  113.  
  114.  
  115. Neue XBIOS-Bconmap-Funktionen (-300, -301)
  116. ------------------------------------------
  117. Diese Funktionen dürfen nur zur Installation Mag!X-freundlichen Funktionen 
  118. benutzt werden.
  119.  
  120. In der MAPTAB ist Platz für mehr als 4 Geräte. Der Lieferant dieser 
  121. XBIOS-Funktionen (DRVIN oder zukünftiges Mag!X) sorgt für ausreichend 
  122. Platz zur Installation neuer Geräte in der MAPTAB. Entweder er schafft den 
  123. Platz dynamisch oder er hat eine feste Obergrenze. Ein Treiber sollte 
  124. trotzdem mit einer Fehlermeldung rechnen, die durch Speichermangel 
  125. ausgelöst sein könnte, aber auch ganz andere Ursachen haben kann.
  126.  
  127. Die XBIOS-Funktion Bconmap wird um zwei Unterfunktionen erweitert. Sind 
  128. diese Erweiterungen nicht vorhanden, bekommt man beim Funktionsaufruf 
  129. automatisch eine 0 als Fehlermeldung zurück.
  130.  
  131. LONG Bconmap((WORD)-300, (WORD) dev_nr, (LONG) ptr_to_6_longs)
  132. dev_nr ist eine Gerätenummer ab 6 aufwärts, die in der MAPTAB bereits 
  133. existieren muβ, andernfalls wird der Fehlercode -15 EUNDEV zurückgegeben. 
  134. ptr_to_6_longs zeigt auf eine Struktur, die einem MAPTAB-Eintrag 
  135. entspricht. Diese Struktur wird auf den entsprechenden Platz in der MAPTAB 
  136. kopiert. Ist das angesprochende Gerät das aktuell per Bconmap für AUX 
  137. eingestellte, so werden die eben eingehängten Routinen auch nach xco* und 
  138. in die aktuellen rsconf und iorec-Zellen kopiert. Diese Funktion dient nur 
  139. zum Einhängen Mag!X-freundlicher Routinen. Als Erfolgsmeldung wird die 
  140. Gerätenummer zurückgegeben, auf die der Eintrag erfolgte, also dev_nr ist 
  141. Rückgabewert.
  142.  
  143. LONG Bconmap((WORD)-301, (LONG) ptr_to_6_longs)
  144. ähnlich -300, fügt aber einen Kanal an die MAPTAB an. Rückmeldung ist 
  145. entweder die von dieser Funktion für den Eintrag gewählte Kanalnummer, 
  146. oder der Fehlercode -12 EGENRL, falls kein Platz für eine 
  147. MAPTAB-Vergröβerung ist. Logischerweise kann es hier nicht vorkommen, das 
  148. die Vektoren sofort nach xco* übertragen werden.
  149.  
  150.  
  151. Treiber
  152. -------
  153. DRVIN bietet im GEMDOS-Bereich nicht alle Möglichkeiten der 
  154. Mag!X-(beta)Versionen. Wer einen Treiber schreiben will, der auch unter 
  155. DRVIN funktioniert, kann sich wegen der Einzelheiten an mich wenden.
  156.  
  157.  
  158. Versionen
  159. ---------
  160. 1993-11-23
  161. im GEMDOS-Trap nun nur noch A0/D0 modifiziert, für solche unsauberen 
  162. Programme wie STZIP (mindestens bis Version 2.3), ZIPJR, das 
  163. PureC-Hilfesystem, Teleoffice und ungezählte andere.
  164. Fopen und Fclose werden an Devices weitergereicht
  165. 1993-11-28
  166. Fehler unter TOS1.00 bei XBIOS-Bconmap beseitigt
  167. eigener Env-String _PNAM=DRVIN.PRG
  168.  
  169.  
  170. Harun Scheutzow, 21.11.1993 und später
  171. (Harun_Scheutzow@B.maus.de)
  172.  
  173.  
  174.  
  175. DRVIN.PRG
  176. =========
  177.  
  178. (Translated from German to English on 1994-01-02 by Harun Scheutzow)
  179.  
  180. (I have no time for typing everything in the long form. When somebody 
  181. wants to write a driver for different hardware or so, he may contact me. 
  182. In the future here will appear the complete documentation of the 
  183. functions.)
  184.  
  185.  
  186. This program (DRVIN) supports loadable device driver. It has to be loaded 
  187. before the drivers. DRVIN and drivers must be executed before the programs 
  188. using this drivers. This program should be placed into the AUTO-folder 
  189. (for specialists: or an equivalent program collection place). It can be 
  190. startet from the desktop too for test purposes.
  191.  
  192.  
  193. TOS
  194. ---
  195. DRVIN works with all TOS versions I know.
  196.  
  197. Mag!X
  198. -----
  199. DRVIN runs under Mag!X from version 2.00 up. It should be run under older 
  200. Mag!X versions too, but this isn't tested. With Mag!X >2.00 some functions 
  201. of DRVIN are no longer needed and not used. Possibly it will exist a Mag!X 
  202. in the future which contains all functions of DRVIN. In this case DRVIN is 
  203. not necessary and the drivers will be startet without DRVIN.
  204.  
  205. MiNT
  206. ----
  207. If DRVIN and the drivers are started before MiNT only a little of the 
  208. functions will remain. That's why DRVIN and the drivers should be started 
  209. after MiNT. In this case all functions are realized as under TOS, but no 
  210. more. Redirections and other plays are impossible with this file handles. 
  211. I don't know whether the AUX-device switching for the aktual process will 
  212. continuosly work. I use neither MiNT nor MultiTOS. As long as no MiNT 
  213. freak is to be found who takes over the adaption and support, no special 
  214. versions for MiNT will exist.
  215.  
  216.  
  217. Construction
  218. ------------
  219. DRVIN consist of three import parts: making the RSVF-cookie, new Bconmap- 
  220. and MAPTAB-manager for BIOS and XBIOS, basic routines for installation of 
  221. simple Mag!X compatible devices drivers.
  222.  
  223.  
  224. RSVF-Cookie
  225. -----------
  226. A RSVF-cookie is created which value points to two 0-LONGs, representing 
  227. an end-object. So devices drivers aren't in need of creating a cookie. 
  228. They hook themselves only in the RSVF-lists. The RSVF-cookie provides a 
  229. structure for providing the basic information about interfaces. The 
  230. description is contained in the file RSVF_COO.TXT.
  231.  
  232.  
  233. MAPTAB-Verwaltung
  234. -----------------
  235. This part hooks in the BIOS- and XBIOS-trap and manages the 
  236. XBIOS-functions Bconmap, Rsconf and Iorec(for AUX). The BIOS-functions 
  237. Bconstat, Bconin, Bcostat and Bconout for device AUX and all devices from 
  238. included 6 up are managed. Bconmap and a MAPTAB are provided under every 
  239. TOS-version. The routines of the actual setted device by bconmap are 
  240. copied in the xco*-vectors (except TOS1.00) too, but not used there. Two 
  241. new Bconmap-subfunctions with the opcodes -300 and -301 are provided for 
  242. overwriting a MAPTAB-entry and for adding a new entry.
  243.  
  244. The length of the MAPTAB is no longer limited. ## The actual limit in this 
  245. DRVIN is 10 entry, but this is only a constant in the source, easy to 
  246. change and extend.
  247.  
  248.  
  249. GEMDOS-part
  250. -----------
  251. It looks like the old HSMODEM1-version from outside and from inside like 
  252. (### at the moment) a reduced Mag!X-beta. Fopen, Fread, Fwrite, Fcntl are 
  253. directed to the driver, but all with fileptr == NULL.
  254.  
  255.  
  256. Actions
  257. -------
  258. When DRVIN is started under TOS>2.00 oder Mag!X>2.00, all old routines 
  259. from the old MAPTAB are copied in the new one, so that the 
  260. (X)BIOS-functions will work with the old routines if no driver is 
  261. installed. Under TOS1.00 it looks very bad, the MFP-driver must be loaded, 
  262. otherwise serialI/O will not work (only the IOREC-pointer is copied). 
  263. Under 1.00<TOS<2.00 will it work a litte without drivers because only 
  264. Rsconf is not copied, that's why the MFP-driver must be loaded.
  265.  
  266.  
  267. Mag!X- (and DRVIN-) friendly Bco*-routines
  268. ------------------------------------------
  269. modificable registers A0-A2/D0-D2 (for Rsconf too)
  270. Bconout has to start with the instruction
  271. move.b 7(sp),d0
  272.    or other opportunity:
  273. move.w 6(sp),d0
  274. and will be called mostly after this (startadr+4) with the parameter in 
  275. D0.b
  276.  
  277.  
  278. New XBIOS-Bconmap-functions (-300, -301)
  279. ----------------------------------------
  280. These functions may only be used to install Mag!X-friendly functions.
  281.  
  282. In the MAPTAP there is room for more than 4 devices. The provider of the 
  283. XBIOS-functions (DRVIN or a future Mag!X) provides enough room to install 
  284. additional devices. It may create the room dynamically or have a fast 
  285. upper limit. Never the less a driver could get an error message caused by 
  286. insufficent memory or other reasons.
  287.  
  288. The XBIOS-function Bconmap is extended by two new subfunctions. If the 
  289. extensions are unavailable, the caller gets a 0 as error message.
  290.  
  291. LONG Bconmap((WORD)-300, (WORD) dev_nr, (LONG) ptr_to_6_longs) dev_nr is a 
  292. device number from 6 up which is already exists in the MAPTAB, otherwise 
  293. the error code -15 EUNDEV is returned. ptr_t_6_longs points to a structure 
  294. equal to a MAPTAB-entry. This structure is copied to te according 
  295. MAPTAB-place. If the new installed device is the actual AUX-device, the 
  296. routines are copied to xco* and the actual rsconf and iorec cells to. This 
  297. function is only for installing Mag!X-friendly routines. The device number 
  298. is returned as a success message, that is, the dev_nr is return value too.
  299.  
  300. LONG Bconmap((WORD)-301, (LONG) ptr_to_6_longs)
  301. similar -300, but adds a device to the MAPTAB. Return message is either 
  302. the device number selected by this function or the error code -12 EGENRL 
  303. if it's impossible to enlarge the MAPTAB. This function will never 
  304. transfer the vectors to xco* because a added device can't be the actual in 
  305. the moment of adding.
  306.  
  307.  
  308. Driver
  309. ------
  310. DRVIN doesn't provides all possibilities of the Mag!X(beta)-versions. Who 
  311. wants to write a driver running under DRVIN too, could contact me for 
  312. details.
  313.  
  314.  
  315. Versions
  316. --------
  317. 1993-11-23
  318. in the GEMDOS-trap only A0/D0 modified as adaption to such very unclean 
  319. program as STZIP (least until version 2.3), ZIPJR, the PureC help system, 
  320. Teleoffice and many others
  321. Fopen and Fclose directed to the drivers
  322. 1993-11-28
  323. Bug under TOS1.00 in Bconmap removed
  324. own environment string _PNAM=DRVIN.PRG
  325.