Post Reply

[PROJECT] HaRET on WP7

OP dcordes

6th February 2012, 11:50 AM   |  #1  
dcordes's Avatar
OP Senior Recognized Developer
Thanks Meter: 259
 
703 posts
Join Date:Joined: Nov 2007
Donate to Me
Hi
* Please help keeping the noise level low: Don't ask for ETA (stuff will be anounced), use Thanks buttons to say thx, etc.
* This will work on "fully unlocked" WP7 devices only and is not limited to specific phones

thx, dcordes

HaRET (Handhelds Reverse Engineering Tool) has been used on smartphones and PDAs with previous WinCE (Windows Mobile) versions to

* boot the Linux kernel (=> use Linux based OS like Android)
* obtain information about hardware and software (=> reverse engineering) in order to accordingly modify the Linux kernel (drivers).

Famous HTC devices that are capable of running HaRET are the QSD8250 based HTC HD2 and a wide range of MSM7xxA based phones like the diamond, raphael and touch pro 2.

WP7 is and will be shipped on many devices with quality hardware. In order to be able to run Linux on these, a novel aim is to investigate the use of HaRET on WP7 based devices. WP7 is known to posess several mechanisms to prevent this.

A discussion about the problem has beend started on the official HaRET development mailing list by Jaxbot:
http://lists.linuxtogo.org/pipermail...ry/000150.html
You need to send a subscription mail in order to write to the list. The original creators of HaRET as well as many good developers with low level skills (from XDA: Cotulla, NetRipper, cr2) are subscribed to it but maybe not many of them have access to a WP7 device.

HaRET source code repository with history:
http://git.linuxtogo.org/?p=groups/haret/haret.git

Documentation of the HaRET project (publicly accessible wiki):
http://htc-linux.org/wiki/index.php?title=HaRET
See http://htc-linux.org/wiki/index.php?...on#Development for how to compile.

We should discuss the technical possibilites and challenges (if any ) about this project in this thread.

Update: Lots of insight has been gained. Since progress is rapid, uptades are not listed here yet. Please read the full thread for now.
Last edited by dcordes; 22nd January 2013 at 04:36 PM.
The Following 81 Users Say Thank You to dcordes For This Useful Post: [ View ]
6th February 2012, 01:05 PM   |  #2  
nhathoa's Avatar
Senior Member
Thanks Meter: 211
 
1,029 posts
Join Date:Joined: Dec 2006
Donate to Me
Hi, I and all WP7 users waiting for your result HaRET project.
Thanks for your great work. And I would like to send you a cup of Heiniken beer.
Confirmation number: 0W3951910E743222Y
The Following 4 Users Say Thank You to nhathoa For This Useful Post: [ View ]
6th February 2012, 04:41 PM   |  #3  
egzthunder1's Avatar
Member Advocate Admin - Spirit of XDA
Flag At The Good End Of My Hammer, Likes: My Family & XDA, Dislikes: Incompetence
Thanks Meter: 5,009
 
18,533 posts
Join Date:Joined: Jul 2005
More
Hey dcordes,

I did a bit of housecleaning on this thread as I would hate to see this become your old Android-HD2 port thread

I want to see some real discussions going on in here (for a change).

So, HaRET must be, if memory serves me well, developed based on the processor, right? If it worked so well for the HD2, considering that most WP7+ devices from HTC also use Snapdragon's.... it should only take a few tweaks to get it to run (at least compatibility with HW) with most HTC WP7+ devices. The problems will be (I guess):

* Porting over from WM6.5 to WP7+ (may not be as bad as it sounds);
* Making sure that whatever this thing is coded with, it does not have interoplock code running on it (which I think will be kinda difficult considering that several apps that require access to less critical areas of the device require this). if it is interoplocked, then you will run into the issue of multiple versions out there (see Heathcliff's interopunlock thread to see/learn about the HTC variants on the new drivers, etc);
* Drivers, kernels, etc... but I believe that the HW specs between WP7+ devices and the HD2 are not so different, so you may even be able to get the same kernels to work with a few tweaks.

My Titan is already drooling with expectation


Please let me know if this thread needs further cleaning....

Good to see you back.
The Following 4 Users Say Thank You to egzthunder1 For This Useful Post: [ View ]
6th February 2012, 10:17 PM   |  #4  
Recognized Developer
Thanks Meter: 548
 
1,221 posts
Join Date:Joined: Mar 2009
Donate to Me
More
I feel somewhat obligated to make an appearance, then

Here's what I know, on the WP7 side of things:
A lot of APIs were removed, but the core pieces of CE still remain. I don't know what HaRET does to load Linux into the memory, but I would be shocked if it wasn't possible.

Part of the APIs that were removed were GUI related. This is why HaRET segfaults when you try to load it on a full unlocked device. If these pieces were removed, making it rely only on the command line, the loader might actually work, more or less. A WP7 Silverlight app could easily be built to serve as a launcher for it.

Those pieces aside, it is basically the technical pieces that have yet to be dug into that we are bound to run into. Curious to see what will happen, glad to see this getting some attention Cheers!
The Following 2 Users Say Thank You to Jaxbot For This Useful Post: [ View ]
6th February 2012, 10:44 PM   |  #5  
Senior Member
Thanks Meter: 19
 
101 posts
Join Date:Joined: Apr 2008
for HD2 ok, but for other phone that hasn't SD card?..... i hope however Ubuntu 0.4 will go on magldr, right?
6th February 2012, 11:04 PM   |  #6  
egzthunder1's Avatar
Member Advocate Admin - Spirit of XDA
Flag At The Good End Of My Hammer, Likes: My Family & XDA, Dislikes: Incompetence
Thanks Meter: 5,009
 
18,533 posts
Join Date:Joined: Jul 2005
More
Quote:
Originally Posted by nikola360

for HD2 ok, but for other phone that hasn't SD card?..... i hope however Ubuntu 0.4 will go on magldr, right?

Most wp7 phones have the SD built in or in some form of flash storage capability. But you do make a good point, I guess.

Sent from my 4.7" Titan.... My device IS bigger than yours.
7th February 2012, 10:24 AM   |  #7  
Recognized Developer
Thanks Meter: 548
 
1,221 posts
Join Date:Joined: Mar 2009
Donate to Me
More
It's still Windows CE, there's nothing to emulate but the missing APIs
Last edited by Jaxbot; 7th February 2012 at 12:26 PM.
The Following User Says Thank You to Jaxbot For This Useful Post: [ View ]
7th February 2012, 10:46 AM   |  #8  
DJSave's Avatar
Senior Member
Flag Tbilisi
Thanks Meter: 110
 
308 posts
Join Date:Joined: Oct 2011
More
As the MAGLDR for Samsung focus/omnia7 will be out in around just now , maybe it will be possible to manage smthng
8th February 2012, 12:47 AM   |  #9  
dcordes's Avatar
OP Senior Recognized Developer
Thanks Meter: 259
 
703 posts
Join Date:Joined: Nov 2007
Donate to Me
nhathoa egzthunder1, thank you very much for the kind welcome

Quote:
Originally Posted by Jaxbot

Here's what I know, on the WP7 side of things:
A lot of APIs were removed, but the core pieces of CE still remain. I don't know what HaRET does to load Linux into the memory, but I would be shocked if it wasn't possible.

Part of the APIs that were removed were GUI related. This is why HaRET segfaults when you try to load it on a full unlocked device. If these pieces were removed, making it rely only on the command line, the loader might actually work, more or less. A WP7 Silverlight app could easily be built to serve as a launcher for it.

Those pieces aside, it is basically the technical pieces that have yet to be dug into that we are bound to run into. Curious to see what will happen, glad to see this getting some attention Cheers!

I don't have much insight on how the kernel is loaded either. Obviously it's important for HaRET to have a non-protected memory region it is allowed to write to and then there is something called trampoline that will flush remaining memory and execute the kernel...

GUI: http://htc-linux.org/wiki/index.php?...HaRET_commands
"HaRET is fundamentally a command-line driven application."

Can you try to rename your default.txt into startup.txt ? In presence of startup.txt inside the directory of the exectuable, HaRET will automatically run commands inside that file, rather than first showing the GUI. (Maybe it will still crash cause it still depends on the libraries although they won't be used ? See linload below)

Also be sure to create a file named earlyharetlog.txt and check the resulting log in haretlog.txt which would be a good thing to put on the mailing list.

The other way to invoke HaRET commands is through haretconsole (also check doku above). Once the gui shows you can tap a listen button and haret will launch a telnet server. You can then connect remotly from your computer OR (and that might become our replacement gui from a local telnet client on the phone. There is one available in the wp7 software manager: http://www.windowsphone.com/en-GB/ap...0-9d82b6b18213

One possible way to cut through all GUI right now is the linload feature of haret that will burn loader, kernel, startup.txt and initrd into one single exe . Requires local source code and build environment to create. I think it is very likly that this will not depend on any GUI libs so we should really try in case of startup.txt failure!

Beside linload we might create a HaRET stripped from GUI that will be accessible via haretconsole only until we have a new WP7 compatible GUI.

Regarding compiling: http://htc-linux.org/wiki/index.php?..._Documentation doesn't have anything on that. But the source code does: http://git.linuxtogo.org/?p=groups/h...;a=tree;f=docs

Quote:
Originally Posted by nikola360

for HD2 ok, but for other phone that hasn't SD card?..... i hope however Ubuntu 0.4 will go on magldr, right?

Doesn't matter, why would you need SD card ? I guess if a phone lacks SD, it will come with plenty internal storage that can hold at least a minimal rootfs of any Linux distro.

Yes HD2 Ubuntu will work with magldr, I already picked up the work with that but that's offtopic. I will anounce any news via hd2 ubuntu forum section and twitter.


EDIT: If somebody is willing to try, I can create a linload for HD2s that have WP7 flashed. This will be a perfect test setup because we have a known working Linux kernel for the HD2.
Last edited by dcordes; 8th February 2012 at 01:12 AM.
8th February 2012, 01:19 AM   |  #10  
Recognized Developer
Thanks Meter: 548
 
1,221 posts
Join Date:Joined: Mar 2009
Donate to Me
More
Quote:
Originally Posted by dcordes

nhathoa egzthunder1, thank you very much for the kind welcome



I don't have much insight on how the kernel is loaded either. Obviously it's important for HaRET to have a non-protected memory region it is allowed to write to and then there is something called trampoline that will flush remaining memory and execute the kernel...

GUI: http://htc-linux.org/wiki/index.php?...HaRET_commands
"HaRET is fundamentally a command-line driven application."

Can you try to rename your default.txt into startup.txt ? In presence of startup.txt inside the directory of the exectuable, HaRET will automatically run commands inside that file, rather than first showing the GUI. (Maybe it will still crash cause it still depends on the libraries although they won't be used ? See linload below)

Also be sure to create a file named earlyharetlog.txt and check the resulting log in haretlog.txt which would be a good thing to put on the mailing list.

The other way to invoke HaRET commands is through haretconsole (also check doku above). Once the gui shows you can tap a listen button and haret will launch a telnet server. You can then connect remotly from your computer OR (and that might become our replacement gui from a local telnet client on the phone. There is one available in the wp7 software manager: http://www.windowsphone.com/en-GB/ap...0-9d82b6b18213

One possible way to cut through all GUI right now is the linload feature of haret that will burn loader, kernel, startup.txt and initrd into one single exe . Requires local source code and build environment to create. I think it is very likly that this will not depend on any GUI libs so we should really try in case of startup.txt failure!

Beside linload we might create a HaRET stripped from GUI that will be accessible via haretconsole only until we have a new WP7 compatible GUI.

Regarding compiling: http://htc-linux.org/wiki/index.php?..._Documentation doesn't have anything on that. But the source code does: http://git.linuxtogo.org/?p=groups/h...;a=tree;f=docs


Doesn't matter, why would you need SD card ? I guess if a phone lacks SD, it will come with plenty internal storage that can hold at least a minimal rootfs of any Linux distro.

Yes HD2 Ubuntu will work with magldr, I already picked up the work with that but that's offtopic. I will anounce any news via hd2 ubuntu forum section and twitter.


EDIT: If somebody is willing to try, I can create a linload for HD2s that have WP7 flashed. This will be a perfect test setup because we have a known working Linux kernel for the HD2.

I've tried startup.txt, it still segfaults, won't even print out a log from what I can tell. I'll play around with some stuff and report back, though.

Post Reply Subscribe to Thread

Tags
haret wp7 htc
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes