93w ago - Today Sony PlayStation 3 hacker
durandal has released OedipusRSX PS3 RSX Reality Synthesizer documentation for other developers to improve graphics utilized in PS3 homebrew applications and games.
Download:
OedipusRSX PS3 RSX Documentation /
OedipusRSX PS3 RSX Documentation (Mirror)
Below is some background on the PS3 RSX 'Reality Synthesizer' via
Wikipedia, as follows:
The RSX 'Reality Synthesizer' is a proprietary graphics processing unit (GPU) codeveloped by Nvidia and Sony for the PlayStation 3 game console.
Unless otherwise noted, the following specifications are based on a press release by Sony at the E3 2005 conference, slides from the same conference, and slides from a Sony presentation at the 2006 Game Developer's Conference.
Specifications:
- 500 MHz on 90 nm process (shrunk to 65 nm in 2008 and to 40 nm in 2010)
- Based on NV47 Chip (Nvidia GeForce 7800 Architecture)
- 300+ million transistors
- Multi-way programmable parallel floating-point shader pipelines
- Independent pixel/vertex shader architecture
- 24 parallel pixel-shader ALU pipes clocked @ 550 MHz
- 5 ALU operations per pipeline, per cycle (2 vector4 , 2 scalar/dual/co-issue and fog ALU, 1 Texture ALU)
- 16 floating-point operations per pipeline, per cycle
- 8 parallel vertex pipelines @ 500 MHz
- 2 ALU operations per pipeline, per cycle (1 vector4 and 1 scalar, dual issue)[citation needed]
- 10 FLOPS per pipeline, per cycle
- Floating Point Operations: 251.2 Gigaflops [(24*16* 550)+(8*10*500)]
- 74 billion shader operations per second [(24 Pixel Shader Pipelines*5 ALUs*550 MHz) + (8 Vertex Shader Pipelines*2 ALUs*500 MHz)]
- 24 texture filtering units (TF) and 8 vertex texture addressing units (TA)
- 24 filtered samples per clock
- Maximum texel fillrate: 12.0 GigaTexels per second (24 textures * 500 MHz)
- 32 unfiltered texture samples per clock, (8 TA x 4 texture samples)
- 8 Render Output units / pixel rendering pipelines
- Peak pixel fillrate (theoretical): 4.0 Gigapixel per second
- Maximum Z sample rate: 8.0 GigaSamples per second (2 Z-samples * 8 ROPs * 500 MHz)
- Maximum Dot product operations: 28.6 billion per second
- 128-bit pixel precision offers rendering of scenes with High dynamic range rendering (HDR)
- 256 MB GDDR3 RAM at 650 MHz
- Access to additional 256 MB XDR RAM
- 128-bit memory bus width
- 22.4 GB/s read and write bandwidth
- Cell FlexIO bus interface
- 20 GB/s read to the Cell and XDR memory
- 15 GB/s write to the Cell and XDR memory
- Support for PSGL (OpenGL ES 1.1 + Nvidia Cg)
- Support for S3TC texture compression
Finally, according to a rumor via
Squarepusher2,
Mathieulh of Gitbrew's (irssi, /connect -ssl irc.gitbrew.org) Sony PlayStation 3 Hacking Team also gave
Durandal the coveted PS3 CEX-DEX.zip file
without permission from PS3 hacker
RichDevX.
To quote: BTW Mathieulh I know you gave
durandal (Durandal Dokuchayev) that CEX-DEX ZIP, that it wasn't you that bundled that up, and you were not supposed to do so either
[Mathieulh] (mathieulh@oper.gitbrew.org): mathieu
[Mathieulh] otheros #opers pspdev
[Mathieulh] *.gitbrew.org :Gitbrew
[Mathieulh] is a Deus on Gitbrew
[Mathieulh] is logged in as Mathieulh
[Mathieulh] is using a secure connection
[Mathieulh] idle 00:02:07, signon: Tue Aug 30 13:52:59
[Mathieulh] End of WHOIS list.
Download: http://git.gitbrew.org/~glevand/ps3/linux/ps3rsx.tar.gz / http://gitbrew.org/~glevand/ps3/freebsd/livecd/ps3_freebsd_livecd.iso (1920x1080 Resolution) / http://www.multiupload.com/D4S651MUT3 (Mirror)
To quote: Well I am pleased to announce that RSX Driver for FreeBSD is released. The RSX driver is the product of hard work by durandal and glevand, who gave up many hours to accomplish this. So here you go, the link for the RSX driver: http://git.gitbrew.org/~glevand/ps3/linux/ps3rsx.tar.gz
On a side note, may I add that contrary to public belief for 5 YEARS, the RSX doesnt not rely on DMA to process graphics, but rather uses PPU instructions to push objects to RSX VRAM. So yeah another breakthrough by the team who scammed everyone. Gitbrew.
PS: To all those who started complaining about this noble effort to enable RSX on OtherOS(/++) , such as "gitbrew is a scam" or "they are just SDK samples", check out the date of the file.
Gitbrew was always about developing things for developers AND users alike. Sadly, users don't always appreciate the effort, a simple omission to include the release URL, that was due to durandals medical condition and glevans personal issues, seems to be enough
Well keep that in mind, Gitbrew gave their word to release a RSX driver and succeeded; anyone who had cared to browse glevands directory WITHIN 24 HOURS of the donations would have seen it.
Source Code:
/*
* PS3 RSX
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published
* by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define RSX_FIFO_CMD_BUF_SIZE (1 * 1024 * 1024)
#define RSX_MEM_SIZE (32 * 1024 * 1024)
#define RSX_GPU_IOIF (0x0e000000ul)
#define RSX_FIFO_CTRL_SIZE (4 * 1024)
struct rsx_fifo_ctrl {
u8 res[0x40];
u32 put;
u32 get;
};
static u32 *rsx_fifo_cmd_buf;
static u64 rsx_fifo_cmd_buf_lpar;
static u64 rsx_mem_handle, rsx_mem_lpar;
static u64 rsx_ctx_handle;
static u64 rsx_fifo_ctrl_lpar;
static u64 rsx_drv_info_lpar;
static u64 rsx_reports_lpar, rsx_reports_size;
static struct rsx_fifo_ctrl *rsx_fifo_ctrl;
/*
* FIFO program
*/
static u32 rsx_fifo_prg[] = {
0x00000000, /* nop */
0x00000000, /* nop */
0x00000000, /* nop */
};
/*
* ps3rsx_init
*/
static int __init ps3rsx_init(void)
{
unsigned long timeout;
int res;
/* FIFO command buffer must be allocated in XDR memory */
rsx_fifo_cmd_buf = kmalloc(RSX_FIFO_CMD_BUF_SIZE, GFP_KERNEL);
if (!rsx_fifo_cmd_buf) {
printk(KERN_INFO"could not allocate FIFO command buffer\n");
res = -ENOMEM;
goto fail;
}
res = lv1_gpu_memory_allocate(RSX_MEM_SIZE, 0, 0, 0, 0,
&rsx_mem_handle, &rsx_mem_lpar);
if (res) {
printk(KERN_INFO"lv1_gpu_memory_allocate failed (%d)\n", res);
res = -ENXIO;
goto fail_free_fifo_cmd_buf_mem;
}
res = lv1_gpu_context_allocate(rsx_mem_handle, 0,
&rsx_ctx_handle, &rsx_fifo_ctrl_lpar, &rsx_drv_info_lpar,
&rsx_reports_lpar, &rsx_reports_size);
if (res) {
printk(KERN_INFO"lv1_gpu_context_allocate failed (%d)\n", res);
res = -ENXIO;
goto fail_free_gpu_mem;
}
/* map FIFO command buffer into RSX address space */
rsx_fifo_cmd_buf_lpar = ps3_mm_phys_to_lpar(__pa(rsx_fifo_cmd_buf));
res = lv1_gpu_context_iomap(rsx_ctx_handle,
RSX_GPU_IOIF, rsx_fifo_cmd_buf_lpar, RSX_FIFO_CMD_BUF_SIZE,
CBE_IOPTE_PP_W | CBE_IOPTE_PP_R | CBE_IOPTE_M);
if (res) {
printk(KERN_INFO"lv1_gpu_context_iomap failed (%d)\n", res);
res = -ENXIO;
goto fail_free_gpu_mem;
}
/* map RSX FIFO control registers */
rsx_fifo_ctrl = (struct rsx_fifo_ctrl *) ioremap(rsx_fifo_ctrl_lpar, RSX_FIFO_CTRL_SIZE);
if (!rsx_fifo_ctrl) {
printk(KERN_INFO"could not map FIFO control\n");
res = -ENXIO;
goto fail_free_gpu_mem;
}
/* PUT and GET offsets are in RSX address space */
res = lv1_gpu_context_attribute(rsx_ctx_handle, 0x1,
RSX_GPU_IOIF + 0x0 /* PUT offset */, RSX_GPU_IOIF + 0x0 /* GET offset */,
0x0, 0x0);
if (res) {
printk(KERN_INFO"lv1_gpu_context_attribute(0x1) failed (%d)\n", res);
res = -ENXIO;
goto fail_unmap_fifo_ctrl;
}
/* copy FIFO commands to FIFO command buffer */
memcpy(rsx_fifo_cmd_buf, rsx_fifo_prg, sizeof(rsx_fifo_prg));
printk(KERN_INFO"GET offset (0x%08x) PUT offset (0x%08x)\n", rsx_fifo_ctrl->get, rsx_fifo_ctrl->put);
/* kick FIFO */
rsx_fifo_ctrl->put = RSX_GPU_IOIF + sizeof(rsx_fifo_prg);
/* poll until RSX is done processing FIFO commands */
timeout = 100;
while (timeout--) {
if (rsx_fifo_ctrl->get == rsx_fifo_ctrl->put)
break;
msleep(1);
}
printk(KERN_INFO"GET offset (0x%08x) PUT offset (0x%08x)\n", rsx_fifo_ctrl->get, rsx_fifo_ctrl->put);
if (rsx_fifo_ctrl->get != rsx_fifo_ctrl->put) {
printk(KERN_INFO"FIFO command buffer timeout\n");
res = -ENXIO;
goto fail_unmap_fifo_ctrl;
}
return 0;
fail_unmap_fifo_ctrl:
iounmap(rsx_fifo_ctrl);
fail_free_gpu_mem:
lv1_gpu_memory_free(rsx_mem_handle);
fail_free_fifo_cmd_buf_mem:
kfree(rsx_fifo_cmd_buf);
fail:
return res;
}
/*
* ps3rsx_exit
*/
static void __exit ps3rsx_exit(void)
{
iounmap(rsx_fifo_ctrl);
lv1_gpu_context_iomap(rsx_ctx_handle, RSX_GPU_IOIF, rsx_fifo_cmd_buf_lpar,
RSX_FIFO_CMD_BUF_SIZE, CBE_IOPTE_M);
lv1_gpu_context_free(rsx_ctx_handle);
lv1_gpu_memory_free(rsx_mem_handle);
kfree(rsx_fifo_cmd_buf);
}
module_init(ps3rsx_init);
module_exit(ps3rsx_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("PS3 RSX");
MODULE_AUTHOR("glevand");
Below is a guide from: portal.gitbrew.org/wikibrew/PS3:FreeBSD
PS3 FreeBSD
FreeBSD OtherOS++
FreeBSD can be run on PS3 Slim models from HDD with OtherOS++.
All the freebsd related files should be available here: http://gitbrew.org/~glevand/ps3/freebsd/
Cross-Compiling
You can skip this step and use my precompiled FreeBSD world and kernel:
http://gitbrew.org/~glevand/ps3/freebsd/ps3_freebsd_world.tar.gz
http://gitbrew.org/~glevand/ps3/freebsd/kernel/
http://gitbrew.org/~glevand/ps3/freebsd/loader-1080x1920.ps3
You need a running FreeBSD system to cross-compile your PS3 FreeBSD world and kernel, you don't need a PS3 for that, it may be a different architecture. Once this step is done and you have a running FreeBSD system on your PS3 , you can build FreeBSD world and kernel on PS3 itself.
# git clone git://git.gitbrew.org/ps3/ps3freebsd/freebsd.git
# cd freebsd
# make buildworld buildkernel installkernel installworld distribution TARGET=powerpc TARGET_ARCH=powerpc64 KERNCONF=PS3 DESTDIR=$HOME/ps3_world
When it's finished then you will have a complete FreeBSD world with kernel in directory $HOME/ps3_world.
Rebuilding Loader
If you want to recompile ONLY FreeBSD loader then after you finished compiling FreeBSD world and kernel, do this:
# cd freebsd
# make buildenv TARGET=powerpc TARGET_ARCH=powerpc64
# cd sys/boot
# make all install DESTDIR=$HOME/ps3_world
Rebuilding Kernel
If you want to recompile ONLY FreeBSD kernel then after you finished compiling FreeBSD world and kernel, do this:
# cd freebsd
# make buildkernel TARGET=powerpc TARGET_ARCH=powerpc64 KERNCONF=PS3
# make installkernel TARGET=powerpc TARGET_ARCH=powerpc64 KERNCONF=PS3 DESTDIR=$HOME/ps3_world
Installation
To install a FreeBSD world on your PS3, you will need a running Linux system first currently. Once i build a LiveCD for PS3 FreeBSD you won't need that anymore. I used Debian to install my FreeBSD on PS3.
First create UFS2 filesystem for your FreeBSD. I assume that there is already a free partition on the HDD of your PS3.
# apt-get install ufsutils
# mkfs.ufs /dev/ps3dd3
Then mount it on Debian and copy your PS3 FreeBSD world to this partition, like this:
# mount -t ufs -o ufstype=ufs2 /dev/ps3dd3 /mnt
# cd /mnt
# tar xvzf /root/ps3_freebsd_world.tar.gz
# cp /root/ps3_freebsd_kernel/kernel /mnt/boot/kernel/
# cp /root/ps3_freebsd_kernel/kernel.symbols /mnt/boot/kernel/
# cd
# umount /mnt
Booting
FreeBSD on PS3 is booted by the FreeBSD loader which can be executed by petitboot with kexec. The FreeBSD loader is built during cross-compiling of the FreeBSD world and kernel or you can use my precompiled version. It supports booting of FreeBSD from HDD. My precompiled version boots a FreeBSD kernel from ps3dd3. The HDD partition from which it boots a FreeBSD kernel is hardcoded, if you want to use another HDD partition then you have to change it in the loader and recompile it.
Store your FreeBSD loader on a Linux partition, i stored mine in Debian in /boot directory, and added a new kboot.conf entry on Linux, like this:
# cp /root/loader-1080x1920.ps3 /boot
# cat /etc/kboot.conf
...
...
...
freebsd_loader_hdd=/boot/loader-1080x1920.ps3
...
...
#
Now you can boot your PS3 FreeBSD. Boot petitboot first and choose FreeBSD loader in CUI. Once, you have a running PS3 FreeBSD system, you can build FreeBSD world and kernel or compile ports on your PS3 itself.
One of the advantages of FreeBSD on PS3 is write access to the GameOS HDD region and the possibility to create valid GameOS HDD partitions.
Ports
Ports allow us to install many useful programs on your FreeBSD.
Extracting ports:
# cd /root
# fetch ftp://ftp7.freebsd.org/pub/FreeBSD/ports/ports-stable/ports.tar.gz
# cd /usr
# tar xvzf /root/ports.tar.gz
Useful programs you will need first:
wget
git
screen
sudo
elinks
Live CD
Compiling World
Change screen resolution in loader and kernel before compiling
Change frame buffer size in kernel if needed
# cd /usr
# git clone git://git.gitbrew.org/ps3/ps3freebsd/freebsd.git src
# cd src
# make buildworld buildkernel installkernel installworld distribution TARGET=powerpc TARGET_ARCH=powerpc64 \
KERNCONF=PS3 DESTDIR=/root/ps3_world
Compiling Ports
# cd /root/ps3_world/usr
# fetch ftp://ftp7.freebsd.org/pub/FreeBSD/ports/ports-stable/ports.tar.gz
# tar xvzf ports.tar.gz
# mount -t devfs devfs /root/ps3_world/dev
# cp /etc/resolv.conf /root/ps3_world/etc/
# chroot /root/ps3_world /bin/csh
# cd /usr/ports
# cd shells/bash
# make install clean BATCH=yes
Configuring System
/boot/loader.conf
boot_cdrom="YES"
autoboot_delay="-1"
/etc/rc.conf
root_rw_mount="NO"
hostname="freebsd-livecd"
ifconfig_glc0="SYNCDHCP"
keyrate="fast"
keymap="us.iso"
#keymap="fr.iso"
#keymap="german.iso"
scrnmap="NO"
font8x16="iso15-8x16"
font8x14="iso15-8x14"
font8x8="iso15-8x8"
update_motd="NO"
syslogd_enable="NO"
newsyslog_enable="NO"
cron_enable="NO"
hostid_enable="NO"
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
cleanvar_enable="NO"
crashinfo_enable="NO"
virecover_enable="NO"
/etc/fstab
/dev/cd0 / cd9660 ro 0 0
Changing Login Shell
# chroot ps3_world
# chsh
Creating ISO Image
Exit chroot
# umount /root/ps3_world/dev
# cd ps3_world
# rm -f etc/resolv.conf
# mkisofs -R -l -ldots -allow-lowercase -allow-multidot \
-V 'PS3 FreeBSD LiveCD' -volset 'PS3 FreeBSD' -hide boot.catalog \
-o ../freebsd_livecd.iso .
Booting Live CD with OtherOS++
Installing FreeBSD on HDD from Live CD
Links
FreeBSD Handbook: http://www.freebsd.org/doc/handbook/
FreeBSD AvgLiveCD: http://wiki.freebsd.org/AvgLiveCD
FreeBSD LiveCD: http://www.secure-computing.net/wiki/index.php/FreeBSD/LiveCD
Gitorious - FreeBSD Wiki: http://wiki.freebsd.org/Gitorious
Setting Up A new FreeBSD System: http://users.rcn.com/rneswold/fbsd-init.html
More PlayStation 3 News...
Thanks