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