Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Q&As > Hardware & Drivers > Apple Hardware >

Determining RAM size & location in New World Machines


Q: How is RAM size & location determined in New World Machines?

A: RAM size and location can be determined by looking at the reg property of the device tree's "/memory" node in Open firmware. Means for selecting nodes and displaying properties in the device tree in Open Firmware are described in TechNote 1061 "Fundamentals of Open Firmware, Part I: The User Interface".



      0 > dev /memory  ok
      0 > .properties
      name                    memory
      device_type             memory
      reg                     00000000  00000000
                              00000000  08000000
                              08000000  10000000

Figure 1. /memory, reg property in OF



Within Mac OS, using a tool like the Display Name Registry, IOReg or IORegistry Explorer, also shows that the device node "memory" has a property "reg" and that "reg" contains multiple groups of 8 bytes (64 bits) that collectively define the physical memory for that particular Macintosh. For example (in Figure 1 above), on the current PowerMac G4, "reg" shows 24 bytes (or 3 groups of 8 bytes). Each of the 64 bit words defines the physical "memory slots" in the machine. Starting from right to left (top to bottom) the first 32 bit word is the "starting address" and the next 32 bit word is the "length" for the first slot.

This means that every other 32 bit word contains the "length" or size of the memory in each of the three slots in the PowerMac G4.

Breaking down the example above, the first slot has no memory. The second slot has a starting address of 0 and contains 128MB (08000000 hex) of memory. The third slot has a starting address of 08000000 (hex) and 256MB (10000000 hex) of memeory. This gives the PowerMac G4 a total of 384MB of physical memory.


[Aug 01 2001]