|Home Recent Work Science Fair About Me Contact Me Software|
Building custom apps is a good way to play around with your blu-ray player, and doesn't require modifying firmware as long as you can get access to the player to run code.
Building a Cross-Compiler
The first step to build code to run on your Blu-Ray player is to build a cross-compiler. Before doing this you may want to confirm which ARM processor your player is using. You can extract any executable file from your original firmware and in Linux run "readelf -all <executablename>". It will spit out an output which includes, at the end, the ARM version. To determine the kernel version, you can look at /lib/modules/[kernel version] on the player's firmware, or extract a kernel module (.ko) and run "modinfo <kernelmodulename>" on Linux. The BDP-S390 and BDP-S5100 use the ARMv6 processor and kernel version 2.6.35.
Raspberry Pi's also use the ARMv6 architecture, so there are plenty of good instructions online for getting a cross-compiler up and running.
I followed the instructions here to build a cross-compiler. I was using Ubuntu 10.04.4. It is possible to use a Cross-Compiler in Windows, but it seemed simpler to do it on Linux, and I figured there would likely be less issues with dependencies.
Please read that link for more details, but here are the basic steps:
Building simple apps
I'm sure there's some way to fix this in the cross compiler configuration, but I need to use the linker option "-Wl,--dynamic-linker=/lib/ld-linux.so.3" to get it to use the correct linker library in the blu-ray player.
To try it out I build a simple hello world program:
Then to compile: arm-unknown-linux-gnueabi-gcc helloworld.c -Wl,--dynamic-linker=/lib/ld-linux.so.3 -o helloworld
For C++ code, use the same thing except arm-unknown-linux-gnueabi-g++
Copy helloworld to your USB key, plug it in, start telnet and after logging in, type /mnt/sda1/helloworld . You should see "Hello World!" on the console.
Building apps with a makefile
Makefiles vary a fair bit, but this syntax generally seems to work for me:
make CC=arm-unknown-linux-gnueabi-gcc CXX=arm-unknown-linux-gnueabi-g++ LDFLAGS="-Wl,--dynamic-linker=/lib/ld-linux.so.3"
or if you want to make it static (e.g. if dependencies are a problem):
make CC=arm-unknown-linux-gnueabi-gcc CXX=arm-unknown-linux-gnueabi-g++ LDFLAGS="-Wl,--dynamic-linker=/lib/ld-linux.so.3 --static"
Sometimes doing an "EXPORT CC=arm-unknown-linux-gnueabi-gcc" and likewise with LDFLAGS, before running make, may give different/better/worse results. It takes some playing around with.
With a configure script I've used:
configure --target=arm-linux CXX=arm-unknown-linux-gnueabi-g++ LDFLAGS="-Wl,--dynamic-linker=/lib/ld-linux.so.3"
The website here has good options to use with various packages you might want to cross-compile.
Also note that if your cross-compiler is not already set up to use your ARM version (e.g. ARMv6), you can define the version using -march=armv6 . With a makefile, you can add that using CFLAGS="-march=armv6".
You will need to:
Downgrading has been successfully tested. That's all I can confirm. Modifying firmware is risky, may violate EULA agreements, and can potentially brick your Blu-Ray player. Please try this at your own risk!
Copyright © 2013-2014 Malcolm Stagg