You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add New World ROM Layout notes.
Add New World Firmware version notes.
Add punctation.
Move mention of OF main fcode image from the Open Firmware kernel description section to the boot process section.
| Recovery | rec | 0xfff08000 | 0x00078000 | Usually same as ROM Image. |
42
+
| Rom Image | boot | 0xfff80000 | 0x00080000 | Usually same as Recovery. |
43
+
| System Configuration | sys | 0xfff03f00 | 0x00000080 | Contains Model specific info. Doesn't exist in early New World Macs. Three bytes in the System Configuration comprise the Mac Product ID. |
44
+
|| tst | 0xfff03f80 | 0x00000080 | Contains unit specific info: Serial Number, MAC address. |
45
+
| NVRAM | nv | 0x00004000 | 0x00004000 | Contains two copies of NVRAM, 8K each. |
46
+
47
+
At the beginning of the Recovery and Rom Image is a header listing subsections. The list differs depending on the firmware version.
48
+
49
+
The earliest New World ROMs include all of Open Firmware (main fcode image and driver fcode images) in the Open Firmware subsection. RTAS is an fcode image.
50
+
51
+
| Offset | Index |@startvec address field |@startvec size field |
Starting approximate 2002-11-11 and later, this is the ROM header or first part of @startvec. Different Macs with the same firmware version may include different driver fcode images if the ROM is not large enough to contain all drivers.
80
+
81
+
| Offset | Index |@startvec address field |@startvec size field |
The offset for each of the parts is at least 4 byte aligned and has the least significant bit set to 1 if it is lzss compressed.
116
+
Only early New World Macs (B&W G3, iMac G3 233-333, PowerBook G3 Lombard) have the RTAS (fcode) and RTAS-BE (executable) parts.
117
+
There don't appear to be any ROMs that have NUB, RTAS_LDR, or RTAS-LE.
118
+
RTAS is not included in later ROMs so the four parts 3-6 are always 0x00000000 for offset and size.
119
+
Since Recovery is smaller than Rom Image, some newer ROMs have BOOT-BEEP of the Recovery section pointing to BOOT-BEEP of the Rom Image section.
120
+
121
+
The `>dir.*` fields in the ROM are for the offset and size of the compressed parts. The `>dir.*` fields also exist in RAM starting from `@startvec` but they store the address and size of the parts uncompressed.
122
+
27
123
## Open Firmware Versions
28
124
29
125
### Old World Macs
@@ -39,9 +135,44 @@ as found in various Power Macintosh models.
39
135
| Power Macintosh 6500 | Gazelle | 2.0.3 | 0x330000 |
40
136
| Power Macintosh G3 v3 | Gossamer | 2.4 | 0x320000 |
Newer firmware versions occasionally received firmware updates which could be applied to multiple models so it doesn't make sense to associate a model to a firmware version.
147
+
Versions 4.x.x are for 32-bit Power Macs. Version 5.x.x are for 64-bit Power Macs.
148
+
149
+
| Date | OF version |
150
+
|:----------:|:----------:|
151
+
| 2000-02-17 | 3.2.4f1 |
152
+
| 2000-07-10 | 3.2f1 |
153
+
| 2000-08-11 | 3.2.7f2 |
154
+
| 2001-03-20 | 4.1.7f4 |
155
+
| 2001-03-21 | 4.1.8f5 |
156
+
| 2001-08-01 | 4.2.3f1 |
157
+
| 2001-08-16 | 4.2.5f1 |
158
+
| 2001-09-14 | 4.1.9f1 |
159
+
| 2001-10-11 | 4.2.8f1 |
160
+
| 2001-11-20 | 4.2.9f1 |
161
+
| 2002-09-30 | 4.4.8f2 |
162
+
| 2002-11-11 | 4.5.4f1 |
163
+
| 2003-02-20 | 4.6.0f1 |
164
+
| 2003-08-22 | 4.6.8f4 |
165
+
| 2003-11-21 | 5.1.4f0 |
166
+
| 2004-04-06 | 4.8.5f0 |
167
+
| 2004-09-21 | 5.1.5f2 |
168
+
| 2004-09-23 | 4.8.7f1 |
169
+
| 2004-10-26 | 5.1.8f7 |
170
+
| 2005-01-21 | 4.9.1f1 |
171
+
| 2005-03-23 | 4.8.9f4 |
172
+
| 2005-07-12 | 4.9.4f1 |
173
+
| 2005-09-22 | 4.9.5f3 |
174
+
| 2005-09-30 | 5.2.7f1 |
175
+
| 2005-10-05 | 4.9.6f0 |
45
176
46
177
## Packages
47
178
@@ -235,38 +366,40 @@ dumpstartvec
235
366
236
367
Apple's Open Firmware contains a small kernel implemented in the native PowerPC code. This kernel performs the following actions:
237
368
238
-
* set up memory translation for OF execution
239
-
* relocate itself from ROM to RAM
240
-
* initialize Forth runtime environment
241
-
* recompile OF main image from FCode to native PPC code
242
-
* pass control to recompiled OF that starts building the device tree
243
-
* process low-level exceptions
369
+
* Set up memory translations for OF execution.
370
+
* Relocate itself from ROM to RAM.
371
+
* Initialize the Forth runtime environment which includes a dictionary of words. All words are native PPC code.
372
+
* Interpret Forth or fcode which adds more words (with PPC code) and data to the dictionary.
373
+
* Process low-level exceptions.
244
374
245
375
## Open Firmware and the Macintosh boot process
246
376
247
377
### Old World Macs
248
378
249
379
1. In response to power coming on, HWInit code in the Power Macintosh ROM performs initialization of the memory controller and the basic I/O facilities as well as some self-testing. After that, the startup chime is played.
250
-
2. HWInit passes control to Open Firmware kernel that prepares OF execution from RAM. OF builds the **device tree** - a platform-independent description of the attached HW.
251
-
3. OF returns control to HWInit that initializes several low-level data structures required by the Nanokernel.
252
-
4. HWInit passes control to the Nanokernel that initializes the native execution environment and the 68k emulator.
253
-
5. 68k emulator executes the start-up code in the Macintosh ROM that initializes various managers.
254
-
6. The device tree generated by the Open Firmware in step 2 is imported by the Expansion Bus Manager initialization code and stored in the **NameRegistry**.
255
-
7. An operating system is located and loaded.
380
+
2. HWInit passes control to Open Firmware kernel that prepares OF execution from RAM. `cold-load` is executed.
381
+
3.`cold-load` begins interpreting of the main fcode image (`@startvec``>fcimage`) compiling words to PowerPC code and building the **device tree** - a platform-independent description of the attached HW. The main fcode image and driver fcode images (`@startvec``>fcfiles`) are interpreted from ROM.
382
+
4.`cold-load` passes control to `@startvec``>'cold-init` which tests for snag keys, optionally executes `nvramrc`, and boots the OS (either by returning to HWInit or executing a `boot` command) or enters the Open Firmware command line.
383
+
5. OF returns control to HWInit that initializes several low-level data structures required by the Nanokernel.
384
+
6. HWInit passes control to the Nanokernel that initializes the native execution environment and the 68k emulator.
385
+
7. 68k emulator executes the start-up code in the Macintosh ROM that initializes various managers.
386
+
8. The device tree generated by Open Firmware in step 3 is imported by the Expansion Bus Manager initialization code and stored in the **NameRegistry**.
387
+
9. An operating system is located and loaded.
256
388
257
389
### New World Macs
258
390
259
-
*TBD*
391
+
The PowerPC part is similar to Old World Macs except the Open Firmware and OF Driver subsections need to be decompressed into RAM.
392
+
For Classic Mac OS, Open Firmware loads and boots a file of type `tbxi`. This is a New World ROM file in the System Folder which replaces the first 3MiB of the Old World ROM.
260
393
261
394
## Open Firmware bugs
262
395
263
396
Apple OF is known to contain numerous bugs. The following table lists some recently discovered bugs, not mentioned elsewhere.
264
397
265
398
| OF version affected | Bug description |
266
399
|:-------------------:|-----------------|
267
-
|2.0f1, 2.4| A numerical overflow in `um/mod` used by `get-usecs-60x` causes the OF console to become unresponsive after approx. 71 minutes. You have to restart your computer once the bug is triggered. |
268
-
|1.0.5| /chaos/control `fill-rectangle` is ( ? color y x w h -- ) instead of ( color x y w h -- ) |
| 2.4 | string literal buffers `"` on the command line are 256 bytes but will overflow if you enter more than 256 bytes. |
400
+
|1.0.5|`fill-rectangle` in /chaos/control is ( ? color y x w h -- ) but it should be ( color x y w h -- ). This is corrected by Control2.c of BootX which is used to boot Mac OS X. |
401
+
||`$find` is ( name-str name-len -- xt true | pstr name-str name-len false ) but it should be ( name-str name-len -- xt true | name-str name-len false ) |
402
+
|2.0f1, 2.4|`us` uses `get-usecs` to convert a 64-bit timebase value to a 32-bit microseconds value. That's enough for 71 minutes. After that, anything that uses `us` will cause the OF console to become unresponsive requiring a restart. In Open Firmware 3.x and later, `get-usecs` returns a 64-bit value.|
403
+
| 2.4 | string literal buffers `"` on the command line will overflow if the string is more than 256 bytes. |
271
404
272
405
`get-inherited-property notes.txt` discusses known bugs regarding get-inherited-property and map-in in Open Firmware 1.0.5.
0 commit comments