System Error Alert Table

From Computers Wiki
Revision as of 00:58, 25 September 2025 by Huntertur (talk | contribs) (Add notes)
Jump to navigationJump to search

The System Error Alert Table (resource type DSAT, allegedly short for Deep Shit Alert Table) describes startup text and fatal error dialogs for the classic Mac OS.

Specification

See Inside Macintosh: Operating System Utilities, Chapter 2 - System Error Handler, The System Error Alert Table Resource.

Reading it

ResEdit doesn't support DSAT and only shows a hex editor despite having a custom icon for the resource type.

Here is an extremely rough Python script for dumping the alerts, their IDs, and their error messages. Despite DSAT definitions being polymorphic, there is no type information, so it determines what is an alert by process of elimination (correct size, text pointers are valid, pointed-to text is ASCII). Copy-paste the hex editor output from ResEdit into a text file, then pass its filename to this script:

dsat.py contents

from argparse import ArgumentParser
from pathlib import Path
import struct
from typing import NamedTuple

parser = ArgumentParser()
parser.add_argument('hexfilepath')
buffer = bytes.fromhex(Path(parser.parse_args().hexfilepath).read_text())
offset = 0

def read_short():
    global offset
    number = int.from_bytes(buffer[offset:offset + 2])
    offset += 2
    return number

definition_count = read_short()
definitions: dict[int, 'Definition']

class Alert(NamedTuple):
    text1_id: int
    text2_id: int
    icon_id: int
    proc_id: int
    button_layout_id: int

    @property
    def text1(self):
        return definitions[self.text1_id].as_text().replace('/', '\n') if self.text1_id else None

    @property
    def text2(self):
        return definitions[self.text2_id].as_text().replace('/', '\n') if self.text2_id else None

    @property
    def text(self):
        if not self.text1:
            return None

        if self.text2:
            return self.text1 + '\n' + self.text2

        return self.text1

class Definition(NamedTuple):
    id: int
    data: bytes

    def as_alert(self):
        return Alert(*struct.unpack('>HHHHH', self.data))

    def as_text(self):
        return self.data[4:-1].decode('ascii')

def read_definition():
    global offset
    id = read_short()
    length = read_short()
    data = buffer[offset:offset + length]
    offset += length
    return Definition(id, data)

default_alert = read_definition().as_alert()
definitions = {(definition := read_definition()).id: definition
               for _ in range(definition_count)}

for error_id, definition in definitions.items():
    if len(definition.data) == 10:
        alert = definition.as_alert()
        try:
            print(error_id, '-', alert.text)
        except (KeyError, UnicodeDecodeError):
            pass

print('Default - ', default_alert.text)

Notes

  • The System Error Alert Table isn't just for fatal errors! The text below shows that the Force Quit dialog, among other things, is implemented here.
  • Sometimes, there is no error text, or the text is cut off; I assume this is due to a custom procedure being used for that alert.
  • Entries in the table are not in order.

Contents in different system versions

Mac OS 9.2.2

DSAT ID = 0
Error ID Text
102 This startup disk will not work on this Macintosh model. Use the latest Installer to update this disk for this model.
104 This disk must be unlocked in order to perform one-time housekeeping. If you wish to use this disk to start your Macintosh, unlock it.
116 This startup disk will not work on this computer. A Power PC based computer is required to startup from this disk.
118 The system software on the startup disk only functions on the original media, not if copied to another drive.
105 System 9.2.2 needs more memory to start up.
Default Sorry, a system error occurred.
DSAT ID = 2
Error ID Text
28 Sorry, a system error occurred.
25 Not enough memory is available while using
42
20000 If you wish to continue using your Macintosh, press Restart. If not, press Shut Down.
20001 It is now safe to switch off your Macintosh. If you wish to continue using your Macintosh, press Restart.
20002 Clicking Force Quit causes you to lose any unsaved changes. To avoid further problems, restart your computer after you click Force Quit.
99 The System file on this startup disk may be damaged. The Installer can be used to repair this disk.
98 The System file on this startup device does not contain the resources necessary to boot this Macintosh. Please use the Installer to update the System file.
101 Sorry, a system error occurred.

RAM parity

20010 Hard Disk Cable Warning

You must first shutdown the Macintosh before attaching any SCSI hard disk cables. Disconnect the cable from the back of the machine right now.

1010 Code Fragment could not be prepared.
1011 Internal Mixed Mode failure.
Default Sorry, a system error occurred.