`
`IBG 1035
`CBM of U.S. Patent No. 7,412,416 B2
`
`
`
`Copyright
`Copyright © 1982, 1983, 1984, 1985 Apple Computer, Inc. All Rights Reserved.
`20525 Mariani Avenue
`
`Cupertino, CA 95014
`(408) 996-1010
`
`This manual is copyrighted. Under the Copyright laws, this manual may not be copied, in whole
`or in part, without written consent of Apple. Under the law, copying includes translating into
`another language or format.
`
`Macintosh is a trademark licensed to Apple Computer, Inc.
`
`Apple, the Apple logo, the Macintosh logo, Macwrite, MacDraw, and MacPaint are trademarks of
`Apple Computer, Inc.
`
`Lisa is a registered trademark of Apple Computer, Inc.
`
`Simultaneously published in the U.S.A. and Canada.
`
`Limitation on Warranty and Liabilities
`Inside Macintosh is a working document used by Apple’s own programmers and developers
`which describes the hardware and software associated with the Macintosh computer. This is at
`preliminary edition that is incomplete and may contain errors. Apple itself does not rely solely on
`this document, butrather subjects all of its products to extensive testing prior to introduction.
`Further, Apple is continuing to improve its products and the contents of this manual may be
`obsoleted as a result of changes to Apple products. Accordingly, Apple makes no wananty that
`this manual is accurate or complete and notifies all readers that the specifications of its products are
`subject to change without notice.
`
`APPLE MAKES NO WARRANTY OR REPRESENTATION. EI'I'l-{ER EXPRESS OR
`IMPLIED, WITH RESPECT TO THIS MANUAL, ITS ACCURACY, CONTENT,
`MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT,
`THIS MANUAL IS SOLD “ AS IS" AND YOU, THE PURCHASER, ARE ASSUMING THE
`ENTIRE RISK AS TO THE USE OF AND RELIANCE ON THIS MANUAL.
`
`IN NO EVENT WILL. APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL,
`INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR
`OiVlI.;5SION IN THIS MANUAL, even if advised of the possibility of possible damages resulting
`there rom.
`
`No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition
`to this warranty.
`
`‘ Some states do not allow the exclusion or limitation of implied warranties or liability for incidental
`or consequential damages, so the above limitation may not apply to you. This warranty gives you
`specific legal rights, and you may also have other rights which vary from state to state.
`
`0002
`
`
`
`12
`
`Quickbraw Programmer's Guide
`
`The Bit Ims e
`
`A bit image is a collection of bits in memory which have a rectilinear
`representation.
`Take a collection of words in memory and lay them en
`to end so that hit 15 of the 1owest—numbered word is on the left and
`
`Then take this
`bit ¢ of the highest-numbered word is on the Ear right.
`array of bits and divide it, on word boundaries,
`into a number of
`equal-size rows. Stack these rows vertically so that the first rou is
`on the top and the last row is on the bottom.
`The result is a matrix
`like the one shown in Figure 5 - rows and columns of hits, with each
`row containing the same number of bytes. The number of bytes in each
`row of the hit image is called the row width of
`that image.
`
`FiJ“31i
`
`Byte
`
`-ulumvnlnnllll
`
`Figure 5.
`
`A Bit Image
`
`A bit image can be stored in any static or dynamic variable, and can be
`of any length that
`is a multiple of the row width.
`
`The Macintosh screen itself is one large visible hit image.
`
`The upper
`
`21,888 bytes of memory are displayed as a matrix of 175,194 pixels on
`the screen, each bit corresponding to one pixel.
`If a bit’s value is
`0, its pixel is white; if the bit's value is 1,
`the pixel is black.
`
`The screen 13 3&2 pixels tall and 512 plxels wide, and the row width of
`its bit image is 64 bytes.
`Each pixel on the screen is square:
`there
`are 72 pixels per inch in each direction.
`
`( hand)
`
`Since each pixel on the screen represents one bit in a
`hit image, wherever this document says "bit", you can
`substitute "pixel" if the hit image is the Macintosh
`screen. Likewise,
`this document often refers to pixels
`on the screen where the discussion applies equally to
`bits in an off-screen hit
`image.
`
`3/2/33 Espinosa-Rose
`
`/QUICKfQUIKDRAH.2
`
`0003
`
`
`
`16
`
`Memory Hanager Prograner's Guide
`
`variable
`
`names:
`
`12aa<:s1F|=|=u=
`' ""' <""°’"7°P? 512K: $?FFFF
`
`{
`
`512K.‘ 87A?-'00
`
`% (EUIPW)
`
`oppiicelion parameter:
`appiication global:
`
`(__ A5 3 tcmenms)
`
`‘""‘A5’
`(—- (CLISIBCKBOSB)
`
`application heap
`1‘
`,
`éffiér 12;?"{
`2816 {
`trap. dispatch table
`
`system global: and
`
`'
`
`<—- (HCODEM)
`
`<— (AnoI2or:e)
`
`% (syszone)
`
`5300
`
`Figure 9. Macintosh RAM Organization
`
`At (almost) the very end of memory are the main sound buffer, used by
`the Sound Driver to control the sounds emitted by the built-in speaker
`and the Disk Driver to control disk motor speed, and the main screen
`buffer, which holds the bit image to be displayed on the Macintosh
`screen.
`The area between the main screen and sound buffers is used by
`the System Error Handler. Note that the addresses of these buffers are
`different tor dif£erent'a1zed computers.
`
`There are alternate screen and sound buffers for special applications.
`If you use either or both of these,
`the space available for use by your
`application is reduced accordingly.
`The Segment Loader provides a
`routine for specifying that an alternate screen or sound buffer will be
`Ufiflde
`
`The memory organization of a Lisa running Macworirs is shown in Figure
`19.
`
`10f9l8la
`
`chernicofE—Hacker
`
`(HEM.-MGR/MEM.I.2
`
`0004
`
`
`
`size (bytes)
`
`W {
`
`MEMORY ORGANIZATION
`
`1?
`
`hardware interiace
`
`morn sound butter
`
`6" (MemTOD)
`(____ (Burn)
`
`$12K: $2-‘B000
`‘M: ‘CF86
`51 2K1 $4EF83
`1“: SCECBS
`em mas
`
`application porernetera
`
`(— A5 = (CurrentA5)
`
`'
`
`stock
`
`_~"‘-
`1*
`'
`T appincetlan heap
`
`6' ‘A5’
`(— (CurStockBasc)
`
`:(--SP=A7
`
`‘
`
`€-- meepena)
`
`€" (ADDIZOHC)
`
`$CDUD
`
`6-— (Sy:2one)
`
`$800
`
`-igure 1%. Lisa RAM Organization
`
`HEMORY MANAGER DATA STRUCTURES
`
`This section discusses the internal data structures of the Memory
`Manager. You don't need to know this information if you're just using
`the Memory Manager routinely to allocate and release blocks of memory
`from the application heap zone.
`
`Structure of Hang Zones
`
`Each heap zone begins with a 52-byte zone header and ends with a. 12-
`byte zone trailer (see Figure 11).
`The header contains all the
`information the Memory Manager needs about that heap zone;
`the trailer
`is just a miniuuu-size free block (described in the next section)
`placed at the end of the zone as a marker. All
`the remaining space
`between the header and trailer is available Eor allocation.
`
`10[9l8A Cherniooff-Hacker
`
`/MI-2H.H.GR/I-IE!-1.1.2
`
`0005