iPhone OS 4, set to ship later this summer, has already been jailbroken. The iPhoneDevTeam has released a preliminary beta of the redsn0w jailbreaking tool, but be warned: it's definitely not for the casual jailbreaker.

redsn0w 0.9.5 is a beta release with limited functionality. Right now, it only supports jailbreaking iPhone OS 4.0 beta 1 on iPhone 3G hardware and the tool only runs on Mac OS X. The iPhoneDevTeam also notes that the beta firmware overwrites the baseband firmware, so it's not compatible with carrier unlocks at this time.

This beta is designed to give jailbreak app developers an opportunity to update their apps to work with the latest APIs, as many private APIs and other functions used by jailbreak apps no longer work properly on 4.0. Another sign that this release is geared towards developers is the lack of automatic "hacktivation"; only developers with a registered UDID can get past the activation screen after the jailbroken firmware is loaded.

One thing to note is that the jailbreak makes it possible to enable Apple's iPhone OS 4.0 multitasking system on the iPhone 3G, despite the fact that Apple has said that the hardware can't support it. A video demonstration below shows that it works quite well with iPhone OS 4.0 beta 1.

Watch as jailbroken iPhone OS 4.0 happily multitasks on an iPhone 3G.