I have done a script to install, patch and compile a custom kernel for the YDL 5.01 to add the devices to use libps3rsx , UDF 2.50, to resolve a problem with the Bluray unit when Linux start without one disc, etc.
It is very easy to use:
Code: Select all
- Enter in Linux as root user
- Extract all files in a directory
- Copy the file kernel-source-2.6.16-20070425.ydl.3.ppc64.rpm in the same directory from
Yellow Dog Linux 5.01 DVD (from /YellowDog/RPMS directory)
- Run the install script from the console using: ./install_kernel
- Wait a time to finish
- When it finish, you have a new 2.6.16-20070425.ydl.3custom kernel
- Edit kboot.conf file from /etc/ directory
- Add this lines to the end of file:
ydlcustom='/dev/sda1:/vmlinux-2.6.16-20070425.ydl.3custom initrd=/dev/sda1:/initrd-2.6.16-20070425.ydl.3custom.img root=/dev/sda2 init=/sbin/init video=ps3fb:mode:3 rhgb'
- Remember to change ps3fb:mode:3 to your custom video mode (3 is for 1280x720P 60 Hz non fullscreen)
- If you want, change the string 'default=ydl' to 'default=ydlcustom' to autorun this kernel from kboot:
- You can run too this kernel writing 'ydlcustom' from kboot console
- You can run the old kernel writing 'ydl' (you can use this method to safe if the new kernel fail)
- When restart Linux, on root mode, you can see in the /dev/ directory 3 news devices: ps3gpu_vram, ps3gpu_fifo and ps3gpu_ctrl. This devices requires root perms, so you need to change it to use in user mode.
For example, edit /etc/rc.local and put this lines:
chmod 766 /dev/ps3gpu_vram
chmod 766 /dev/ps3gpu_fifo
chmod 766 /dev/ps3gpu_ctrl
Also is possible to use an alternative method using /dev/fb0 to map the memory (see demo3d_alternative code, files util.c, line 112 and util.l line 62). It is valid for user mode too.
i have included a little 3D example with libps3rsx too, slightly modified to include some info and one alternative form to get the memory areas form /dev/fb0
Also i include two ioctl functions, one to call lv1_gpu_context_attribute function (same method i see in a patch of Glaurung), and other to flip the screen (to use double buffer)
For example, to 'reset' the FIFO position i use this method:
Code: Select all
uint32_t *ctrl = gpu->ctrl.virt;
uint32_t fifo_base;
struct ps3fb_ioctl_gpu_attr a;
fifo_base =ctrl[0x10] & ~(gpu->fifo.len - 1);
a.attr=1;
a.p0=fifo_base;
a.p1=fifo_base;
a.p2=0;
a.p3=0;
ioctl(fb_fd, PS3FB_IOCTL_GPU_ATTR, &a);
To flip the screen, you send a param with the VRAM offset :
Code: Select all
#define PS3FB_IOCTL_GPU_FLIP _IOW('r', 10, int) /* flip the buffers */ <- defined in util.h
if(!val) offset=width*height*4; else offset=0;
ioctl(fb_fd, PS3FB_IOCTL_GPU_FLIP, &offset); // flip the screen
It can use ps3gpu_vram, ps3gpu_fifo and ps3gpu_ctrl devices to asign the memory areas on libps3rsx, but i have an alternative method to use only a device too:
Code: Select all
from /dev/fb0
mem=mmap(0, res->len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, offset);
offset = 0 -> mem= XRAM
offset = 0x10000000 -> mem= VRAM
offset = 0x20000000 -> mem= FIFO
offset = 0x30000000 -> mem= CTRL
To compile the kernel maybe you need to disable the PS3 screen saver to avoid the hang of the system, but i don't remember any problem compiling it from a virtual console under Gnome.
In any way, if you are using YDL 5.01 and you use the same .rpm file, it compile without problems (except if you need free space in your hdd)
i hope you understand my post (i am spanish and the English language is a little problem for me :) )
The download link:
http://mods.elotrolado.net/~hermes/ps3/ ... ort.tar.gz