You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

What language is OS 9 written in?

Hello,

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

Posted on Jul 14, 2008 8:25 AM

Reply
18 replies

Jul 14, 2008 1:28 PM in response to BDAqua

Yeah,
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.

Jul 19, 2008 1:04 PM in response to a brody

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.

Jul 19, 2008 1:48 PM in response to Nadav

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.

Jul 21, 2008 3:36 PM in response to Grant Bennet-Alder

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.

Jul 22, 2008 12:56 AM in response to Grant Bennet-Alder

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.

Jul 22, 2008 4:20 PM in response to Simon Teale

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.

Jul 28, 2008 9:37 AM in response to Simon Teale

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.

Jul 28, 2008 2:21 PM in response to eww

These are useful qualities. And my OSX's have been up for months at a time (aside from having to reboot 6 times to install Canon printer and scanner drivers - why?). Two are web-servers (internet and intranet) as well as doing a useful day job (you can do that with 8 cores).

But I can't think of any must-have functionality provided by OSX over OS9, maybe why it takes some of us years to move from OS9 and before.

Microsoft have it the same, Win 98 and Win 2000 still make up an sizeable volume of their corporate user base. And you can see why, 98 was fast and quite reliable, 2000 did it's job well. XP meant new hardware for nearly all, just at a time when there wasn't budget to upgrade thousands of PC's. Somehow nearly everyone managed to get off NT.

What language is OS 9 written in?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.