Ps3 linux


Published on

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • yum install -y kexec-tools.i386 mkelfimage.i386 petitboot.i386 system-config-kdump.noarch
  • Ps3 linux

    1. 1. Hacking A PS3, Linux style <ul><li>Keith Wright </li></ul>
    2. 2. Why Linux on PS3? <ul><li>Additional computer </li></ul><ul><li>PPC Architecture </li></ul><ul><li>HDMI output </li></ul><ul><li>Full featured browser </li></ul><ul><li>Cell Broadband Engine </li></ul><ul><li>Bluetooth devices </li></ul><ul><li>Sixaxis Controllers </li></ul><ul><li>Blueray </li></ul>
    3. 3. Prepare Hard Drive <ul><li>Backup Data </li></ul><ul><ul><li>Delete data you don't want </li></ul></ul><ul><ul><li>Insert USB drive </li></ul></ul><ul><ul><li>Settings -> System Settings -> Backup </li></ul></ul><ul><li>Format Hard Drive </li></ul><ul><ul><li>Settings -> System Settings -> Format Hard Drive -> Custom -> Allocate 10G to Other -> Quick Format </li></ul></ul><ul><li>Restore Data </li></ul><ul><ul><li>Settings -> System Settings -> Restore </li></ul></ul>
    4. 4. Installing a Bootloader <ul><li>Choose a Bootloader </li></ul><ul><ul><li>Kboot </li></ul></ul><ul><ul><li>Petitboot </li></ul></ul><ul><ul><li>Copy to Media /PS3/otheros/otheros.bld </li></ul></ul><ul><li>Settings -> System Settings ->Install Other OS </li></ul><ul><li>Settings -> System Settings ->Select Default OS -> Other OS </li></ul><ul><li>Returning to GameOS </li></ul><ul><ul><li>Use the ps3-utils: ps3-boot-gameos </li></ul></ul><ul><ul><li>Force shutdown by holding front power button, Force GameOS when powering on PS3 by holding the button until PS3 beeps twice </li></ul></ul>
    5. 5. Petitboot <ul><li>Features a graphical interface and a text console </li></ul><ul><li>Works with keyboard, mouse, and game controller </li></ul><ul><li>Extends all the capabilities of kboot </li></ul><ul><li>Dynamically detects new boot devices </li></ul><ul><li>Allows setting of graphical modes </li></ul><ul><li>Allows rebooting to the Game Os </li></ul>
    6. 6. Petitboot <ul><li>Discovered storage devices are mounted under /var/tmp/mnt, named by their device. For example, /dev/ps3da1 is mounted at /var/tmp/mnt/ps3da1. </li></ul><ul><li>To boot a kernel, use kexec: kexec -f --append=&quot;root=/dev/ps3da1&quot; -l /tmp/tmp/mnt/ps3da1/boot/vmlinux –initrd=/tmp/tmp/mnt/ps3da1/boot/initrd.img </li></ul><ul><li>petitboot is a work-in-progress: if you have any problems, send email to </li></ul>Keyboard Controller Mouse Function ▲▼◄► D-pad Point Navigate 0 1 2 3 Video Mode Alt+F1 Shell Console Alt+F2 GUI Console Del Bksp Square Boot GameOS
    7. 7. Using Kboot <ul><li>Not just access to local files, but also NFS, HTTP, FTP, and TFTP. </li></ul><ul><li>Kboot is based on kexec </li></ul><ul><li>Using kexec-tools </li></ul><ul><ul><li>Kexec calls allow a new kernel to be loaded without going through firmware or yaboot again </li></ul></ul><ul><ul><li>Can be used for speeding up kernel test builds </li></ul></ul><ul><ul><li>kexec -l <kernel> --append=&quot;<options>&quot; --initrd=<initrd> </li></ul></ul><ul><ul><li>reboot </li></ul></ul><ul><ul><li>Installing package provides man page </li></ul></ul><ul><li>Sources </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li> </li></ul></ul>
    8. 8. Kexec <ul><li>Using Fedora 10 kexec-tools </li></ul><ul><ul><li># kexec -l /boot/vmlinuz-$kver </li></ul></ul><ul><ul><li>--initrd=/boot/initrd-$kver.img </li></ul></ul><ul><ul><li>--command-line=&quot;`cat /proc/cmdline`&quot; </li></ul></ul><ul><ul><li>Tab key auto-completion </li></ul></ul>
    9. 9. BusyBox <ul><li>Kboot and Petitboot use Busybox </li></ul><ul><li>Busybox is a project to go from booting a linux kernel to a shell </li></ul><ul><li>Minimizes the size of the kernel </li></ul><ul><li>Provides a minimal set of command such as fdisk, lvm, mount, umount, and vi </li></ul><ul><li>Start the shell by typing ash at the kboot: prompt </li></ul>
    10. 10. yaboot.conf <ul><li>boot=/dev/ps3da </li></ul><ul><li>init-message=Welcome to Fedora! Hit <TAB> for boot options </li></ul><ul><li>partition=1 </li></ul><ul><li>install=/usr/lib/yaboot/yaboot </li></ul><ul><li>delay=5 </li></ul><ul><li>enablecdboot </li></ul><ul><li>enableofboot </li></ul><ul><li>enablenetboot </li></ul><ul><li>nonvram </li></ul><ul><li>mntpoint=/boot/yaboot </li></ul><ul><li>usemount root=LABEL=/&quot; </li></ul><ul><li>image=/vmlinux-2.6.23-9.ydl6.1 </li></ul><ul><li>label=ydl6_1080p </li></ul><ul><li>read-only </li></ul><ul><li>initrd=/initrd-2.6.23-9.ydl6.1.img </li></ul><ul><li>append=&quot;video=ps3fb:mode:133 rhgb quiet” </li></ul>
    11. 11. kboot.conf <ul><li>/etc/kboot.conf </li></ul><ul><li>message=/etc/kboot.msg </li></ul><ul><li>default=linux </li></ul><ul><li>timeout=100 </li></ul><ul><li>linux='/boot/vmlinux initrd=/boot/initrd.img root=UUID=2e7efb11-0646-42f5-8d6f-9e055473b1b8 quiet' </li></ul><ul><li>old='/boot/vmlinux.old initrd=/boot/initrd.img.old root=UUID=2e7efb11-0646-42f5-8d6f-9e055473b1b8 quiet' </li></ul><ul><li>kboot.msg is a simple text file that kboot displays </li></ul>
    12. 12. Choose Linux Distro <ul><li>Needs to be PowerPC </li></ul><ul><li>Yellowdog </li></ul><ul><ul><li>CellSDK part of install </li></ul></ul><ul><ul><li>Kernel modules are built for ps3 </li></ul></ul><ul><li>Fedora </li></ul><ul><ul><li>CellSDK Available </li></ul></ul><ul><ul><li>Free, easy and current </li></ul></ul><ul><ul><li>Optimal to build kernel </li></ul></ul><ul><li>Other </li></ul><ul><ul><li>Redhat, Ubuntu, OpenSuse, Gentoo </li></ul></ul>
    13. 13. Installing Fedora <ul><li>Successfully did GUI normal install of Fedora 10 PPC DVD (Versions as early as 5 reported) </li></ul><ul><li>Disable Unnecessary Services </li></ul><ul><li>Optimize /etc/fstab </li></ul><ul><li>Configure Wireless or Wired </li></ul><ul><li>Update Packages </li></ul>
    14. 14. Installing Yellowdog <ul><li>Successfully installed YDL 6.1 </li></ul><ul><li>RHEL/Centos Based </li></ul><ul><li>Not as updated as Fedora </li></ul><ul><li>Cell SDK pre-installed </li></ul><ul><li>PS3-utils pre-installed </li></ul><ul><li>Sold pre-installed! </li></ul>
    15. 15. Installing Ubuntu <ul><li>Ubuntu 6.1 last version commercially supported </li></ul><ul><li>Luckily, the Intrepid Ibex has a PS3 install iso: </li></ul><ul><li>Select and install software is longest part </li></ul><ul><li>Be patient... it stayed at 6% for a long time! </li></ul><ul><li>sudo apt-get install ubuntu-restricted-extras </li></ul>
    16. 16. Optimizing fstab <ul><li>/dev/ps3da1 / ext3 defaults,noatime,nodiratime 1 1 </li></ul><ul><li>spufs /spu spufs defaults 0 0 </li></ul><ul><li>tmpfs /dev/shm tmpfs defaults 0 0 </li></ul><ul><li>devpts /dev/pts devpts gid=5,mode=620 0 0 </li></ul><ul><li>sysfs /sys sysfs defaults 0 0 </li></ul><ul><li>proc /proc proc defaults 0 0 </li></ul><ul><li>/dev/ps3da2 swap swap defaults 0 0 </li></ul><ul><li># nodiratime and noatime save writing to disk access times </li></ul><ul><li># Memory from ps3vram module managed in rc.local </li></ul>
    17. 17. Configuring Sound <ul><li>Download Configuration File </li></ul><ul><ul><li> </li></ul></ul><ul><ul><li>Install it as PS3.conf </li></ul></ul><ul><ul><ul><li>/etc/alsa/cards/PS3.conf </li></ul></ul></ul><ul><ul><ul><li>/usr/share/alsa/cards/PS3.conf </li></ul></ul></ul><ul><ul><li>Using a custom kernel build, I had to chmod o+rw /dev/snd/* for it to work </li></ul></ul>
    18. 18. PS3-utils for Linux <ul><li>If not pre-installed, then build them from: </li></ul><ul><li> </li></ul><ul><li>ps3-boot-game-os </li></ul><ul><li>ps3-dump-bootloader </li></ul><ul><li>ps3-flash-util </li></ul><ul><li>ps3-video-mode? </li></ul>
    19. 19. Preparing the Kernel Source <ul><li>git clone git:// ps3-linux </li></ul><ul><ul><li>Create/Backup .config file in ps3-linux directory </li></ul></ul><ul><ul><ul><li>make help </li></ul></ul></ul><ul><ul><ul><li>make ps3_defconfig </li></ul></ul></ul><ul><ul><ul><li>make menuconfig </li></ul></ul></ul>USB HID Boot Protocol drivers
    20. 20. Configure Kernel <ul><ul><li>General Setup </li></ul></ul><ul><ul><ul><li>Auto append version </li></ul></ul></ul><ul><ul><li>Advanced Platform </li></ul></ul><ul><ul><ul><li>Ps3 </li></ul></ul></ul><ul><ul><ul><li>Cell (SPU) </li></ul></ul></ul><ul><ul><li>Device Drivers </li></ul></ul><ul><ul><ul><li>USB Support </li></ul></ul></ul><ul><ul><ul><ul><li>EHCI </li></ul></ul></ul></ul><ul><ul><ul><ul><li>UHCI </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Special HID drivers </li></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Logitech </li></ul></ul></ul></ul></ul><ul><ul><ul><ul><ul><li>Sony </li></ul></ul></ul></ul></ul>
    21. 21. Using ps3vram <ul><li>If you use ps3vram, then you can add over 240Mb of GPU RAM to use as swap </li></ul><ul><li>Need kernel support </li></ul><ul><ul><li>Yellowdog has it pre-built </li></ul></ul><ul><ul><li>Fedora/Ubuntu don't have the module </li></ul></ul><ul><ul><li>Configure a custom kernel from git </li></ul></ul><ul><li>Device Drivers -> MTD Block Support </li></ul><ul><ul><li>Memory Technology Device (MTD) support </li></ul></ul><ul><ul><li>Self-contained MTD device drivers </li></ul></ul><ul><ul><li>PS3 video ram </li></ul></ul>
    22. 22. Building the Kernel <ul><ul><ul><li>Edit Makefile version </li></ul></ul></ul><ul><ul><ul><li>make help </li></ul></ul></ul><ul><ul><ul><li>make && make modules_install && make install </li></ul></ul></ul><ul><ul><ul><li>Update the /etc/yaboot.conf with the new kernel information </li></ul></ul></ul><ul><ul><ul><li>Reboot </li></ul></ul></ul><ul><ul><ul><li>Test </li></ul></ul></ul>
    23. 23. Booting the Kernel <ul><li>Kboot </li></ul><ul><ul><ul><li>Use the TAB key to cycle through what is available </li></ul></ul></ul><ul><ul><ul><li>Type the label that was configured in the /etc/yaboot.conf file </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><li>Petitboot </li></ul><ul><ul><ul><li>Selecting the kernel with mouse and keyboard </li></ul></ul></ul><ul><ul><ul><li>Use Alt+F1 to access text console of system </li></ul></ul></ul><ul><ul><ul><li>Use Alt+F2 to return to the GUI </li></ul></ul></ul><ul><ul><ul><li>?Use ssh, http, and other features </li></ul></ul></ul>
    24. 24. Pulseaudio <ul><li>Distribution kernels work fine </li></ul><ul><li>Custom rolled kernel </li></ul><ul><ul><ul><li>Have /etc/rc.local chmod o+rw /dev/snd/* </li></ul></ul></ul>
    25. 25. Sharing Files <ul><li>USB </li></ul><ul><li>NFS </li></ul><ul><li>Samba </li></ul><ul><li>FTP </li></ul><ul><li>HTTP </li></ul>
    26. 26. Flash <ul><li>Adobe flash-plugin? Nope, not for PPC! </li></ul><ul><li>Gnash? gnash-plugin. Audio only.... </li></ul><ul><li>Xine? xine-plugin. Not at all... </li></ul><ul><li>Mplayer? gecko-mediaplayer(Fedora) or mplayer-plugin(Ubuntu) </li></ul><ul><ul><li>Yes! With a Greasemonkey script! </li></ul></ul><ul><ul><li>Install Greasemonkey Addon for Firefox </li></ul></ul><ul><ul><li> </li></ul></ul>
    27. 27. Bluetooth <ul><li>PS3 Linux </li></ul><ul><ul><li>Cell phone? </li></ul></ul><ul><ul><li>Sixaxis </li></ul></ul><ul><li>PC Linux </li></ul><ul><ul><li>Sixaxis </li></ul></ul>
    28. 28. Media Devices <ul><li>Blueray DVD? </li></ul><ul><ul><li>At least some data appears visible </li></ul></ul>
    29. 29. Mediaserver <ul><li> </li></ul><ul><li>Allows any Java-enabled system to server media to PS3 </li></ul>
    30. 30. Cell Broadband Engine <ul><li>IBM CellSDK </li></ul><ul><li>MIT </li></ul><ul><li>GeorgiaTech </li></ul>
    31. 31. Python game
    32. 32. Mpeg decoder
    33. 33. Blueray <ul><li>Is it possible to playback BD video? </li></ul><ul><li>Can you access BD games data? </li></ul><ul><li>How much does a BD burner cost? </li></ul><ul><li>What kind of quality is the BD playback </li></ul><ul><ul><li>Game OS </li></ul></ul><ul><ul><li>Linux </li></ul></ul>
    34. 34. Acknowledgements <ul><li>The author acknowledges Georgia Institute of Technology, its Sony Toshiba-IBM Center of Competence, and the National Science Foundation, for the use of Cell Broadband Engine resources that have contributed to this research. </li></ul><ul><li>The author acknowledges Geoff Levand for his help in getting started with Linux on the Sony Playstation 3 and for maintaining </li></ul>