Previous 1 2 Next 18 Replies Latest reply: Aug 9, 2008 7:27 PM by m1ss1on
Nadav Level 3 Level 3 (565 points)

Out of nostalgic reasons I would like to know what programming language is Mac OS 9 written in? Some people on here mentioned C, C++ or all assembly language. Given that the classic Mac OS goes back to the early 1980s(1984), can someone say that Mac OS 9 was or is written in all C,C++ or Assembly language?

Power Macintosh G4 MDD 1.25DP System w/ 2MB L3 Cache/2GB PC2600U, Mac OS X (10.4.11), Apple 4.7GB DVD-RAM Drive/BenQ 16x Superdrive/Plextor 16x Superdrive
  • a brody Level 9 Level 9 (64,780 points)
    The vast majority is written in C++, however, it is possible to write C and assembly language Mac OS 9 compatible applications. I would look at for more information.
  • Nadav Level 3 Level 3 (565 points)
    Is it possible to disassemble the OS and view the internal code, just to see how its written?
  • a brody Level 9 Level 9 (64,780 points)
    Not legally as far as I know. It is not open source, and the software is still licensed.
  • BDAqua Level 10 Level 10 (120,655 points)
    I thought it was mostly PASCAL!?
  • Simon Teale Level 5 Level 5 (4,680 points)
    up to System 6 was Pascal and bits of assembler. Then it was portions of C for the improvements to System 7 and onwards.

    I think System 8 promised to have all the Pascal re-coded into C (don't know about C++), so OS9 should have been C and assembler.

    There was a rumour that OS9 (and the early versions of OSX ran on Intel, project Star Trek. Read it in either MacUser or MacWorld. This would have been about 2000 or 2001, long before the move to Intel was announced. So C would have been a much more obvious choice for this.

    Whatever you attempt to do with OS9, it's worthless without an understanding of the Mac OS ROM, either the System Extension or the chip soldered onto the board.
  • orangekay Level 5 Level 5 (4,085 points)
    a brody wrote:
    The vast majority is written in C++

    Not true. Very little of the OS was object oriented, and not everything was translated from Pascal to C. They certainly provided plenty of glue code to make it all accessible from C, but numerous toolbox routines had to be called with Pascal conventions up to the very end.

    For reasons which baffle me to this day, ColorSync continues to rely on FSSpecs and their horribly limited Pascal style strings for file/path names, so you can break it pretty good if you try to load a profile whose path contains more than 255 characters.
  • Grant Bennet-Alder Level 9 Level 9 (53,060 points)
    There is one other important question you have NOT asked. Not only are parts written in C, Pascal, and PowerPC Assembler, but a great deal of the oldest Mac OS was the written in assembler for the Motorola 68000.

    To execute this 68000 code on a PowerPC, the code is translated \[some would say interpreted, others insist it is "compiled on the fly"] and cached in a modest-sized area of memory, then executed.

    So when debugging, you need to understand calling sequences from the appropriate compilers, and "Heap" data structure organization basically from Pascal, and Assembler language from PowerPC, and assembler language from 68000.

    The they switched to Intel processors, which count the bits and bytes from the other end of the registers.
  • Grant Bennet-Alder Level 9 Level 9 (53,060 points)
    The debugger for OS 4, 5, 6, 7, was called MacsBug. It was extended to support OS 8 and 9 as well. It can still be downloaded and installed under OS 9. It provides assembly-language support for debugging, inspecting registers and memory, disassembling small sections of memory, and setting breakpoints. It uses a minimal amount of System resources to do its job, but this also means it cannot do things like print on anything but an attached ImageWriter printer. Disassembling the entire Mac OS ROM with MacsBug is out of the question, but disassembling small portions to aid in debugging programs you have written is doable.

    What may help more is to get the developers documentation books -- Inside Macintosh Volumes I through V. These books discuss hardware and detail the original functions of each provided System Routine starting with the Mac Plus, and each later volume tells of the changes made to support later Macs. There are also other books on single subjects, such as
    Apple Technical Introduction to the Macintosh Family,
    Macintosh Programmer's Introduction to the Macintosh Family,
    AppleTalk Network System Overview, and
    Building Cards and Drivers for the Macintosh Family.
  • Simon Teale Level 5 Level 5 (4,680 points)
    just to add,

    The Inside Macintosh volumes were incredibly expensive (in the UK anyway) at the time, also (incredibly) heavy. Published by Addison-Wesley. I still have the Overview and the Toolbox Essentials, published later for System 7 programming (well that's why I bought them).

    I'm sure that these were all made available for download at a later stage, maybe from Apple. I can't remember exact details, but I do remember that feeling of disgust at having forked out £30-£50 for each of a large series of books and finding them posted online.
  • orangekay Level 5 Level 5 (4,085 points)
    I had the exact opposite reaction, namely disgust that Apple stopped selling printed documentation altogether. Despite the fact that I'll probably never use them again, I still have my well-worn copy of "Devices" next to Zobkiw's "A Fragment of your Imagination" on my shelf for sentimental reasons. Reading web pages just isn't the same--especially with XCode's horrendously slow help browser.
  • OneOrangeTree Level 1 Level 1 (80 points)
    Most Operating Systems are written in C

    Mac OS 9 is most likely written in C
    The Graphical Interface uses PowerPlant, Carbon

    Im surprised that people still use OS 9 in 2008!
  • BDAqua Level 10 Level 10 (120,655 points)
    Im surprised that people still use OS 9 in 2008!

    LOL, 2/3rds of my Work computers use OSes 10 years prior to OS9!
  • Simon Teale Level 5 Level 5 (4,680 points)
    Can you name one key "useful" piece of functionality that wasn't available in OS9 (and before) ?

    even Voice recognition and hand-writing recognition came in System 7.5.

    I only moved to OSX because of my dual CPUs and Delta Force: Black Hawk Down.
  • eww Level 9 Level 9 (52,975 points)
    Can you name one key "useful" piece of functionality that wasn't available in OS9 (and before) ?

    Hi, Simon. Do stability and bulletproof memory management count?

    I used to think OS 8.6 was rock-solid. It crashed far less often than any previous version, and I'd used them all. Even when it did, I was always back up and running normally in minutes. From years of practice, I knew exactly how to fix anything that went wrong, and I knew how to maintain my system so that hardly anything did — except memory fragmentation. There was no getting away from that until OS X, so in OS 8.6 and 9, I shut down or restarted my Macs every day to clear the memory, and sometimes I still ran afoul of RAM fragmentation.

    In Panther, my old Powerbook runs 24/7 for months at a time. I've had two KPs (due to hardware faults) and not one freeze in four years. I haven't learned how to fix whatever might ail OS X because nothing ever does. And the few apps I still need to use in Classic mode are actually happier running that way than they were in pure OS 9. Not everyone's experience of Classic, I know, but definitely mine.

    So yes, I think there's functionality in OS X that OS 9 didn't offer. It just works — all the time.
Previous 1 2 Next