This guide describes the workflow for contributing to the project and understanding the codebase structure.
OS/: Kernel and core services.Drivers/: Hardware drivers.Interfaces/: Public API headers.Internal/: Private headers and stubs.Make/: Build configuration.Build/: Generated artifacts (created during build).
The codebase follows Apple's internal style from the early 90s.
- Languages: Pascal, C, Assembly (68k).
- Naming: PascalCase is dominant (e.g.,
InitWindows,NewPtr). - Comments: mostly
/* ... */in C,(* ... *)in Pascal,;in Assembly.
- Identify the appropriate module in
OS/orDrivers/. - Add your source file (e.g.,
.cor.a). - Update the
Make/MainCode.Makefile to include your new object in the link list.- Tip: You can use
patch_makefile.shlogic to append it if you don't want to edit the makefile directly.
- Tip: You can use
- Locate the source file.
- Edit the code.
- Run
./build_system7.shto rebuild.
Since this is a cross-compiled OS kernel, debugging is challenging.
- Emulation: Run the built image in a Macintosh emulator (e.g., Mini vMac, BasiliskII, MAME).
- Debug Output: You can write to a specific memory address or use a serial driver (if implemented) to log messages.
- Stubs: Use
Internal/C/MiniFinder.cto create simple test harnesses that run immediately after boot.
There is no unit test framework in the modern sense. Testing involves:
- Building the system.
- Booting the image in an emulator.
- Verifying behavior manually or via the
MiniFinderlogic.
- empw: The core tool for running the compiler.
- ResEdit: (On a real Mac/Emulator) Useful for inspecting resource files (
.rsrc). - Disassemblers: Tools like IDA Pro or Ghidra (with m68k support) are useful for analyzing binary blobs if source is missing.