Notes:
Here's a simple program to demonstrate loading an arbitrary ELF executable
from the RTE. The program flashes the orange LED (next to the controller
port) infinitely. The program also executes from Redboot, although it
flashes significantly slower than when run from the RTE directly (presumably
because of interrupt handling, network traffic, etc.).
To build the program, use the native PS2 GNU toolchain normally found at
http://ps2dev.sourceforge.net. You'll need to tell GCC and the linker not to
expect a startup file, and change the program's loading address. The loading
address must be changed from the toolchain default so that the RTE can execute
the loaded program correctly.
$ mips64r5900-sce-elf-gcc -o ledflash.elf -Wl,-Ttext,0x80200000 -nostartfiles \
ledflash.c
Boot up your kit and load Linux. Mount your memory card as /mnt/mc00 and copy
ledflash.elf there. Add an entry to /mnt/mc00/p2lboot.cnf:
"LED flasher" ledflash.elf "" 203 /dev/hda1 "" Simple RTE test program
Check out
https://playstation2-linux.com/docs/xrhino-kernel/display_doc.php?docid=17 for
more info on the format of the p2lboot.cnf file.
After copying the program and updating p2lboot.cnf, reboot the PS2 and select
the "LED flasher" entry from the RTE bootloader. The LED should start
flashing. After the brief mystification period is over, reboot your PS2 :).
Many more demos and software are on the way, including a full-featured RTE
access library that's currently in the works. We're also working on providing
precompiled cross-compiler toolchains for PS2/native, that run on x86 Unix
platforms and PS2/Linux. Stay tuned.
Homebrew Haven
https://playstation2-linux.com/projects/haven/
Changes:
|