CHAPTER 2 ■ APPLIANCE HACKING 53 LinuxDC (http://linuxdc.sourceforge.net) is an old—almost defunct—project that has recently seen a small spurt of new life. It is a reasonably complete distribution suitable for web browsing (with a BBA), movie playback, and emulation. This itself is a good hack, but there are also cables to provide two- way serial communication, either between the Dreamcast and a PC or between peripherals such as infrared (IR) transmitters and receivers. You can either build this cable yourself using one chip and three capacitors from the circuit shown at http://mc.pp.se/dc/serifc.html or purchase a similarly compatible cable, which is known as a DC coders cable. There is also Dreamcast emulation software for Linux called LXDream, which provides a quick way to verify the working, or not, of various Dreamcast software hacks. You can find this at www.lxdream.org, which also provides all-important links to prebuilt disc image ISOs of LinuxDC, from www.lxdream.org/wiki/index.php?title=Dreamcast_Linux. ■ Note Emulators such as LXDream require an image of the machine’s original BIOS. Since these are usually still under copyright, they are not packaged with the emulator and must be extracted from a machine (that you legally own). In addition to these, there are various pieces of stand-alone software that can be cross-compiled and uploaded via the serial DC coders cable to the Dreamcast. Some of these are shown on the pages at http://mc.pp.se/dc. This includes example source code for text, graphics, sound, and serial communications. By avoiding an operating system, you can make better use of the comparatively small 16MB of memory and 200MHz processor, at the expense of ease of development. Sony PlayStation Sony is now promoting its third generation of PlayStation console, imaginatively titled PlayStation 3 (PS3). It is still too new to make it financially viable to turn the whole machine into an home automation device (and since it’s a very capable media playback device already), but you can install Linux on it if you want. (Note that the Slimline version of the PS3 does not support this.) For software engineers, it is a good platform to learn the CELL architecture, but since the kernel isn’t optimized for this chip, the operating system is comparatively slow, meaning the same money and electricity could be put to better use with a standard PC. However, the newness of this machine means there are two older consoles being neglected that can be had for very little money. PlayStation 1 The first PlayStation released in 1994 (now referred to as the PlayStation 1, to differentiate itself from the PlayStation brand) had a mere 2MB of RAM, a 33.8MHz CPU, and no memory management unit (MMU), meaning that only the uClinux kernel was suitable for porting, but even then converting the rest of the system was difficult. Only one installation seems to have existed, Runix (originally called PSXLinux), although this is now near impossible to find. This is no great loss because, unlike modern game consoles, it didn’t have a hard drive, which limits its use as a Linux machine. Instead of using existing Linux software, it is still possible to develop applications from scratch using Net Yaroze and utilizing the 128KB memory card for temporary storage. This comprises a black PlayStation, controllers, cables, software, and manuals for software development, and it was intended to CHAPTER 2 ■ APPLIANCE HACKING 54 get hobbyists into the field by providing a means of compiling software on a PC and uploading it through the serial cable—which was also used for debugging—to the PlayStation. The machine was sold via mail order and to universities but wasn’t a big success. Ultimately, there aren’t many of these devices available, so they’re mostly traded between enthusiasts for excessive money. However, the speed of the machine makes it unsuitable for video playback, 2 and its lack of communication ports further limits its potential. A much better use for the PlayStation 1 is not as a computer but as a CD player, especially the first versions. This is because the original console had a much improved DAC inside it over later versions, giving it professional audio quality output when playing CDs. This model can be distinguished by the model number SCPH 100x and the separate audio and video RCA outputs. PlayStation 2 Sony’s second machine was released in 2000 and called the PlayStation 2 (you might detect a naming pattern here!), and it provided a significant increase in power over its predecessor. It had 32MB of RAM and contained separate chips for I/O, sound, and graphics, and it had a main CPU called the Emotion Engine (running at 294.9MHz or 299MHz depending on whether it was an original or later device). This made it a more realistic specification for Linux. Furthermore, an easy route for doing so was provided by Sony, which sold its own supplementary kit, called PS2 Linux. It provided the end user with a hard drive, a keyboard, mouse, an Ethernet adapter, and the necessary software and manuals to develop software. These kits are no longer sold or supported, but some are available from old stock and from secondhand dealers. Development is much easier on the eye if you ignore the TV output and use a monitor—you’ll need one that does sync-on-green. The supplied distribution is ultimately based on an old version of Red Hat with a 2.2.x kernel, although newer versions now exist, along with Mozilla, XChat, and various lightweight GUI applications; utilities that make use of the USB ports such as printers and cameras; and the network port. Before you take this route, check the current range of available software and kernels at http://playstation2-linux.com. Outside of the official Linux distribution, there is a wide selection of home-brew software, such as media players and emulators. You can download them as elfs from sites like http://sksapps.com or www.exploitstation.com, or you can build them yourself on a PC using a set of cross-compilation tools and run from a disc, memory card, network, or USB memory stick. Persuading a PS2 to run nonapproved software is no longer difficult, because several software-only exploits have been discovered, along with the hardware hacks where a so-called modchip is physically soldered into the computer itself. One soft hack is called the PS2 Independence Exploit, where a disc from a PlayStation 1 game is used to load a special file from the memory card, which in turn triggers a buffer overrun allowing unsigned code to run. This is explained in detail at http://sksapps.com/index.php?page=exploitinstaller.html. Free McBoot (http://freemcboot.psx-scene.com) is a newer soft hack, which also allows you to run home-brew software by installing special software tied into the specific memory card. It also works on Slimline PS2s and most newer machines (unlike the Independence Exploit), with the only currently known exceptions being those with a date code of 8c and 8d (BIOS Version v2.30). In addition to the sites listed, several video-sharing web sites include visual tutorials describing the process. And as always, you may be able to find suitable modchips for hardware hacking. 2 The codecs now in use require more CPU power than the formats used in games of that time. CHAPTER 2 ■ APPLIANCE HACKING 55 PlayStation Portable There is one final PlayStation product to mention, the PlayStationPortable (PSP), which was released in 2004 and is based on the PS2. This is a handheld device and benefits the HA hackers with 802.11b WiFi connectivity. IrDA is also featured on the older PSP-1000 models, with the newer version (PSP Go) supporting Bluetooth. All have dual MIPS R4000 chips running at 333 MHz 3 and 32MB of RAM, making them more than capable devices. Like most consoles, however, the PSP has been designed to run only signed code created by Sony, thereby eliminating its ability to be a programmable computer in any real sense. And, like most consoles, hackers found ways of circumventing this, by exploiting an issue in the original 1.5 firmware. This ultimately led to a cat-and-mouse game of firmware upgrades by Sony to close these loopholes (and bribing users to upgrade by including new features like web browsers) as the hackers attempted to reopen them or work out ways of downgrading to 1.5 (without triggering the Trojan code that Sony had placed in the firmware, which would “brick” your machine) to use the old exploit. A wide range of home-brew software is available for PSP including the YouTube viewer PSPTube and a control application for the Xbox Media Center; a good source is http://dl.qj.net/PSP/catid/106. However, one of the real benefits of this device is that you don’t even need to hack it in order to install a web browser, since (from version 2.0) the NetFront Browser has been included by default, and from 3.90 it has included Skype for VoIP calls. Since most home automation equipment comes with a web server or one can be written fairly easily, a web browser is enough for a fairly high level of home control. ■ Note If you plan on using custom or cracked firmware to run home-brew software, always do it early in the device’s ownership life cycle. That way you won’t lose any personal data if something does go wrong in the firmware update process. Microsoft Xbox Like the Sony PlayStation 3, Microsoft’s current game console—the Xbox 360—is probably too new and expensive to be worth hacking into something else, although many people have worked on the problem and created the www.free60.org project in doing so. The Xbox game console was introduced in 2001 and was probably the first time many people considered the possibilities of using a (near-)standard PC connected to their standard TV. This was no doubt helped by the knowledge that Microsoft was using its Windows and DirectX technologies in the unit, both of which were well known, thus presenting a very low barrier to entry for the hackers. As a unit, the Xbox is based around a 733MHz Pentium III chip with 64MB of RAM, along with a DVD-ROM and a 10GB hard drive—the only last-generation console to do so—by default. It also has Ethernet support and USB ports but with a proprietary form factor and wiring. This remonstrative oversight caused many companies to generate business plans based solely around the sale of Xbox USB converters, of which there are many! 3 Firmwares prior to 3.50 are underclocked at 222MHz. CHAPTER 2 ■ APPLIANCE HACKING 56 As a physical unit it is quite large (320 ×100 ×260 mm) and has a fairly noisy fan, although hardware hackers might be able to squeeze this down to laptop size and replace the fan with a silent one. In any case, you will certainly want to locate the machine away from your ears and the speaker system in use. Running Linux There is a perverse geek pleasure in running Linux on Microsoft’s first flagship console. Furthermore, because we’re coming in at the end of its life cycle, any breakages, void warranties, or bricked machines are less important to us than they would have been a few years ago. Also, the hacker community has had enough time to improve the hacking process so that even those scared of soldering irons can do it without fear. The primary site is www.xbox-linux.org. ■ Note Although all Xboxes are capable of running Linux, there are many issues with version 1.6 since the BIOS is no longer stored in a chip that can be (re)flashed. This chip, known as a thin small outline package (TSOP), is instead hardwired, requiring the use of an extra hardware modification chip loaded with the Cromwell Linux BIOS, and even then the output resolutions possible are much reduced (only composite and S-video with overscan, and up to 480p HDTV) because of the different graphics hardware in use. You can determine the version number with the chart at www.xbox-linux.org/wiki/Xbox_Versions_HOWTO. As is usual with console hacks, there is a hardware way to do it and a software way. The hardware way involves the purchase and soldering of a modchip; although their use has questionable legality, 4 this provides the most expansive scope for hacking since you can do the following: • Increase the hard drive size (but less than 137GB is still recommended) • Replace the DVD with another hard drive or DVD-RW • Use all the disk space under Linux After fitting the chip, you need to trick the Xbox into running code that allows you to make use of it. This is done through an exploit, such as the MechAssault Exploit, which uses broken code within the game and a well-crafted save game file, at which point you can transfer arbitrary data onto the Xbox (through the network) and run an application to flash the BIOS with it. The process is simple but fiddly, since you need adapter cables, the correct version of the game, and a separate machine. As mentioned, this is the only (relatively) safe way of introducing Xbox Linux to a version 1.6 machine. The downside of a hardware hack is that the online component of Xbox games (in other words, Xbox Live) are unavailable, since Microsoft will ban anyone found using Linux on its machine. The software hack involves most of the same steps, with the few added complications explained in detail at www.xbox-linux.org/wiki/Software_Method_HOWTO. Naturally, being software, the Linux install 4 Some cite contravention of the DMCA/EUCD, and some cases have been dismissed. CHAPTER 2 ■ APPLIANCE HACKING 57 disappears on each reboot—your data remains, but you must reinstate the hack to boot Linux in order to access it. There was once The Xbox Chocolate Project, where Xbox Linux users would help would-be users modify their machines. It is still going, but fewer volunteers are available. Asking at your local Linux User Group (aka LUG; see www.linux.org/groups for your local group) might be another idea. The reason for hacking an Xbox is up to you. If you just want to make it play DVDs, then the Microsoft DVD Playback Kit is a better option, and it comes with its own IR remote control. As a set-top box, it might be a little noisy compared to the other solutions I’ve mentioned (and will mention) by today’s standards. But as a secondary (or even primary) file server, web server, or even desktop machine, it has extremely positive geek credentials. Xbox Media Center Despite the name, there are more versions of Xbox Media Center (XBMC) running on non-Xbox platforms than there are on the Xbox, including Live CD, all available from www.xbmc.org! This is because the software can only be compiled using the Xbox development kit (XDK), which is made available only to licensed developers. And since Microsoft isn’t happy with Linux developers writing open source software on its console, this is not available to hobbyists in any form. Consequently, the only native versions of XBMC running in the wild are those compiled by licensed developers and those versions that have leaked out from those developers. The legality of such versions is seriously suspect. In either case, you will still need a modified Xbox to run the code, as you would with Xbox Linux. ■ Note If you do have access to the Xbox software, then you can use the IR remote control that is supplied with the Microsoft DVD Playback Kit with XBMC. As software, XBMC contains a lot of top-end functionality and is still in active development. This includes an initiative to reduce the boot time, making it appear more like a set-top box and less like a computer running software—one goal to which all home automation devices should aspire. Its functionality includes the ability to play back media of almost every format (coming from hard disks, optical media, network shares, online streams and feeds, and DAAP for iTunes), display photographs, run Python-written plug-ins (for weather reports and the like), and play games. It is also able to support the media with data services from IMDb (the Amazon-owned Internet Movie Database) and FreeDB (for CD track listings). For many, the main XBMC hackjoy concerns its skinnability, allowing anyone with a minimum of knowledge to create custom interfaces for the software. Despite its prominence, there are several forks of XBMC: Boxee, with integration into social networking applications; MediaPortal, a Windows-centric version with PVR handling; Plex, which focuses on the Mac OS X and associated Apple platform-oriented functionality (such as the iTunes app store); and Voddler, which supports media streaming from its (commercial) video-on-demand site. . available software and kernels at http://playstation2 -linux. com. Outside of the official Linux distribution, there is a wide selection of home- brew software, such as media players and emulators Pentium III chip with 64MB of RAM, along with a DVD-ROM and a 10GB hard drive—the only last-generation console to do so—by default. It also has Ethernet support and USB ports but with a proprietary. of soldering irons can do it without fear. The primary site is www.xbox -linux. org. ■ Note Although all Xboxes are capable of running Linux, there are many issues with version 1.6 since the BIOS