How to Use Linux on a PS3

© 2008 Sony Computer Entertainment Inc.
© 2006,2007,2008 Sony Corporation

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

DISCLAIMER

THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.

TRADEMARK NOTICE

          "PLAYSTATION" and "PS3" are registered trademarks of Sony Computer Entertainment Inc. "Cell Broadband Engine" is a trademark of
          Sony Computer Entertainment Inc. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
          Other company, product and service names may be registered trademarks, trademarks or service marks of others.

How to use Linux on a PS3

1. Abstract

To install Linux on a PS3, you have to execute following steps.

2. Requirements

Hardware

3. Setup procedure.

3.1 Setup your PS3.

1) Connecting power cables.
2) Connecting monitor
3) Making other interface connections.

3.2 How to create a Linux partition.

1) Turn on the PS3. After initializing, you can see GameOS menu.  You select "Settings -> System Settings".
2) After selecting "Format Utility" from sub menu, following messages are displayed.

Format Memory Stick
Format SD Memory Card
Format CompactFlash
Format Hard Disk

To allocate a Linux partition on the Hard Disk, select "Format Hard Disk".

3) After following message is displayed. you select 'Yes'.

Do you want to format the hard disk?

Yes No

4) You can see following message.

Select a partition setting for the hard disk.

Use All for the PS3 System
Custom

To allocate a Linux partition on the Hard Disk, select "Custom".
After selecting "Custom", following messages are displayed.

Select a partition setting for the hard disk.

Use All for the PS3 System
Allot 10GB to the Other OS
Allot 10GB to the PS3 System

To allocate a Linux partition on the Hard Disk, select one of following items.

Allot 10GB to the Other OS
Allot 10GB to the PS3 System

If your hard disk size is 20GB, you have to select 'Allot 10GB to the Other OS'.

5) After selecting the item, following messages are displayed.

Select the hard disk format method.

Quick Format
Full Format

You can select either  'Full Format' or 'Quick Format'.
6) After following message is displayed. you select 'Yes'.

If you format, all data will be deleted.
This data cannot be restored.
Are you sure you want to continue?

Yes No

7) After selecting 'Yes', format process is started.
8) After creating a Linux partition, following messages are displayed.

Format Complete.
Press the X button to restart the system.

After pressing the X button, restart the system software and you can see GameOS menu.

3.3 How to install kboot.

Please refer the installation documents in your distribution

3.4 Change the default system to boot

To start kboot, you have to change the default system to boot.

1) Turn on the PS3. After initializing, you select "Settings -> System Settings" by using GameOS menu.
2) After selecting "Default System" from sub menu, following messages are displayed.

PS3
Other OS

3) After selecting "Other OS" , following messages are displayed.

Do you want to quit the PS3 system and start the other system
now?
                Yes        No

After selecting 'Yes',  kboot is automatically started.

4. How to install Linux on a PS3.

Some Linux distributions start supporting PS3 already. Please download your favorite distribution as follows.

Fedora 9
http://fedoraproject.org/
Gentoo LiveCD(Beta)
http://www.gentoo.org/proj/en/base/ppc64/ps3/
Ubuntu 7.10
https://help.ubuntu.com/community/PlayStation_3
Please refer the installation documents in the distribution.

How to use Kboot

This section describes the usage of kboot.

1. Abstract

Kboot is a Linux boot loader based on kexec. You can load and exec another Linux kernel on the Linux kernel.

2. Function

Kboot supports the following functions:

3. Executing Linux by kboot

You can boot Linux by kboot, which does the following:

(1) Hardware initialization

Reads in some device driver modules and performs initialization. During the initialization process it waits for a response from each device for 15 seconds. A device that does not respond within this period is ignored.

(2) Device file creation with udev

The udev mechanism creates device files.

(3) Network initialization

First, kboot sends DHCP request to the network. If a DHCP timeout occurs, network is set as follows:

ipv4_addr="192.168.0.10"
ipv4_netmask="255.255.255.0"
ipv4_default=""
ipv4_nameserver=""
dns_domain=""

If the filename parameter is specified from the DHCP server, kboot initializes NFS boot as follows:

E.g. dhcpd.conf

host ps3-1 {

hardware ethernet 00:13:A9:XX:YY:ZZ;
fixed-address 192.168.0.20;
option root-path "192.168.0.30:/tftpboot/linux";
next-server 192.168.0.30;
filename "/linux/boot/vmlinux-nfs";

}

NFS boot configuration is written in /etc/kboot.conf.

default=nfsboot
timeout=10
root=/dev/nfs

nfsboot='tftp://$next-server$filename ip=on nfsroot=$nfshost:$path root=/dev/nfs '

(4) Mounting File system

The kboot boot loader searches for file systems to be mounted on '/'  by using following algorithm.

      - device search priority 
            built-in BD drive, USB mass storage, built-in HDD

      - check if the media has more than one partitions, if no, try to examine boot configuration file on the media.

      - Otherwise, it checks if the partition is marked as "active"  or not in ascending order. In the case of "active', try to examine boot configuration file on the partition.

      - check if format of the media(or partition) meet one of following;
            ext2, ext3, FAT16/32 or ISO9660

         (Caution) kboot mount ext3 file system by using "-t ext2" option

      - try to mount the selected media(or partition) on '/' and check a boot configuration file name either /etc/kboot.conf or /ETC/KBOOT.CNF  or  /etc/yaboot.conf. If the boot configuration file exists,  kboot  finish searching. If the boot configuration file does not exist, kboot umount the selected media(or partition) and check the nextt media(or partition).

After mounting the file system, etc/kboot.conf(or /ETC/KBOOT.CNF), etc/fstab, etc/hosts on the mounted file systems are copied to the /etc/kboot.conf, /etc/fstab, and /etc/hosts on the kboot RAM disk.

(5) Initialization of /etc/kboot.conf on the kboot RAM disk for new boot setting

(6) Initialization of keymap

(7) kboot prompt is displayed. After timeout, the default command is executed.

See the next section, "How to Use kboot", for details.

kboot:

4. How to use kboot

After starting, kboot displays its prompt on the system console. If a timeout is set, a key producing input (e.g., [Space], a letter, [Del], etc., but not [Shift], [Alt], and such) must be pressed in time to keep kboot from automatically proceeding with the default.

A kernel is booted by specifying its name, followed by any arguments that should be passed on the boot command line.

The kernel name can have the following forms:

label
A pre-defined expansion, see above. Label names are case-sensitive.
Example: b26161 root=/dev/ps3da3
/path/to/kernel
An absolute path to the kernel, stored in the booted system.
kboot automatically mounts the file systems needed to access the kernel image, according to the fstab file provided when building the initramfs.
Example: /home/k/linux-2.6.16.1/arch/i386/boot/bzImage
//path/to/kernel
An absolute path to a kernel stored on kboot's temporary file system. If this path leads out to the booted file system, the usual automatic mounting is done.
Example:
cd //tmp
wget http://some.host.net/vmlinux.gz
gzip -d vmlinux.gz
//tmp/vmlinux
relative/path/to/kernel
As above, but the path is relative to the current directory, which can be on the booted file system, or on kboot's temporary file system.
Example:
cd /home/k/linux-2.6.16
vmlinux root=/dev/ps3da1
device:/path/on/device
device:path/on/device
A file on an explicitly named device. The device can be specified with the path to a device file, or simply with the name of the file in /dev.
Example: sda6:kernels/vmlinux
host:/path
A file on an NFS server. The address can be specified in the numeric format, or as a name.
Example: server.my.org:/kernels/vmlinux
http://host/path/to/file
http://host:port/path/to/file
A file on an HTTP server.
Example: cat http://www.kernel.org/kdist/finger_banner
ftp://host/path/to/file
ftp://host:port/path/to/file
A file on an FTP server.
Example: ftp://server.my.org/pub/linux/kernel/v2.6/vmlinux-2.6.16
tftp://host/path/to/file
tftp://host:port/path/to/file
A file on a TFTP server.
Example: tftp://bootserver.my.net/kernel-0a000001

kboot recognizes the following "internal" commands:

cd directory
Change to the specified directory. Automatic mounting and the distinction of / and // are applied like for kernel images. Also the device:... and host:... forms can be used with "cd".
pwd
Print the current directory.
game(or ps3-boot-game-os)
This command switches boot flag in “other-os flash area” to boot game os, and reboot onto game os.

Any other command is handed to the shell for execution. In particular, a shell with command-line editing and file name completion can be be obtained by simply typing "sh".

5. kboot.conf

When the kboot starts, it looks for a file kboot.conf, which contains variable assignments. The syntax is the same as in shell scripts. (In fact, kboot.conf is a shell script.) The following variables have a special meaning:

default=<command>
Command to execute on timeout or if the user enters an empty line.
initrd=<path_to_file>
Initial RAM disk that is loaded by default. This can also be set per kernel by passing the initrd=<path_to_file> boot parameter.
root=<device>
Root device the kernel selects by default. This can also be set per kernel by passing the root=<device> boot parameter. If using the form /dev/<name>, this variable can also serve as a fall back if /etc/fstab does not contain a valid entry for the root file system.
timeout=<seconds>
Time out after that many seconds without user input. Also editing the command line (without pressing [Enter]) counts as input. "timeout" does not work (and yields a warning) if "default" is not also set.
set -x
Turn on kboot debug mode.  You can see kboot trace messages.

Any other variables define a command line, which is expanded when the variable name (which we then call a "label") is entered as a command at the kboot prompt.

Example:

b26131="/boot/vmlinux root=/dev/ps3da7"

With this defined, "b26131 init=/bin/sh" will be expanded as follows:

/boot/vmlinux root=/dev/sda7 init=/bin/sh

You can specify a following special boot parameter on the PS3.

video=ps3fb:mode:<video mode ID>
Drawing resolution can be set explicitly, if needed. If there is no video syntax, auto mode is used.

<video mode ID>
0: auto mode , default value
YUV 60Hz 1:480i 2:480p 3:720p 4:1080i 5:1080p
YUV 50Hz 6:576i 7:576p 8:720p 9:1080i 10:1080p
RGB 60Hz 33:480i 34:480p 35:720p 36:1080i 37:1080p
RGB 50Hz 38:576i 39:576p 40:720p 41:1080i 42:1080p
VESA 11:WXGA 12:SXGA 13:WUXGA

full screen mode: <video mode ID> + 128
dither ON mode : <video mode ID> + 2048

kboot.conf sample is as follows.

default=linux
timeout=10
root="LABEL=/"

linux="/boot/vmlinux-2.6.23 initrd=/boot/initrd.img-2.6.23 video=ps3fb:mode:3"

Please refer to the "Specification of minimum boot loader configuration file  for removable media" document.

Revision History

1.7May 28 2008Update to Fedora 9
1.6Feb 1 2008Update PS3 System software version for PS3 Linux
1.5Oct 26 2007Update PS3 System software version for PS3 Linux
1.4Aug 17 2007Change built-in HDD device name. Update kboot kernel version
1.3Apr 25 2007Support PS3 System Software 1.60. Update to Fedora Core 6
1.1Dec 8 2006Added "Revision History" and  "About This Document"
1.0Nov 11 2006Initial Revision