Active Topics

 


Reply
Thread Tools
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#41
Originally Posted by smoku View Post
+1
This is very similar to the way scratchbox runs ARMEL binaries in full X86 environment.
User Mode of QEMU was designed exactly for this purpose.
DarWINE does it and may serve as reference.
Who do I convince to work on this? This sounds beyond my level of expertise.
 
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#42
# HOWTO:

# I've put hashes at the start of the line, so you could practically execute
# This file and expect it to work to a degree.

# bring up a terminal and from within /home/user (the default):

wget http://a.trap.me.uk/qemu-i386
chmod 755 ./qemu-i386

# test it works

./qemu-i386

# If this seems to output directions for use, this is working.

sudo gainroot

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\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register

# Your phone can now execute arbitrary statically linked x86 binaries
# or with some effort, (./ld-linux.so.2 --library-path `pwd` ./filename)
# any x86 linux binary.

# Set up the chroot with wine...

# I tarred up /etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin
# from (it turns out) an old slackware 10.2 install that had had wine
# installed at some point in the past, ~version 0.9.14.

# extract the chroot in to /chroot (or wherever you want that has space)
# ... actually DON'T use rootfs space, but I'll use /chroot for ease of
# writing this.

# as root

cd /chroot
mkdir -p proc dev tmp/.X11-unix
chmod 777 tmp && chmod +t tmp
# I can't remember the octal for sticky in one go

# copy the phone's /dev, something like:

tar cf blah.tar /dev && tar xf blah.tar

# by default tar strips the leading / so this probably works.

mount -o bind /tmp/.X11-unix tmp/.X11-unix
mount -t proc none proc
mount -t devpts dev/pts

vi etc/mtab etc/passwd

# ... edit to suit your needs. mtab should be small with mainly just /
# referenced, in passwd put a user:29999 account

# TEST full x86 chroot!!!

chroot /chroot

# You should see: bash-2.0# Or similar, and stuff like ls should work!

su - user

export DISPLAY=:0

/usr/X11/bin/xterm

# Oh I needed a symblink for X11 to X11R6 too, I also think I edited
# /etc/ld.so.conf to contain X libs, also I lack terminal definition files
# from that list of directories so I can't do some curses stuff.

# After your success running xterm as x86, which itself fork()ed bash
# again and showed a pretty impressive speed, you're 95% of the way
# there.

# Copy existing known .wine/ hierarchy ??? I think I happened to have
# one in /home/damion from where I nabbed the x86 chroot stuff.

# Then...

wine-pthread ./sol.exe

# Obviously you'll need sol.exe from XP or something and obviously you
# can use whatever wine stuff you need, not just sol You need
# wine-pthread, wine on its own segvs for me. I used to run wineserver
# 1st, but wine-pthread can successfully fork wineserver within this
# chroot without issue for me.

# Profit.
 

The Following 20 Users Say Thank You to damion For This Useful Post:
smoku's Avatar
Posts: 1,716 | Thanked: 3,007 times | Joined on Dec 2009 @ Warsaw, Poland
#43
Originally Posted by damion View Post
Who do I convince to work on this? This sounds beyond my level of expertise.
I'm already sold to the Project.
Just need to step to a store and purchase few buckets of free time.
__________________
smoku @xiaoka.com (SMTP/XMPP) ...:.:....:... pebbled . Poky Fish : sixaxis . psx4m . uae4all
Jolla Phone post-mortem . . . . . . . . . . -> 1+1 VGN-UX390N
 
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#44
Oh and I typed the HOWTO entirely from my head so if it works flawlessly, I'm a rockstar Please can people try this out, especially anyone with spare time and/or good experience with working with chroots.
 
Siggen's Avatar
Posts: 204 | Thanked: 75 times | Joined on Jan 2010 @ Norway
#45
Originally Posted by damion View Post
Oh and I typed the HOWTO entirely from my head so if it works flawlessly, I'm a rockstar Please can people try this out, especially anyone with spare time and/or good experience with working with chroots.
when i was running this ssh'ed from my mac I got a few errors, I disagreed them but I will look into them my self and see if I can figure out what im doing wrong. If not I will post questions and errors here :P

Anyway looking forward to a .deb application to install and maintain this chroot with wine, It can be called Easy Wine or something haha

But right now im on work, so I cant fiddle with stuff, but I will try again later Thanks for the progress, this will be the ultimate phone if it can run x86 programs easily!!!

None the less, my phone is clocked at 850 with titans kernel, and I would love to have the qemu to emulate more than at P90 speeds, maybe at like 333mhz or even 500mhz, or as much as possible. Thanks for your time
 
Posts: 173 | Thanked: 160 times | Joined on Jan 2010 @ London, UK
#46
Has anyone else got it working ?
 
Marshall Banana's Avatar
Posts: 94 | Thanked: 209 times | Joined on Oct 2009 @ Germany
#47
Originally Posted by damion View Post
Has anyone else got it working ?
First thank you again for your present work and the howto

Here is what i tried:
I downloaded your qemu-Build and registered it to run i386-binaries.

I tried to run a static linked i386-binary and a dynamic linked binary, they both worked but for the dynamic linked one i had to execute qemu explicitly:
Code:
../qemu-386 ./ld-linux.so.2 --library-path `pwd` ./otrdecoder
because
Code:
/ld-linux.so.2 --library-path `pwd` ./otrdecoder
just gave me: ./ld-linux.so.2: line 1: syntax error: "(" unexpected

otrdecoder is a closed source downloader/decoder for an internet tv recorder service: www.onlinetvrecorder.com). I can execute them and the tell me about their command line arguments but they complain that they can't connect to the server. I guess that's because qemu doesn't provide network access.

Did you leave out the networking functionality of qemu in your build or did i just not configure it properly?

I just missed a few networking libraries (libresolv, libnss*), now i can run & use otrdecoder on the n900 .

I did not create a full chroot environment with wine yet. Collecting all the libraries for the dynamically linked binary was enough work for me . So i can't say if that part of your howto works.
Edit: i'm doing this right now

Last edited by Marshall Banana; 2010-05-28 at 22:24.
 
Descalzo's Avatar
Posts: 369 | Thanked: 167 times | Joined on Mar 2010
#48
This really interests me. Makes me wish that A: I wasn't a big chicken and B: I had the time to do this.

Aw screw it, I'm gonna see what happens. I can always reflash, right?
__________________
N900
 
Descalzo's Avatar
Posts: 369 | Thanked: 167 times | Joined on Mar 2010
#49
Originally Posted by damion View Post
# HOWTO:

# I've put hashes at the start of the line, so you could practically execute
# This file and expect it to work to a degree.

# bring up a terminal and from within /home/user (the default):

wget http://a.trap.me.uk/qemu-i386
chmod 755 ./qemu-i386

# test it works

./qemu-i386
So far, so good.

# If this seems to output directions for use, this is working.

sudo gainroot

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\x fe\xfe\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfb\xff \xff:/home/user/qemu-i386:' >/proc/sys/fs/binfmt_misc/register
What in the world? I'm pretty new when it comes to this, but I want to learn, and I will have some free time in the coming weeks. What does all this mean?

If you tell me that maybe I ought to wait, I won't be insulted.
__________________
N900
 
Marshall Banana's Avatar
Posts: 94 | Thanked: 209 times | Joined on Oct 2009 @ Germany
#50
Originally Posted by Descalzo View Post
So far, so good.


What in the world? I'm pretty new when it comes to this, but I want to learn, and I will have some free time in the coming weeks. What does all this mean?

If you tell me that maybe I ought to wait, I won't be insulted.
"binfmt_misc is a capability of the Linux kernel which allows arbitrary executable file formats to be recognized and passed to certain user space applications, such as emulators and virtual machines." (wikipedia).
With this two commands everytime you execute a i386 binary on your n900, i. e. ./wine-pthread, qemu-i386 is called by the kernel to execute it.

Other topics you want to look up to understand this howto: chroot, devfs, mounting.

The hardest part will be to "fill" up your chroot environment. You need an old i386 linux installation with a working xserver and wine (like i. e. slackware 10.2) and copy all the stuff that is necessary to run the xserver and wine (/etc /usr/lib /usr/X11/lib /usr/X11/bin /usr/bin /lib /bin /sbin).

My tip: Don't be a chicken and try it out . Make a backup before you start in case you need to reflash.
Put your chroot directory in /opt and be careful not to overwrite anything (like /dev on your phone or /etc). If you don't accidentally overwrite anything you just need to reboot your phone to revert the changes you made by chrooting and mounting.
 

The Following User Says Thank You to Marshall Banana For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 17:22.