How theiphoneos1project/iphoneos1-sdk works
Purpose and Entry Point
This repository generates a compatibility SDK for targeting iPhone OS 1. It assembles user-supplied Mac OS X 10.5 and iPhone OS 2 SDK material with repository-provided overrides, linker shims, and runtime startup support. The operational entry point is generate.py; it accepts source SDK paths plus include, shim_sdk, and csu inputs.
Generation Orchestrator
generate.py is the control-plane script: it receives SDK locations and an output path, then constructs the generated SDK from multiple source boundaries. The repository does not contain an application or device-side service; its main product is a filesystem SDK layout for downstream compilers/linkers.
• generate.py
• README.md
Header Reconstruction Layer
The checked-in include/ tree supplies manually written or reverse-engineered compatibility headers and local API declarations that complement copied upstream headers. It spans public and private iPhone-era frameworks, making this the primary compile-time API surface.
• include/UIKit/UIKit.h
• include/Message/Message.h
• include/Celestial/Celestial.h
Platform and ABI Surface
Low-level C, ARM, Mach, and system declarations establish the target ABI expected by old iPhone OS binaries. This is a boundary between source compatibility and the ARM/device execution environment.
• include/architecture/arm/
• include/mach/arm/
• include/arm/_types.h
Link-Time Framework Shim SDK
shim_sdk/ mirrors /System/Library/Frameworks and private-framework locations using .tbd linker-interface files rather than Apple binaries. The generated SDK uses these interfaces to resolve framework linkage while actual implementations remain on the target device.
• shim_sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd
• shim_sdk/System/Library/Frameworks/Foundation.framework/Foundation.tbd
• shim_sdk/System/Library/PrivateFrameworks/vmutils.framework/vmutils.tbd
Runtime Startup Support
The csu/ directory provides ARM C runtime/startup artifacts required for produced binaries to start correctly on-device, including assembly entry glue and CRT objects. This is the execution-time boundary between linked app code and the platform dynamic loader/runtime.
• csu/arm-start.s
• csu/arm-dyld-glue.s
• csu/crt.c
Primary Flow and External Dependencies
1. A user provides legally obtained Mac OS X 10.5 and iPhone OS 2 SDK directories.
2. generate.py combines selected upstream headers with include/ overrides/compatibility declarations.
3. It incorporates shim_sdk/ framework interfaces for linker resolution and csu/ runtime files for binary startup.
4. The resulting SDK is consumed by an ARM/iPhone OS toolchain; linked applications depend at runtime on frameworks supplied by an iPhone OS 1 device.
Material external dependencies are Python 3, the two user-provided SDKs, an ARM-capable compiler/linker toolchain, and device-resident Apple frameworks. The repository itself intentionally avoids distributing Apple SDK binaries.
Main entry points: generate.py SDK generator · UIKit.tbd Framework shim SDK · arm-start.s ARM startup support · UIKit.h Compatibility headers
Components 14
External inputs
- Mac OS X 10.5 SDK · User-supplied source material.
- iPhone OS 2 SDK · User-supplied source material.
Repository sources
- SDK generator · Combines upstream material and repository compatibility layers.
generate.py - Compatibility headers · Local public and private API declarations.
include/UIKit/UIKit.h - Message declarations
include/Message/Message.h - Celestial declarations
include/Celestial/Celestial.h - ARM and Mach ABI headers · C, ARM, Mach, and system target declarations.
- ARM type declarations
include/arm/_types.h - Framework shim SDK · TBD interfaces replace distributed Apple framework binaries.
shim_sdk/System/Library/Frameworks/UIKit.framework/UIKit.tbd - Private framework shims
shim_sdk/System/Library/PrivateFrameworks/vmutils.framework/vmutils.tbd - ARM startup support · Entry glue and runtime startup objects.
csu/arm-start.s
Generated SDK use
- iPhone OS 1 compatibility SDK · Generated compiler and linker target layout.
- ARM compiler and linker
- iPhone OS 1 device frameworks · Actual framework implementations remain on the device.
Connections 15
- Mac OS X 10.5 SDK → SDK generator: source headers
- iPhone OS 2 SDK → SDK generator: source headers
- Compatibility headers → SDK generator: overrides
- Message declarations → SDK generator: API declarations
- Celestial declarations → SDK generator: API declarations
- ARM and Mach ABI headers → SDK generator: target ABI
- ARM type declarations → SDK generator: ARM types
- Framework shim SDK → SDK generator: framework interfaces
- Private framework shims → SDK generator: private interfaces
- ARM startup support → SDK generator: CRT artifacts
- SDK generator → iPhone OS 1 compatibility SDK: assembles
- iPhone OS 1 compatibility SDK → ARM compiler and linker: compile and link target
- ARM compiler and linker → iPhone OS 1 device frameworks: linked apps use at runtime
- Framework shim SDK → iPhone OS 1 device frameworks: interfaces correspond to
- ARM startup support → ARM compiler and linker: binary entry support