Purple OS X

Purple OS X - project that aims to replace Mac OS X Aqua with iPhone OS GUI.

Theory

iPhone SDK's Simulator doesn't run as a ARM emulator which boots iPhone OS from scratch. When Simulator is being launched, it calls the SimulatorBridge (probably some VNC-style daemon) and then a x86 build of SpringBoard.app is started as a normal OS X process. Because frameworks required to launch iPhone OS apps are bundled with Simulator and built for x86, it is possible to create a standalone, bootable iPhone OS distribution for Macs and eventually PCs (using the hackintosh kexts).

What's done

Currently, I have a 724 MB disk image with Mac OS X that has all frameworks replaced with the Simulator equivalents. It is booting and it's configured to run the bash shell instead of loginwindow.

Problems

SpringBoard.app from Simulator requires:

  • IPHONE_SIMULATOR_ROOT= and CFFIXED_USER_HOME= environment variables to be supplied at command line
  • running SimulatorBridge daemon

It seems that SimulatorBridge is responsible for exporting display to iPhone Simulator window. When Preferences.app is launched with -RegisterForSystemEvents argument, it doesn't show on the screen, but process itself is running.

SimulatorBridge doesn't like command line arguments. It runs only when some number is entered as an argument but then quickly quits without any output.

Logs

Springboard.app launched without env variables and SimulatorBridge:

bash-3.2# /System/Library/CoreServices/SpringBoard.app/SpringBoard 
2009-12-13 16:33:00.028 SpringBoard[377:10b] Warning: CFFIXED_USER_HOME is not set!  It should be set to the simulated home directory.
2009-12-13 16:33:00.029 SpringBoard[377:10b] Warning: IPHONE_SIMULATOR_ROOT is not set!  It should be set to the path of the SDK.
2009-12-13 16:33:00.036 SpringBoard[377:10b] SBSAccelerometer unable to create notifyd token for device orientation
2009-12-13 16:33:00.036 SpringBoard[377:10b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'
2009-12-13 16:33:00.037 SpringBoard[377:10b] Stack: (
    807902715,
    13319739,
    807986683,
    807986522,
    810680753,
    816647173,
    816648180,
    814715131,
    814752238,
    14147,
    12894
)
Trace/BPT trap

Springboard.app launched with variables, but without SimulatorBridge:

bash-3.2# CFFIXED_USER_HOME=/User IPHONE_SIMULATOR_ROOT=/ /System/Library/CoreServices/SpringBoard.app/SpringBoard -RegisterForSystemEvents
2009-12-13 16:54:31.750 SpringBoard[471:10b] SBSAccelerometer unable to create notifyd token for device orientation
receive_message: failure running async function: 1
call_and_response: Could not receive response from proxy
MobileInstallationSetDeviceCapabilities: failed with -1

2009-12-13 16:54:42.000 SpringBoard[471:10b] Unable to create CFServerConnection. Telephony state may be incorrect.
receive_message: failure running async function: 1
call_and_response: Could not receive response from proxy
MobileInstallationLookup: failed with -1

purpleServerSend:1933  unable to get simulator port
2009-12-13 16:54:52.832 SpringBoard[471:10b] *** Could not create path ~/Library/ConfigurationProfiles
2009-12-13 16:54:52.883 SpringBoard[471:10b] Unable to create CFServerConnection. Telephony state may be incorrect.
2009-12-13 16:54:52.884 SpringBoard[471:10b] Unable to create CFServerConnection. Telephony state may be incorrect.
2009-12-13 16:54:52.919 SpringBoard[471:10b] Unable to create CFServerConnection. Telephony state may be incorrect.
Terminating in response to the Purple Server port invalidation.
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License