home *** CD-ROM | disk | FTP | other *** search
/ Crawly Crypt Collection 1 / crawlyvol1.bin / program / books / os / os.doc
Text File  |  1970-01-02  |  12KB  |  323 lines

  1.  
  2.  
  3.         The Operating Sytem of the Atari ST
  4.         === ========= ===== == === ===== ==
  5.             copyright 1987 by John Ogawa
  6.  
  7. No part of this document may be reproduced without permission
  8. from the author. Permission is granted to copy this document for
  9. non-commercial purposes only.
  10.  
  11.  
  12.  
  13.  
  14.     Table of Contents
  15.     ----- -- --------
  16.  
  17. 1.0 A wide angle view
  18.  
  19. 2.0 The TOS and some history
  20.     2.1 The GEMDOS
  21.     2.2 The BIOS
  22.     2.3 The XBIOS
  23.     2.4 The Line A routines
  24.     2.5 Wrapup of TOS
  25.  
  26. 3.0 GEM
  27.     3.1 The AES
  28.     3.2 The VDI
  29.     3.3 Wrapup of GEM
  30.  
  31. 4.0 A final wrap up
  32.  
  33. 5.0 Where to read
  34.  
  35. 6.0 Where to reach me
  36.  
  37.  
  38.  
  39.  
  40. Hi there.  This article is an attempt to describe the workings of
  41. the Atari ST's operating system.  Be forewarned that I am not an
  42. ST wizard, and that any information in here was gained through
  43. reading non Atari documentation, playing with the ST, and talking
  44. to people.  In other words, it may not be right! But maybe it is.
  45. Who knows? Read on . . .
  46.  
  47.    The Atari ST has an extremely complex operating system
  48. consisting of several groups of routines that comprise several
  49. different levels of interaction with the machine.  Geez, what I
  50. meant to say was that there are a lot of calls, and that they can
  51. be divided into groups, and these groups are related to each
  52. other in a tree-like way.  The major libraries are the BIOS, the
  53. XBIOS, the GEMDOS, the Line A routines, the AES, and the VDI.
  54. These groups can in turn be put into TOS and GEM.  How do they all
  55. relate? Well, follow me! In the following sections I'll take a
  56. bottom up look at the individual libraries, how they relate to
  57. each other, and what they do.  The first section will talk about
  58. the overall organization of the OS (operating system).
  59.  
  60.  
  61.  
  62.  
  63. 1.0 A wide angle view
  64. ----------------------
  65. The ST's OS can be divided into two large groups of routines,
  66. TOS (Tramiel Operating System), and GEM (Graphics Environment
  67. Manager).  TOS has the underlying routines that make the machine
  68. run, and GEM has the routines that make it talk nice to you.
  69.    TOS can be further broken down into the BIOS, XBIOS, GEMDOS,
  70. and Line A libraries.  These libraries control machine dependant
  71. functions (like controlling the peripherals) and basic I/O.  The
  72. Line A routines are basic graphics routines that are used by GEM
  73. to create the windowing environment that the user sees.
  74.    GEM contains two libraries, the AES and VDI routines.  GEM is
  75. responsible for the windowing environment and the desktop that
  76. make using the ST more intuitive.  The AES is concerned mostly
  77. with windows and dialogs, things that the user interacts with.
  78. The VDI routines handle complex text display and high level
  79. graphics manipulations.
  80.    In the next sections I'll go into the two groups of libraries,
  81. TOS and GEM, and their respective libraries in more detail.  I'll
  82. start with TOS.
  83.  
  84.  
  85.  
  86.  
  87. 2.0 The TOS and some history
  88. -----------------------------
  89.    TOS is the heart of the ST.  Everything you do, run, or write
  90. on your ST uses TOS.  These are the routines that do all the lower
  91. level tasks of running programs.  TOS is present and active in the
  92. ST at all times.  A little information about the background and
  93. design of TOS may help to make it's job clear.
  94.    In the beginning was CP/M, an OS that I am very familiar with
  95. :-).  CP/M was designed to run on a large number of computers,
  96. while keeping a standard interface so that people and programs
  97. could migrate from machine to machine without too much pain.  A
  98. good idea, one that was very popular.  
  99.    CP/M achieved its portability by dividing itself into two
  100. distinct sections, the machine independent and machine dependant
  101. routines.  The code for the machine independent routines was the
  102. same across machines, and whenever it did anything it called the
  103. machine dependant routines using standard names.  This worked
  104. well, and programs very easily moved from machine to machine, and
  105. the CP/M community thrived.
  106.    The came IBM.  When IBM/Microsoft designed PC/MS-DOS they kept
  107. several of the concepts of CP/M.  Then came DRI.  They designed a
  108. machine independent set of routines called GEMDOS which was based
  109. on CP/M and MS-DOS.  It is GEMDOS that makes up the hardware
  110. independent part of TOS.  The file manipulation and task handling
  111. routines of TOS are in GEMDOS.  To fill out TOS, Atari added the
  112. machine dependant routines in the BIOS and XBIOS.  Finally, to
  113. make graphics programming easier, Atari added the Line A
  114. routines.
  115.    So TOS is composed of the "higher" level GEMDOS routines, the
  116. machine dependant BIOS and XBIOS routines, and the Line A
  117. graphics routines.  In the next sub-sections I'll very briefly
  118. describe each of theses libraries.
  119.  
  120.  
  121. 2.1 The GEMDOS
  122. ---------------
  123.    The GEMDOS, as noted before, are the machine independent
  124. routines for handling files and tasks (programs) and doing "high"
  125. level I/O.  They bear a great resemblance to MS-DOS routines.  
  126. These routines make it easy to manipulate files by using Fopen,
  127. Fread, and Fseek.  Controling the execution of programs is managed
  128. using routines such as Pexec and Pterm.  Easy I/O is done using
  129. Cconin and Cconout.  These routines allow the programmer to
  130. perform most of what s/he would like to do with little fuss.
  131.    The GEMDOS is the highest level of TOS.  It is built on
  132. routines in the rest of TOS, namely the BIOS and the XBIOS.  As we
  133. look at the BIOS and XBIOS in the next sub-sections you will find
  134. overlap between them and the GEMDOS.  GEMDOS was written to make
  135. the programmer's job easier by incorporating the lower level
  136. routines into higher level routines that are more specific.
  137.  
  138.  
  139. 2.2 The BIOS
  140. -------------
  141. The BIOS is the collection of routines that the ST uses to
  142. communicate with the many devices available to it.  Using BIOS
  143. routines you can read and write to, and get the status of, the
  144. serial port, the midi port, the parallel port, the disks, and the
  145. screen/terminal.  These routines (like Bconin and Bconout) are
  146. general routines.  With the same routine you can get information
  147. from several sources by varying the calling parameters.  You can
  148. see how the device specific routines in the GEMDOS can be built
  149. from the BIOS routines.  
  150.  
  151.  
  152. 2.3 The XBIOS
  153. --------------
  154. These routines are very much like the BIOS, but involve much more
  155. control over the ST's peripherals.  In general, you read or write
  156. with BIOS calls, you *control* with XBIOS calls.  These routines
  157. also allow you to control the sound chip, the floppy disks, the
  158. serial port, the mouse, and the midi port.  GEMDOS is also built
  159. from these calls.  
  160.  
  161.  
  162. 2.4 The Line A routines
  163. ------------------------
  164. These routines are the graphics primitives in the ST.  They allow
  165. you to create complex graphics with relatively few, simple
  166. commands.  With these routines you can draw pixels, lines and
  167. boxes as well as control sprites and the mouse pointer.  The GEM
  168. routines are built from these routines (but more about that
  169. later).
  170.  
  171.  
  172. 2.5 Wrapup of TOS
  173. ------------------
  174. That was TOS.  Hope it was kind of clear.  Sorry if it wasn't.
  175. Theose routines are the basis for anything you will run on the
  176. ST.  The next level up is GEM.
  177.  
  178.  
  179.  
  180.  
  181. 3.0 GEM
  182. -------
  183.  
  184. Now we come to the complex stuff.  GEM, the Graphics Environment
  185. Manager, is a machine independent (runs on the IBM too) set of
  186. routines that enable the programmer to use windows, dialogs, the
  187. mouse, buttons, and sliders to interface with an end user.  GEM
  188. also allows you to present complex graphics and output them to a
  189. number of different devices.  It is built so that these features
  190. can be defined, accessed, and used with a relatively small number
  191. of routines.  It also allows limited multitasking through desk
  192. accessories.  In addition to all that, GEM allows inter-process
  193. communication and control.  I said it was complex!
  194.    GEM consists of two libraries of routines, the AES
  195. (Application Environment Services) and the VDI (Virtual Device
  196. Interface).  The AES is responsible for drawing and getting input
  197. from windows and dialogs, as well as coordination of multiple
  198. input sources and the interaction between concurrently running
  199. programs.  It is primarily concerned with input.
  200.    The VDI is responsible for complex output.  It handles fancy
  201. text output, high level graphics output, and output to devices
  202. other than the screen.
  203.    In the next two sub-sections I'll describe the AES and VDI
  204. libraries in a little more detail.
  205.  
  206.  
  207. 3.1 The AES
  208. -----------
  209. The AES, as I mentioned before, is mostly concerned with input.
  210. While it is responsible for drawing windows and dialogs, it's
  211. most important job is to receive input through those windows and
  212. dialogs.  The evnt_button, evnt_timer, and evnt_multi calls are
  213. input related calls in AES.
  214.    Another function of the AES is to coordinate more than one
  215. running program.  Inter-program messages and coordination are AES
  216. responsibilities.
  217.    Central to the AES is the notion of an object.  An object is
  218. (usually) something to be drawn in a window (like a slider bar)
  219. or a dialog (like a button).  Objects can also be text or boxes.
  220. A collection of objects is organized into a tree, which gives
  221. information about the relationships between the objects.
  222. Once drawn, some object can be acted on (selected, moved, sized,
  223. etc.), and the results of these actions comprise the input that
  224. the AES is charged with obtaining.
  225.    The AES attempts to provide a smooth and easily programmed
  226. interface between the user and the program.
  227.  
  228.  
  229. 3.2 The VDI
  230. ------------
  231. The VDI routines are primarily concerned with output.  The VDI
  232. offers complex graphics capabilities using simple and easily
  233. handled routines.  It also handles fonts and text output.
  234.    One of the most important VDI functions is to provide access
  235. to a variety of output devices.  VDI routines are built so that the
  236. device that they are outputting onto is not specific.  One can
  237. draw a circle on the screen or on a plotter with the same
  238. routine.  The device independent portion of the VDI is the GDOS.
  239. Its routines control the peripheral devices and allow output from
  240. VDI routines to them.
  241.    The important concept in the VDI library is the workstation.  A
  242. workstation is a device that can handle output from the VDI
  243. routines.  Printers, plotters, and the screen are examples of
  244. workstations.  Each VDI routine is given the workstation it is
  245. expected to output to.
  246.    The VDI provides a flexible means for presenting complex
  247. output to the user.
  248.  
  249.  
  250. 3.3 Wrapup of GEM
  251. ------------------
  252. Well, there is GEM.  As you might guess, the GEM routines are
  253. built on the BIOS, XBIOS, and Line A routines.  GEN lets the
  254. programmer present sophisticated information elegantly and
  255. receive complex feedback using a library of high level routines.
  256. GEM is the highest level of the ST's operating system.
  257.  
  258.  
  259.  
  260.  
  261. 4.0 A final wrap up
  262. -------------------
  263. I've done my best to describe the ST's operating system and all
  264. it's interconnections, hierarchies, and overlaps.  Negotiating
  265. your way around all those routines as a programmer can be very
  266. confusing.
  267.  
  268.  
  269.  
  270.  
  271. 5.0 Where to read
  272. -----------------
  273. Most of the information in this article was gleamed from all of
  274. the books listed below. In addition, Tim Oren's ProGem series was
  275. an invaluable tutorial on the ins and outs of GEM.
  276.  
  277.     "Programmer's Guide to GEM" by Phillip Balma and William
  278.         Fitler. Sybex, 1986.
  279.  
  280.     "Atari ST Internals" by K. Gerits, L. Englisch and R.
  281.         Bruckmann. Abacus Software, 1985.
  282.  
  283.     "Atari ST GEM Programmer's Reference" by Norbert
  284.         Szczepanowski and Bernd Gunther. Abacus Software,
  285.         1986.
  286.  
  287.     "Mark Williams C for the Atari ST, version 2.0" (manual).
  288.         Mark Williams Co., 1986.
  289.  
  290. And of course, many thanks to all the people in the ST community
  291. who have answered my questions. I'll probably have a lot more.
  292. :-).
  293.  
  294.  
  295.  
  296.  
  297. 6.0 Where to reach me
  298. ---------------------
  299. Feel free to write me and correct anything I have said or ask me
  300. questions. Though for the latter, remember that I probably know
  301. about as much about the ST as you do!
  302.    I can be reached at:
  303.  
  304.     GEnie:     TUSHIE
  305.  
  306.     Usenet: ps136sag@sdcc13.ucsd.edu
  307.             or
  308.         ...ucbvax!sdcsvax!sdcc13!ps136sag
  309.  
  310.     BBSs:    Sysware
  311.         (619)278-8671
  312.         ST-SDACE
  313.         (619)284-3821
  314.  
  315.     USMail: John Ogawa
  316.         1028 W, Lewis Dr.
  317.         San Diego, CA   92013
  318.  
  319. Happy Hacking!
  320.  
  321. tush
  322. 5/19/87
  323.