Don't touch PHDRs memsz in memory
[asbestos.git] / README
blobc63c03d5880b487a52b64dc0915d53b7e9262ec6
1 ================================================================================
2                                AsbestOS README
3 ================================================================================
5 == Introduction ==
7 AsbestOS is a Linux bootloader that runs off of the PS3 Lv-2 USB exploit. It is
8 designed to boot on PS3 systems running System Software version 3.41, though it
9 could be adapted to earlier versions. Linux runs on the GameOS partition, thus
10 having the same access to hardware that GameOS has.
12 == Building ==
14 The PS3DEV environment variable needs to point to a usable PowerPC64 toolchain
15 (e.g. $PS3DEV/bin/powerpc64-linux-gcc). If you don't have one, point it at an
16 empty dir and run
18 $ cd toolchain && ./buildit.sh ppu
20 You also need the 'lzma' utility from xz-utils, and the 'dtc' utility. You can
21 grab the latter here: http://git.jdl.com/gitweb/?p=dtc.git . Just clone the git
22 repo and type 'make' to build, then copy the resulting 'dtc' binary to your
23 $PS3DEV/bin directory.
25 To compile stage1 or stage2, just type 'make' in the respective directories.
26 You can also compile the UDP debug message client by doing the same in the tools
27 directory. 'make' in the root of the source tree will do all three.
29 == Usage ==
31 First compile AsbestOS and get a compatible USB exploit delivery mechanism. You
32 should also connect your PS3 and PC to a network (they need to be in the same
33 broadcast domain) and make sure your PC allows broadcast packets to UDP port
34 18194. The IP source and destination are both 255.255.255.255 for these packets.
36 Run tools/dbgcli to get AsbestOS debug output. Fire off the exploit device, turn
37 on your PS3 using power followed by eject within 0.2 seconds (if required by
38 your exploit implementation), and cross your fingers. If you get anything at
39 all, congratulations, stage2 is running. At this point, if you have any issues,
40 the problem should be fairly apparent from the messages.
42 If you get nothing, either the packets aren't making it to your PC or stage2 is
43 failing to start up properly. If your exploit device can show the debug "print"
44 USB messages, that might help you find out whether stage2 is at least being
45 loaded properly.
47 If your PS3 panics (blinking red light) or spontaneously reboots, then something
48 somewhere probably hit an error condition. The first thing that stage2 does is
49 inititalize Ethernet debugging, so chances are either that failed, or stage1
50 failed.
52 Basically, if stuff doesn't work, poke me on IRC ('marcan' on either EFNet or
53 freenode) and we'll see what we can do.
55 To get a kernel to load (see below for instructions to build one), you need to
56 have a DHCP server on your network. It needs to be configured to feed a boot
57 server and filename to the PS3. The boot server should point to a machine
58 running a TFTP server that can serve the specified file, which should be a
59 kboot.conf style configuration file. For example, on an OpenWRT Kamikaze router,
60 put something like this on your /etc/config/dhcp:
62 config host
63         option name       ps3
64         option mac        00:1f:a7:aa:bb:cc
65         option ip         192.168.3.60
66         option networkid  ps3
68 config boot
69         option networkid        ps3
70         option filename         kboot.conf
71         option servername       foobar
72         option serveraddress    192.168.3.171
74 Where 192.168.3.60 is the IP that you want your PS3 to get and 192.168.3.171 is
75 the IP of the TFTP server. The server name doesn't really matter, but it's a
76 good idea to set it to the hostname of the TFTP server. Don't forget to specify
77 the MAC address of your PS3 correctly.
79 The kboot.conf follows the usual syntax that is used with petitboot and friends.
80 For example, the following would be a minimal file:
82 linux='vmlinux  video=ps3fb:mode:3 root=/dev/nfs rw nfsroot=..... ip=dhcp'
84 This will TFTP-load a kernel named 'vmlinux', passing the specified arguments.
85 The text to the left of the first = is a label. Quotes surrounding the right
86 hand side are optional.
88 You can also specify an initrd by either using a global initrd=file line
89 (this applies to all entries) or a per-kernel initrd=file option. The initrd
90 will also be loaded via TFTP. root=... may also be specified as a global option.
92 Currently only the default entry (the first one, or the one specified with
93 default=<label>) is used, as there is no way to select the boot option.
95 == Compatible devices ==
97 AsbestOS can potentially run on any device capable of implementing the exploit
98 and which has access to at least 40kB or so (currently) of free internal or
99 external memory. The following ports are known to exist so far:
101 - AVR Software USB (for AVRs without hardware USB)
102   Arduinos, etc...
103   http://github.com/rvalles/asbestos-avr8susb
104   Supports both >=64k AVRs and <64k AVRs with an external I2C EEPROM.
106 - Rockbox devices with the ARC USB controller
107   iPods (non-Touch), ...
108   http://github.com/shuffle2/rockbox_psgroove/wiki
109   Supports Asbestos stage1/2
111 - TI-84 Plus
112   http://brandonw.net/ps3jb/
113   Supports AsbestOS stage1/2
115 Yeah, someone should really make a port for USB AVRs (heck, I bet someone
116 already has and just didn't tell me).
118 == Kernel ==
120 AsbestOS boots vmlinux kernels (same as usually used with petitboot and other
121 kexec-based bootloaders). This is an ELF format kernel. AsbestOS provides the
122 devtree and other information to the kernel. AsbestOS is also responsible for
123 allocating all of RAM and passing the resulting memory region to the kernel.
124 Current mainline and official ps3-linux.git do not support receiving this
125 information and will not work (they will be restricted to 16MB RAM), so you
126 *must* use the patched kernel available at:
128 http://git.marcansoft.com/?p=ps3-linux.git
130 This git tree also contains patches for early debugging via Ethernet using
131 dbgcli and a useful default configuration.
133 To build such a kernel, simply 'make vmlinux' (normal Linux cross-compiling
134 settings apply unless you're compiling on a PS3; check pmake.sh for some
135 example vars). The file is built in the root directory of the kernel sources.
137 You'll probably want to strip the kernel to significantly reduce the size of
138 the ELF image:
140 $ make vmlinux
141 $ powerpc64-unknown-linux-gnu-objcopy -S vmlinux vmlinux.stripped
143 Commandline arguments are currently hardcoded into AsbestOS (stage2/config.h),
144 NOT the kernel.
146 == Linux environment ==
148 The GameOS environment is essentially the same as the OtherOS environment, as
149 they are just different LPAR configurations on the same hypervisor. The
150 following differences are known to exist:
152 - Boot memory is 16MB instead of 128MB. Using my ps3-linux.git, pretty much all
153   issues caused by this should be resolved. Former issues included framebuffer
154   memory limitations, threads-max and ulimit being set way too low, etc. The
155   total amount of memory is the same as under OtherOS, only the bootmem split
156   changes.
158 - 3D support is available via a preallocated 3D object ID in the RSX. There is
159   a proof of concept remote render implementation under tools/netrpc/rsxtest.py.
161 - Flash and HDD access limitations are different. Currently, Linux seems unable
162   to access these devices out of the box. Investigation needed.
164 - Linux gets access to an additional SPE, so you get 7 instead of 6.
166 == TODO ==
168 Support some kind of video output, maybe.
170 Support USB in AsbestOS to load kernels from USB devices
172 Support the PS3 HDD to load kernels from the OtherOS partition, if any (maybe?)
174 == Known bugs ==
176 USB EHCI support is buggy, at least on recent PS3 Fat systems. This is
177 apparently also a problem in OtherOS mode on older firmwares and unrelated to
178 AsbestOS per se.
180 The PS3 video modesetting driver times out on some command, which delays video
181 init for a few seconds. If your kernel panics before that, you will never see
182 anything.
184 Storage support (Flash and HDD) needs looking into.