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