View Single Post
Posts: 210 | Thanked: 841 times | Joined on Feb 2013
#1
Hi, i have managed to run maple on the n900 using qemu-i386 and native OpenJDK.

https://www.youtube.com/watch?v=MbtAgc1RU-4

Why? Because it was fun to try and i wanted to test the power of the n900.
I actually did this a few years ago while studying maths but just recently got another n900 so i thought i would try it again and share it with you. It is very easy to do .


Which x86 apps would you like to see on the n900?

// HOWTO (in maemo SDK):
// in this howto i assume that MyDocs is ext3. if it is not either convert it or use different paths!
// this is independant of the app you want to run
// i had issues with qemu-kvm, therefore i built qemu myself

// install python2.7 and set up update-alternatives

$ git clone https://github.com/GNOME/glib
$ cd glib
$ git checkout glib-2-46
$ ./configure --enable-static
$ make -j4
$ make install
$ cd ..
$ git clone https://github.com/krnlyng/qemu
$ cd qemu
$ git checkout n900hacks
// system currently fails, i will look into it later
// static is because i am working with i386 chroots too
$ ./configure --static --prefix=/usr --disable-system
// if you only need i386 add --target-list=i386-linux-user to speed up the build
$ make -j4
$ make DESTDIR=~/qemuinstall install
$ cd ..
$ cd qemuinstall
$ tar czvf ../qemu_git.tar.gz usr/
// upload the resulting tar gz file to your phone
$ scp ../qemu_git.tar.gz user@phone:~/MyDocs

// on phone
$ sudo gainroot
# tar xzvf /home/user/MyDocs/qemu_git.tar.gz -C /
# using your favourite editor edit /usr/bin/binfmt_i386_init
// copy and paste:
Code:
#!/bin/sh
mount -t binfmt_misc none /proc/sys/fs/binfmt_misc
echo ':i386:M::\x7fELF\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03:\xff\xff\xff\xff\xff\xfe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff\xff:/usr/bin/qemu-i386:' > /proc/sys/fs/binfmt_misc/register
// exit your editor
# binfmt_i386_init
# exit
// now you can run i386 applications

// IF YOU REBOOT
you have to execute binfmt_i386_init as root before you can start i386 applications

// OPTIONAL (but you most probably want to do this because without it there is not much use of qemu-i386)
// download an x86 chroot (choose your favourite distribution)
// or you can create one: https://wiki.debian.org/de/Debootstrap
// or for arch linux users like me: https://wiki.archlinux.org/index.php...existing_Linux
// (effectively: curl -O http://mirrors.kernel.org/archlinux/...-x86_64.tar.gz)
// tar it up (if not already), copy it to your n900 and untar (i used ~/MyDocs/root.i686)

// MAPLE
// this is maple specific
// for this the optional part from before is not optional
// on your phone
// follow the instructions here: https://wiki.maemo.org/OpenJDK_6.0_0..._Labs)_on_N900
// note: the first two links are dead, use the third.
// on your desktop
// install maple 13 on an x86 machine, activate it.
// tar it up, copy it to your n900 and untar (i used ~/MyDocs/maple13_i386)
$ cd ~/MyDocs/maple13_i386/bin
// edit activation, maple, mint, xmaple
// in everyone of those files look for MAPLE=foo, replace it with MAPLE=/home/user/MyDocs/maple13_i386
// or use some fancy sed command
// edit maple look for "bin.IBM_INTEL_LINUX")
// change MAPLE_JRE_BIN=foo to MAPLE_JRE_BIN="/opt/OpenJDK-camswl/jre/bin/"
// change JRE_ROOT=foo to JRE_ROOT="/opt/OpenJDK-camswl/jre/lib"
// change JRE_LIB3=foo to JRE_LIB3="$JRE_ROOT/arm/native_threads"
// edit maple13.desktop and replace Exec=foo with this:
Exec=/home/user/MyDocs/maple13_i386/bin/start_maple.sh
// create a new file in the current directory: start_maple.sh
// copy and paste this into the file (you have to replace root.i686 with your chroots name!):
Code:
#!/bin/sh

LD_LIBRARY_PATH=/home/user/MyDocs/root.i686/lib /home/user/MyDocs/maple13_i386/bin/xmaple
$ sudo gainroot
# cp maple13.desktop /usr/share/applications/hildon
# exit
// goto the app launcher and try it out

// IF YOU REBOOT
you have to execute binfmt_i386_init as root before you can start maple

Last edited by liar; 2015-11-18 at 08:36.
 

The Following 21 Users Say Thank You to liar For This Useful Post: