home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 20901 < prev    next >
Encoding:
Text File  |  1993-01-07  |  2.9 KB  |  62 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!think.com!rpi!usc!elroy.jpl.nasa.gov!elroy!brad
  3. From: brad@wendel.jpl.nasa.gov (Brad Pickering)
  4. Subject: Re: Sozobon (or other free C's): would this strategy work?
  5. In-Reply-To: ngse18@castle.ed.ac.uk's message of 4 Jan 93 23:25:55 GMT
  6. Message-ID: <BRAD.93Jan7094517@wendel.jpl.nasa.gov>
  7. Followup-To: comp.sys.mac.programmer
  8. Sender: news@elroy.jpl.nasa.gov (Usenet)
  9. Nntp-Posting-Host: wendel.jpl.nasa.gov
  10. Organization: Jet Propulsion Laboratory, Pasadena, CA
  11. References: <29879@castle.ed.ac.uk>
  12. Distribution: comp
  13. Date: Thu, 7 Jan 1993 17:45:17 GMT
  14. Lines: 46
  15.  
  16.  
  17. All very good suggestions.
  18.  
  19. Let me just take a minute to clarify my suggestions and why I think
  20. that I have a very easy way to go.
  21.  
  22. I already have a development environment setup on the sun that I can
  23. build mac programs using gcc and other unix development tools.  The
  24. startup sequence is similar to what you explain where code 0 and 1 are
  25. mac format and load a TOS (actually minix-st in my case) formated
  26. executable.  I have a Perl script which converts MPW headers into
  27. gcc headers and gcc glue routines to interface the mac roms.  You
  28. have a choice in whether you compile with the inline code interface
  29. if you compile with -ffixed-a5, or you can link in the glue routines
  30. which setup and restore a5.  Quickdraw globals are stored in the
  31. data section of the program.  A call to InitGraf causes (a5) to point
  32. to these globals.  There is nothing forcing the QD globals to be
  33. directly below a5.  The worst problem with this development
  34. environment is pascal callbacks.  It is easy to setup a5 when it
  35. it is needed, because it is stored in a global variable. But it
  36. is a pain to hand write the glue routine that converts the pascal
  37. format of the callback to the C format before calling the c
  38. callback routine.  But considering that we are trying to provide
  39. a free c compiler, I don't think people will complain to much
  40. over a few added hastles.
  41.  
  42. My suggestion was not to just have a TOS emulator for the mac, but
  43. that a TOS emulator would be a good place to start to get free
  44. development tools running on the mac.  This development environment
  45. could be used to develop mac applications that didn't need to run
  46. under this environment.  These mac programs would use the same
  47. techniques I descriped above.  Similar techniques have also been
  48. shown to work by MacMINIX.
  49.  
  50. So far I have Sozobon C running on my mac under my TOS emulator. It
  51. is able to produce atari programs that can run under the emulator (or
  52. a real atari I assume).  I haven't built any mac programs yet
  53. because I have to port over a few more tools from my unix environment.
  54.  
  55. I will post what I have to an archive site when I have removed my
  56. dependence on think-c libraries.  I would post it now except that
  57. I got scared by the copyright discusions recently that pointed out
  58. that think requires you to copyright your programs enought to
  59. protect their libraries.  I don't want to copyright this work.
  60.  
  61. Brad
  62.