Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,729,690 Members 47,114 Now Online
XDA Developers Android and Mobile Development Forum

[PROJECT] HaRET on WP7

Tip us?
 
dcordes
Old
(Last edited by dcordes; 22nd January 2013 at 04:36 PM.)
#1  
dcordes's Avatar
Senior Recognized Developer - OP
Thanks Meter 259
Posts: 703
Join Date: Nov 2007

 
DONATE TO ME
Arrow [PROJECT] HaRET on WP7

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.
What I do
* port Linux (kernel) to HTC phones like the hd2
* document everything about development and make it easily available
* provide non-Android distros for Linux enabled HTC phones for more diversity
Publicly accessible tech wiki htc-linux.org
My personal twitter
dcordes
The Following 81 Users Say Thank You to dcordes For This Useful Post: [ Click to Expand ]
 
nhathoa
Old
#2  
nhathoa's Avatar
Senior Member
Thanks Meter 211
Posts: 1,029
Join Date: 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: [ Click to Expand ]
 
egzthunder1
Old
#3  
egzthunder1's Avatar
Member Advocate Admin - Spirit of XDA
Thanks Meter 4688
Posts: 18,210
Join Date: Jul 2005
Location: At The Good End Of My Hammer, Likes: My Family & XDA, Dislikes: Incompetence
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.

"As I walk through the Valley of the Shadow of Death, I fear no evil for I am the God of Death... and this is my valley"



I have ORD

Want to see my devices? Click Below

 
HTC Blue Angel
ROM: WM 6.5.3 Build 23698 by d-two
Radio: 1.15

HTC Vogue (Verizon Touch)
ROM: Froyo Android (NAND) by incubus26j
Radio: 3.42.50

HTC EVO 3D
ROM: YAS4 v9 by howpathetic (ICS 4.0.4)
PRI: 1.43_003
Radio: 1.09.00.0706
HBOOT: Eng HBOOT (S-OFF)

Sony Xperia T LT30p
ROM: Stock, 91.A.0.148 (Jelly Bean 4.1.2)
Bootloader: Locked

Sony Xperia Z Ultra - GPE
ROM: Stock, Unrooted (KitKat 4.4.2)
Bootloader: Locked

Huawei Premia 4G
ROM: Stock, Rooted (ICS 4.0.4)

HTC One (M8)
ROM: Stock, unrooted (1.57.531.7)
Radio: 1.16.21331931
HBOOT: Locked (S-ON)




Learn how to flash: CDMA Rapahel, Vogue
The Following 4 Users Say Thank You to egzthunder1 For This Useful Post: [ Click to Expand ]
 
Jaxbot
Old
#4  
Recognized Developer
Thanks Meter 546
Posts: 1,218
Join Date: Mar 2009

 
DONATE TO ME
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!
That guy from Windows Phone Hacker, 2009-2013. Retired June 2013.
Personal Blog | Twitter | Youtube
The Following 2 Users Say Thank You to Jaxbot For This Useful Post: [ Click to Expand ]
 
nikola360
Old
#5  
Senior Member
Thanks Meter 19
Posts: 101
Join Date: 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?
 
egzthunder1
Old
#6  
egzthunder1's Avatar
Member Advocate Admin - Spirit of XDA
Thanks Meter 4688
Posts: 18,210
Join Date: Jul 2005
Location: At The Good End Of My Hammer, Likes: My Family & XDA, Dislikes: Incompetence
Quote:
Originally Posted by nikola360 View Post
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.

"As I walk through the Valley of the Shadow of Death, I fear no evil for I am the God of Death... and this is my valley"



I have ORD

Want to see my devices? Click Below

 
HTC Blue Angel
ROM: WM 6.5.3 Build 23698 by d-two
Radio: 1.15

HTC Vogue (Verizon Touch)
ROM: Froyo Android (NAND) by incubus26j
Radio: 3.42.50

HTC EVO 3D
ROM: YAS4 v9 by howpathetic (ICS 4.0.4)
PRI: 1.43_003
Radio: 1.09.00.0706
HBOOT: Eng HBOOT (S-OFF)

Sony Xperia T LT30p
ROM: Stock, 91.A.0.148 (Jelly Bean 4.1.2)
Bootloader: Locked

Sony Xperia Z Ultra - GPE
ROM: Stock, Unrooted (KitKat 4.4.2)
Bootloader: Locked

Huawei Premia 4G
ROM: Stock, Rooted (ICS 4.0.4)

HTC One (M8)
ROM: Stock, unrooted (1.57.531.7)
Radio: 1.16.21331931
HBOOT: Locked (S-ON)




Learn how to flash: CDMA Rapahel, Vogue
 
Jaxbot
Old
(Last edited by Jaxbot; 7th February 2012 at 12:26 PM.)
#7  
Recognized Developer
Thanks Meter 546
Posts: 1,218
Join Date: Mar 2009

 
DONATE TO ME
It's still Windows CE, there's nothing to emulate but the missing APIs
That guy from Windows Phone Hacker, 2009-2013. Retired June 2013.
Personal Blog | Twitter | Youtube
The Following User Says Thank You to Jaxbot For This Useful Post: [ Click to Expand ]
 
DJSave
Old
#8  
DJSave's Avatar
Senior Member
Thanks Meter 110
Posts: 308
Join Date: Oct 2011
Location: Tbilisi
As the MAGLDR for Samsung focus/omnia7 will be out in around just now , maybe it will be possible to manage smthng
 
dcordes
Old
(Last edited by dcordes; 8th February 2012 at 01:12 AM.)
#9  
dcordes's Avatar
Senior Recognized Developer - OP
Thanks Meter 259
Posts: 703
Join Date: Nov 2007

 
DONATE TO ME
nhathoa egzthunder1, thank you very much for the kind welcome

Quote:
Originally Posted by Jaxbot View Post
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 View Post
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.
What I do
* port Linux (kernel) to HTC phones like the hd2
* document everything about development and make it easily available
* provide non-Android distros for Linux enabled HTC phones for more diversity
Publicly accessible tech wiki htc-linux.org
My personal twitter
dcordes
 
Jaxbot
Old
#10  
Recognized Developer
Thanks Meter 546
Posts: 1,218
Join Date: Mar 2009

 
DONATE TO ME
Quote:
Originally Posted by dcordes View Post
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.
That guy from Windows Phone Hacker, 2009-2013. Retired June 2013.
Personal Blog | Twitter | Youtube

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

Advanced Search
Display Modes