http://mcosre.sourceforge.net/docs/tech_notes.html
10/25/2007

M c O S   R e

Technical Notes
 
[Home] | [About McOS Re] | [FAQ] | [Changes] | [Progress] | [Documentation] | [Links]


"Inside Macintosh only mentions
the alternate screen buffer
in two places."

 

"When Hierarchical Filing System came
out, it provided a true folder structure."


 

SysVersion

The value of low-memory global variable SysVersion ($15A), and therefore the vaule returned by "sysv" Gestalt selector, is $0987 when running McOS Re (all versions).

Handles

A handle is a relocatable block of memory, referenced by an indirect pointer (an address of an address).

24-bit Memory Manager: flag bits of a master pointer

68k
leftmost byte
68k
long word
PPC
(byte / 32-bit word)
 
7th bit31st bit0th bitlocked
6th bit30th bit1st bitpurgable
5th bit29th bit2nd bitresource

 
Example:

    BCLR        #7,(A3)             * unlock a handle in A3

[68k] $xx(A6) -> param


    LINK        A6,#x               * SP = A6+#x (note: #x is usually negative or 0)
    MOVEA.L     $0(A6),A2           * old A6
    MOVEA.L     $4(A6),A1           * return address
    MOVEA.L     $8(A6),A0           * param #last
    MOVE.L      $C(A6),D0           * param #last-1
    MOVE.L      $10(A6),D1          * param #last-2
    ...

Partition type strings

Names that begin with Apple_ are reserved for use by Apple Computer, Inc. Names shorter than 32 characters must be terminated with the NUL character.

Apple_partition_map partition contains a partition map
Apple_Driver partition contains a device driver
Apple_Driver43 partition contains a SCSI Manager 4.3 device driver
Apple_MFS partition uses the original flat Macintosh File System
(64K ROM version)
Apple_HFS partition uses the Hierarchical File System implemented in 128K
and later ROM versions
Apple_Unix_SVR2 partition uses the Unix file system
Apple_PRODOS partition uses the ProDOS file system
Apple_Free partition is unused
Apple_Scratch partition is empty

 
HFS+ Wrapper Volume

Wrapper Volume is a Mac OS Standard volume that wraps around the Mac OS Extended volume. It is required for backward compatibility and to startup from the Mac OS Extended volume.

Usual HFS+ Wrapper: software locked, 5 files, 1 directory, blessed dir id = 2 (root directory).

Boot Stages

  • Open Firmware stage (for OF-based systems only)
  • ROM stage (Boot ROM, ROM Toolbox, ROM resources)
        [The PowerPC nanokernel and the 68k emulator are initialized during this stage.]
  • Boot blocks stage
  • HFS to HFS+ bootstrap stage (for HFS+ volumes only)
  • System file stage (System file code and resources)
        [Current PowerPC nanokernel may be replaced with the System file's one at this stage.]
  • INIT stage (INITs, cdevs, RDEVs)
  • BootUp (Finder) launch

System Extensions

When the System boots, it opens your INIT file with OpenResFile, then it executes all of the INIT resources in that file. When it's done, it does a CloseResFile.
ANY INIT RESOURCES STILL OPEN FROM THAT FILE WILL GET RELEASED!
(This means that any code you have in the INIT will be marked as free on the heap.)

System 6: "INIT" #31   |   additional INITs, cdevs,

System 7: "boot" #3    |   RDEVs load code

INIT resources must be marked locked because INIT #31 does not lock them.