The first Mac: resources, toolbox, and esoteric

This is a very superficial journey through the first Mac-native operating system. It is not as simple as it seems. And, and to me it just seems it is something very similar to the first iPhone. In both cases, overcoming the force of gravity, and compromise the original engineering decisions that made the impossible possible.

The sequel, start here.

Before we move on to describe the innards of a Mac-native operating system, will say a few words in defense of the iron first Mac. Its configuration 128K/400K was absolutely insufficient, that is insufficient for computer with a graphical user interface – require a much more expensive circuitry, than you can afford.

The average amount of RAM then computers were 64K, and drives on floppy disks, used in industry usually contain less than 200 K.

Branch resources (Resource Fork)

The concept of splitting the files into several parts not invented by Apple. Anything remotely similar was used at Xerox PARC, Novell Networks, and even in Windows, but nowhere is this idea was not so bright and unusual embodiment, as in the classic Mac-native system.

File in Mac-native system consisted of two branches, branch data (Data Fork) and branch resources (Resource Fork), any of which could be empty. All file system objects – documents, applications, and documents system – consisted of these two branches and actively used.

Branch data did not differ from a regular file on other systems, the structure and content of this part of the file determined by the application that created the file. In applications, usually, the offshoot of data was empty.

As an offshoot of the resources was built according to the rules defined by Apple Computer and author resource Manager Bruce Horne.

Types (groups) of resources designated by constants of type OSType, which value was a number, but on the screen appear as a sequence of 4 letters. For example, CODE, DLOG, ALRT, BNDL and many others.

The numeric identifier is a two byte integer with values from 128 to 32767 is intended for use by third-party developers. Values from -32768 to -16385 was (and remains forever) is reserved for something unknown.

The rest was reserved for system resources, it is invisibly present during the operation of the application, and score resources offer her their would be bad form and system resources that were the property of other system resources.

In addition to the type and ID, a resource can be called “human” name, but the name was optional. The name can be used to specify the requested resource.

The size of the resource in the first versions of the system was strictly limited to 32 kilobytes. Later this restriction was removed – specific to Microsoft code resource PCOD pulled in 2.5 Excel or Word 5.1 a couple of megabytes. But, even in 32 kilobytes, you can attach a lot of things, although the resources of the first system for the very first Mac and their size was much more modest.

System memory management in Mac-native system was innovative and advanced in 1984, she (has not changed for 12 years) looked quite archaic in 1996, compared to the same system in Windows. But in 1984, she, especially her special approach to boot to operating system resources was on top. If the configuration resource is permitted, it is removed from memory at the first sign of its lack. Structure, which it had been submitted in the application was responsible for loading it into memory on demand.

Resources would be something boring, if not ResEdit, a free app from Apple.

It opened a completely unexpected and fantastic views of the underside of the Mac devices applications and documents. Below are the flip side of the TeachText application, free and even open source simple text editor for classic system. In 1984, it wasn’t, but MacWrite, MacPaint and ResEdit looked like this.

The BNDL resource, for example, linked the app with the icon (icons) itself, but also with the types of editable file types, and assigned these file types icons.

This resource interacting with other resources of different types, and all these connections it was possible to determine, by using ResEdit, all in one place. Find out who came up with ResEdit, alas, failed.

In the illustration (colour of the Apple menu is removed in any of 7 versions) BNDL TeachText application to add support for another file type, ttwo. Actually TeachText (type code application ttxt) knew how to work with files of type TEXT and write protected the files of type ttro. Adding a new type of supported files only BNDL virtually meaningless: support is provided in the code.

By analogy with the ttro, we can assume that adding format – ttwo – only allows to create files, which then cannot be read.

In the document, for example, the same TeachText (code Creator = ‘ttxt’, File code = ‘TEXT’) resources, most likely, showing the size and position of the document at the time of closing, to all of you to start exactly from the place where the last time it ended.

Branch resources are not included in the functionality of Mac OS X. Apple Computer, in the last years of the Millennium, had no impact on the industry. Thought she was still a dying company. Technically, the file conversion with two branches in the file directory (a copy of the branch data) and directory (copy resources) was easy, and maintain such systems in a system without branches is not a nuclear physics.

Apple would not be able to achieve the movement towards the other side. Without the support of others ‘ systems no technical solution would not have worked. In addition, the company was very bad with resources, acute shortage of time – it did not spend at what you can do. In NeXTSTEP used a vaguely similar but different approach to applications, it was moved to Mac OS X one to one.

Toolbox, System and spirituality

Experts (not the “experts” disappointed by the absence of the alien in case the Mac), familiar with graphical user interfaces are not hearsay, surprised how Apple managed to make it work in 128 K of RAM and 400 disk. Magic?

Graphical user interfaces have long been not just a theory. They existed not only in laboratory homunculus, they already tried for the role of commercial projects at Xerox PARC (Alto and others) and Apple (Lisa). Attempts were delightful, but from the point of view of banal erudition to anything but disappointment, failed. The concept was recognized as a vicious, senseless and unrealistic. Beautiful, Yes. Fascinating. But just don’t do it!

Mac was the flesh of a typical computer of its time. Two times more powerful and Packed than the average in the time machine for a home user. But nothing extraordinary: a 32-bit CPU, mouse, 24-bit addressing and 16-bit bus. Cool, but nothing more. Was cars and powerful.

That could do to Apple, it was logical and verified to the last detail, as a brilliant film made by the brilliant Director, does not leave anyone indifferent. But the main miracle was behind the scenes to an outsider. It is different from the Mac from its counterparts of the time. The complex software.

In the technical documentation of the project is split into two parts: the observed as and system utilities. The observed as – this is the graphical user interface. It’s different “managers”, such as QuickDraw, event managers, Windows, menu. Everything that was not included in the observed as, file system, memory management, interaction with internal and external devices, etc. – called system utilities.

Low-level system utilities were written in asm, Assembly language Motorola 68000. By the way, it is a decent language, I am sorry that he is useless. A typical Assembly language, but… Stop. In asm I wrote my first Mac ovsky program.

Managers observed as was developed and brought to perfection in Apple Pascal is an object-oriented variation of Pascal, developed by Niklaus Wirth and Larry Teszler. Then, Apple turned Pascal into machine code (asm is the same, almost), parts Manager that was optimized (in size) manually. Actually, this is one of the practices is strictly prohibited to make changes to machine code – but otherwise the Mac would not exist.

Engaged in squeezing of the code (without any loss of functionality) Andy Hertzfeld. It is similar with the distillation of alcohol-containing liquids… In some cases, as a result of “rectification”, the executable code has been reduced by 3-4 times. Esoteric practice. This requires, at the same time, pedantry and creativity.

The pros are obvious: a huge amount of cloud software squeezed into a narrow reality cheap computer. Cons, I think, is also understandable. Imagine that carefully debugged code on Pascal, you will need to make a major change, and this happens in every complex project… the Whole module and then do it all over again!

This practice was followed in the development of all versions of the System, including System 6. First version no esoteric System became 7. If System 6 together that runs quietly fit in 1 MB of RAM, System 7 one, only, required at least half a megabyte.

Esoteric practice is remembered in the development of Newton. The role of the Apple Pascal played Dylan, the role of the asm – C++.

A significant part of the compressed code had to be placed on the ROM chip. This code permanently available (no loading into RAM) and does not take up disk space. The memory capacity of the ROM chips had to be 64K.

The cons are obvious: for the price reduction, the ROM chip with sewn in it code should be produced in huge numbers. The detection of serious problems to fix it on the chip impossible. Only to release again. Expensive, but that’s not all. Even to collect a new sample for replication – not a task for one day.

And what to do with “bad” chips? To force those who already bought a Mac, drag it to the dealer? Or the user needs to personally tear out the old chip and solder another one in place?

Such troubles have been provided code in ROM could be intercepted, it could completely replace the code in the system file, or add the healing code before the ROM or after this treatment.


In the observed as in system tools a lot of fantastic code, but the main system with a graphical user interface library – is the one that draws on the computer screen. QuickDraw. Library, written by bill Atkinson.

QuickDraw is not just doodling, she made the interface elements respond to user actions: the objects on the screen flickered, changed color. After multiple optimization and compression (manually) QuickDraw took up very little space. Less than any calculator these days. A large part of the QuickDraw was located in ROM.

Bill has resulted in Apple JEF Raskin, the man considered “father Mac”. Atkinson while studying at University, enrolled in a course of lectures by JEF Raskin about the theoretical foundations of the graphical user interface. The most important part of the graphical interface, of course, is a graphics library. In Ruskin’s lectures this library was called QuickDraw. Graphics library Mac and bill was named in honor of JEF Raskin.

With the first Mac om was supplied by two programs, MacPaint and MacWrite. MacPaint, in fact, bill Atkinson wrote for testing and debugging the graphics library.

Atkinson was allowed (!) company to distribute it with MacPaint, if Apple won’t take the money. Apple agreed. Here it is, the steel grin of capitalism!

The last days of the Macintosh project

Completion of the Macintosh project was scheduled for mid-January. 24th, as we now know all, the Mac was officially presented to the public, applause and opened a new era in the history of computing.

Steve jobs a few days before the latest deadline that is assigned to the software developers the Mac, all gathered in the conference room. The people were set to once again postpone the release of the product in the big world, at least for a few weeks.

Jobs listened to all and said “In a few weeks you will not have time to do what did not finish in months. Mac should be released now or never. With all the flaws that he has and won’t be able to fix it in the next few days.”

In the last day, at 7:00 am, for a pattern to replicate on the ROM was supposed to come with the courier. After this time the team was advancing a week off.

The last bug was discovered at 6:30 that historic morning.

Jerome cunén, head of group of software developers of the Macintosh project, decided to provide a sample for the ROM in the allotted time. He decided that a demonstration could be held without the fix of this bug (which he thought was very serious), and then fix it with a bypass in the system.

Jobs, 7 in the morning rushed into the office, got acquainted with the problem and saying “thank you”, sent a team to relax until January 24. The first users with the first months found in a Mac a lot of problems, but this last never noticed.

What became known as System Software 1.0, in fact the team was considered a very late beta version, 0.97.

0 Comments on “The first Mac: resources, toolbox, and esoteric”

  1. I like the helpful info you provide in your articles I will bookmark your weblog and check again here regularly s newone2017

  2. Anil ji agar aapane apane phone me Apple Account login kiya hoga to yaha se usako trace kar sakate hai apple in icloud find my iphone s apple in icloud find my iphone

Leave a Reply

Your email address will not be published. Required fields are marked *