Bootable sdlmame - beta version (update 20090917)

Investigation into how Linux on the PS3 might lead to homebrew development.

Moderators: cheriff, emoon

Post Reply
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Bootable sdlmame - beta version (update 20090917)

Post by sashz »

New version of bootable sdlmame 0.133 based on kernel 2.6.30, directfb and sdl.

Changes:
hypervisor bug fixed.

Download the ISO image here http://mail.pdaxrom.org/downloads/PS3/s ... 090917.iso, and then burn it.
Or just download zip archive http://mail.pdaxrom.org/downloads/PS3/s ... 090917.zip and unzip it to USB stick or mmc/sd/ms/cf card.

After that put mame roms to usbstick or mmc/sd/ms/cf card in directory 'roms' or 'ROMS' (you can use the same stick or card with sdlmame boot files).

Boot the system from cd or stick/card. If you see the following message 'No game found... Exit', press Enter or Esc (cross or (PS) button if joystick is attached) to rescan local storages for roms (automounting is need some time to detect and mount removable devices).

During a game you can unplug usb stick or memory card and copy a new game to it. Plug it to ps3 again and wait 5-10 sec for autodetecting and mounting, then press Esc to finish the current game. Press Esc or choose Exit from the menu to exit and rescan storages, sdlmame will restarting with updated game list.


USB joystick and bluetooth are supported. Press (PS) button during startup to attach joystick.
Joystick functions:
Games:
Left analog stick [cursor keys] - left,right,up,down
cross,circle,triangle,square [ASQW] - buttons 1,2,3,4
L1 [5] - insert coins
R1 [1] - P1
(PS) [ESC]- exit
Menu:
Left analog stick [cursor keys] - navigation
cross [enter] - enter
(PS) [ESC] - cancel

Notes:
You need install bootloader to a new PS3 before use sdlmame distro. PS3Boot is included.
Script for building "build-linux-sdlmame-dfb-ps3.sh" is located in pdaXrom-ng svn trunk repo ( https://pdaxrom.svn.sourceforge.net/svn ... pdaXrom-ng )
Updated sixaxisd (events compatible with usb joystick):
http://mail.pdaxrom.org/downloads/PS3/b ... .1.tar.bz2

Old binaries for X11 sdlmame:
http://mail.pdaxrom.org/downloads/PS3/s ... 090813.iso
http://mail.pdaxrom.org/downloads/PS3/s ... 090813.zip
Last edited by sashz on Fri Sep 18, 2009 8:43 pm, edited 7 times in total.
jonathan
Posts: 23
Joined: Fri Sep 21, 2007 12:18 pm
Location: Tasmania, Australia

Post by jonathan »

Nice work :)
speedxl
Posts: 24
Joined: Thu Aug 07, 2008 5:39 am

Post by speedxl »

sashz,

i´m glad to see you!, Thank you for this, it´s a nice gift!
will try it now..
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Post by sashz »

speedxl wrote:sashz,

i´m glad to see you!, Thank you for this, it´s a nice gift!
will try it now..
thank you! i just back from my summer vacation ;)
Schrade
Posts: 5
Joined: Sun Jul 19, 2009 9:17 am

Re: Bootable sdlmame - beta version (update 20090814)

Post by Schrade »

sashz wrote:USB joystick and bluetooth are supported. Press (PS) button during startup to attach joystick.
Joystick functions:
Games:
Left analog stick [cursor keys] - left,right,up,down
cross,circle,triangle,square [ASQW] - buttons 1,2,3,4
L1 [5] - insert coins
R1 [1] - P1
(PS) [ESC]- exit
Menu:
Left analog stick [cursor keys] - navigation
cross [enter] - enter
(PS) [ESC] - cancel
Could you add support for the DPad buttons please? Seems kinda weird to not be able to use them.

Oh.. something else I noticed. The screenmode seems to be set to TV levels. Is there a way to set it to Full RGB levels? It doesn't look so good when my blacks are grey.

(My Toshiba supports Full RGB)
SiW
Posts: 7
Joined: Wed Aug 10, 2005 2:31 am
Location: Whittemore, Iowa, USA
Contact:

Post by SiW »

Does the game list just show a random selection or can it be configured to show only the games you have valid ROM sets for? It's pretty much impossible to manage without a keyboard right now if it's a random selection.
ConteZero
Posts: 1
Joined: Fri Aug 21, 2009 8:40 pm

Bootable sdlmame - beta version (update 20090814)

Post by ConteZero »

Thank you for your work sashz.
Have you ever tested this kernel patch?
http://code.google.com/p/compcache/
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Kernel not booting on PS3 80GB (model CECHK04)

Post by n0der »

I've tried to boot both with supplied bootloader and with petitloader, using kexec to launch the kernel on the usb drive. But no luck. In both cases I just got a fronzen PS3. The supplied kernel does not even show the tux logos nor any other messages on launch.

Could I help somehow to debug the problem?
Schrade
Posts: 5
Joined: Sun Jul 19, 2009 9:17 am

Post by Schrade »

Post the model of PS3 you have. Specifically, the first 5 letters are most important.

http://www.edepot.com/playstation3.html#TOC

Here is a listing of the 5 letter prefixes for each model.

My PS3 is a 60 GB North American model with full backwards compatibility. It works perfectly fine on mine. The prefix is CECHA.
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Post by n0der »

Hello Schrade,

I already specified it on the Post Subject (yes, it is easy to oversee it): it is a CECHK04. Not PS2 compatible, "spanish" version.

Since last post, I've tried to boot the YDL 6.2 kernel (from DVD and from USB) with it's own "otheros.bld" and it does not work either.

Additional info: I upgrade the default HD on the PS3 from a 80GB WesternDigital HD to a 160GB version (also WD). Used backup & restore PS3 utility to carry over the info already installed.

Will posting the bootup messages from the pdaXrom "otheros" help in any way? (a dmesg).

Interesting link btw. Thank your for the info.

Cheers.
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Post by n0der »

Small correction: hard disk was not WD, it was (and is) a Fujitsu. I guess it does not matter... but for the sake of correctness. :-)
starpc
Posts: 1
Joined: Sun Aug 30, 2009 8:04 am

Post by starpc »

where on my USB drive do I need to place the ROMS directory? I've tried both the root of the drive and the PS3 directory and neither time are my roms found.
txg/mnx
Posts: 3
Joined: Thu Sep 03, 2009 9:48 pm

Post by txg/mnx »

I can't get any ROMS to work, did try to boot de SDL CD and put an SDcard and USB disc in my 60gb ps3 but it still says no roms found ?

I did create a folder roms on the removable device.

Please help.
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Post by n0der »

Hello Sashz,

it seems that in order to be able to kexec the kernel once the "otheros" kernel is loaded, and succesfully boot from USB, the PS3 has to have a linux partition created on the internal HD. Otherwise it does not work (at least on my CECHK04).

So the purpose of this very nice "live-mame-usb" beign able to boot from USB without touching the PS3 harddisk is defeated (at least on CECHK).

Could you guess why the local partition is needed in order to boot from USB? I will take a look at the sources and try to find any dependancy for the existance of the local partition.

I have confirmed from the pdaXrom shell that the USB device is fully accesible and it is possible to mount the compresed rootfs, the initrd, preload the kernel with the "kexec --load", but once you try to launch the new kernel with "kexec -e" it just hangs.

Thank you for your time and for all the nice releases you have done!

Cheers.
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

Very cool stuff. Nice work, sashz.

Seems it doesn't use the SPU-accelerated framebuffer driver in SDL 1.2. Not really a problem though.

As wiki.pdaxrom.org/downloads is currentlt not working, I tried to make the mame iso myself. But the compile process stops when building SDL:

Code: Select all

 powerpc-ps3-linux-gcc -g -O2 -I./include -D_GNU_SOURCE=1 -fvisibility=hidden -I/home/ouasse/src/pdaXrom-ng/target/usr/include/directfb -D_REENTRANT -D_REENTRANT -DHAVE_LINUX_VERSION_H -c ./src/cdrom/linux/SDL_syscdrom.c  -fPIC -DPIC -o build/.libs/SDL_syscdrom.o
In file included from /home/ouasse/src/pdaXrom-ng/target/include/linux/byteorder/big_endian.h:12,
                 from /opt/powerpc-ps3-linux/sysroot/usr/include/asm/byteorder.h:25,
                 from /home/ouasse/src/pdaXrom-ng/target/include/linux/cdrom.h:15,
                 from ./src/cdrom/linux/SDL_syscdrom.c:49:
/home/ouasse/src/pdaXrom-ng/target/include/linux/swab.h:6:22: error: asm/swab.h: No such file or directory
Tested on SVN revision 1123, with toolchain generated from rev 1116
jimparis
Posts: 1145
Joined: Fri Jun 10, 2005 4:21 am
Location: Boston

Post by jimparis »

n0der wrote:Could you guess why the local partition is needed in order to boot from USB? I will take a look at the sources and try to find any dependancy for the existance of the local partition.
It is a hypervisor bug. See http://lists.ozlabs.org/pipermail/cbe-o ... 07012.html for more info and a workaround.
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Post by n0der »

Thanks for the information Jimparis!
Indeed, with the patched petitboot I'm able to boot from from USB without the need of an "Otheros" partition on the main HD on a CECHK PS3.

On the other hand I learned quite a bit from browsing through the sources, so all is good! :-)

Sashz, please, take a look at this patch here for the "otheros" bootloader: http://git.kernel.org/?p=linux/kernel/g ... 9fe6c49710

You might want to incorporate it to pdaxrom-ng own bootloader to make it compatible with PS3 models CECHH, CECHJ, CECHK, CECHL,
CECHM, and CECHP with no "otheros" partition created.

Thank you again for the pointer Jimparis (and thanks to Geoff Levand, author of the patch if he ever reads this :-) ).

Cheers.
txg/mnx
Posts: 3
Joined: Thu Sep 03, 2009 9:48 pm

Post by txg/mnx »

Can you supply me with a link to the patched loader ?
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Post by n0der »

For sure (the link was provided by jimparis two posts above), here it is. A direct link to the latest version: http://www.kernel.org/pub/linux/kernel/ ... theros.bld.

Keep in mind that this is petitboot without sixaxis support, so you need a USB keyboard in order to boot from it. I've already built a patched version of pdaXrom bootloader but I'm not releasing it, as I would prefer not to take any credit or interfere in any way with the great work Sashz has done. So please, wait until Sashz releases a new updated version.

If you are of the impatient type, you can build it yourself too, following the instructions provided by Sashz on this forum. Some linux/compiling knowledge needed (and general common sense to follow instructions ;-) ).

Cheers!
n0der
Posts: 7
Joined: Mon Aug 24, 2009 6:48 pm

Post by n0der »

As wiki.pdaxrom.org/downloads is currentlt not working, I tried to make the mame iso myself. But the compile process stops when building SDL:
Ouasse: you just need to copy swab.h from the linux kernel source tree to the appropiate include dir on the toolchain, specifically:

Code: Select all

user@compile:~/ps3-dev/pdaXrom-ng$ cp build/linux-2.6.30/arch/powerpc/include/asm/swab.h /opt/powerpc-ps3-linux/sysroot/usr/include/asm
I just managed to fully built it (bootloader, rootfs and zImage) with an updated sdlmame-0.134 and with the patched kernel to solve the hypervisor bug, so it works on later PS3 models.

Cheers.
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Re: Bootable sdlmame - beta version (update 20090814)

Post by sashz »

ConteZero wrote:Thank you for your work sashz.
Have you ever tested this kernel patch?
http://code.google.com/p/compcache/
hmm, i will try it :-D
txg/mnx
Posts: 3
Joined: Thu Sep 03, 2009 9:48 pm

Post by txg/mnx »

Hi,

The new pdaxrom sdl mame now works, is there an easy way to scroll thru the rom list ?
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

Hi, just to inform the sdlmame download server messes up versions. The script actually requests to download version 0.133 but the server sends 0.134 (0.133 is not available anymore). Of course, the patches are incompatible without (trivial) changes, but the compilation stops with an error about missing powerpc emulation stuff.
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Post by sashz »

ouasse wrote:Hi, just to inform the sdlmame download server messes up versions. The script actually requests to download version 0.133 but the server sends 0.134 (0.133 is not available anymore). Of course, the patches are incompatible without (trivial) changes, but the compilation stops with an error about missing powerpc emulation stuff.
i put 0.133 to src mirror, will see what happen with 0.134
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Post by sashz »

ouasse wrote:Hi, just to inform the sdlmame download server messes up versions. The script actually requests to download version 0.133 but the server sends 0.134 (0.133 is not available anymore). Of course, the patches are incompatible without (trivial) changes, but the compilation stops with an error about missing powerpc emulation stuff.
looks like ppc gcc 4.4.1 preprocessor bug

Code: Select all

#include <stdio.h>

#define CPU_DISASSEMBLE_NAME&#40;name&#41;		cpu_disassemble_##name
#define CPU_DISASSEMBLE&#40;name&#41;			int CPU_DISASSEMBLE_NAME&#40;name&#41;&#40;&#41;

CPU_DISASSEMBLE&#40; powerpc &#41;
&#123;
    return 314;
&#125;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	printf&#40;"Hello world!\n"&#41;;
	return 0;
&#125;

Code: Select all

sash@sashz-macpro&#58;~$ /opt/powerpc-ps3-linux/toolchain/bin/powerpc-ps3-linux-gcc hello.c -S

Code: Select all

sash@sashz-macpro&#58;~$ head hello.s 
	.file	"hello.c"
	.gnu_attribute 4, 1
	.gnu_attribute 8, 1
	.gnu_attribute 12, 2
	.section	".text"
	.align 2
	.globl cpu_disassemble_1
	.type	cpu_disassemble_1, @function
cpu_disassemble_1&#58;
	stwu 1,-16&#40;1&#41;
label cpu_disassemble_1 against cpu_disassemble_powerpc, powerpc name was replaced with 1.

quick fix

Code: Select all

sash@sashz-macpro&#58;~$ /opt/powerpc-ps3-linux/toolchain/bin/powerpc-ps3-linux-gcc hello.c -S -Upowerpc
sashz
Posts: 33
Joined: Thu Feb 23, 2006 1:48 am
Contact:

Post by sashz »

trunk updated with 0.134
ouasse
Posts: 80
Joined: Mon Jul 30, 2007 5:58 am
Location: Paris, France

Post by ouasse »

well done ;) thanks !

I wasn't aware about this bug in gcc 4.4.1.
speedxl
Posts: 24
Joined: Thu Aug 07, 2008 5:39 am

Post by speedxl »

Hi sashz, there´s a scaler for mame that makes games look nice on hdtv it takes not impact on performance because its cell accelerated i think..

this is the link if you are interested.

http://pleasantfiction.ipower.com/bodeg ... a&start=70

Thank you!
Post Reply