FORUMS
Remove All Ads from XDA

[Release] RT Jailbreak Tool

886 posts
Thanks Meter: 565
 
By netham45, Inactive Recognized Developer on 10th January 2013, 01:01 PM
Thread Closed Email Thread
23rd October 2013, 06:31 AM |#431  
Member
Thanks Meter: 34
 
More
microsoft will not block rt8.0 on surface rt until 2015
they release the 8.0 recovery image:http://www.microsoft.com/en-us/downl....aspx?id=40810[COLOR="Silver"]
27th October 2013, 11:41 PM |#432  
Junior Member
Thanks Meter: 0
 
More
Question Jailbreak + Vs2012 debugger
Thanks for the jailbreak tool. I wonder, why microsoft themselves don't provide such a nice and useful tool

So, the jailbreak works on my Windows RT asus vivo tab. I have some command line test apps and they run properly. However, to execute them on the device I have to manually copy them to the device and run.
I have remote debugging tools installed on the tab and they work. If open a sample c++ or c# project from windows 8 samples, then I can deploy it to the tab straight from VS. However, it doesn't work for console apps. Any clues if that's possible at all? It's kind of not very handy to copy cmd line builds manually to the device and then provide some kind of delay on start up so that I could attach with the debugger before my cmd line app starts.
29th October 2013, 11:13 PM |#433  
Junior Member
Thanks Meter: 0
 
More
Getting GCC to target Windows RT
Netham45,

this your post to GCC list Getting GCC to target Windows RT is the only explanation so far about my inability to get 32-bit ARM running.
You wrote:
Quote:

Can use ARM code, but interrupt handlers will (incorrectly) throw the
CPU back into THUMB mode upon return, therefore ARM code is highly
unstable

That would explain the issue that I'm having. Do you have anymore info? Does that mean that I should completely forget about 32-bit ARM, or it's still possible to use it? Is that OS bug?
30th October 2013, 08:36 PM |#434  
Senior Member
Thanks Meter: 102
 
More
Quote:
Originally Posted by mtlgui

Netham45,
That would explain the issue that I'm having. Do you have anymore info? Does that mean that I should completely forget about 32-bit ARM, or it's still possible to use it? Is that OS bug?

I assume you got your answer in your other thread:

Quote:
Originally Posted by Myriachan

"ARMNT" is the PE image type of ARMv7-Thumb2. Visual C++ uses the #define _M_ARM_NT, though _M_ARM is also #defined by the compiler. Windows RT never leaves Thumb2 mode. In fact, the context switch routines in the kernel set the Thumb bit of CPSR when saving the CPU context of a frozen task, meaning that any interrupt will cause an ARM program to crash when control returns.

I know how to fix this - it's a matter of flipping a total of two bits in the kernel - the Thumb bit in a bitmask in an opcode in two functions. The problem is that PatchGuard doesn't like kernel hacks very much, and PatchGuard is a huge pain to work around.


Basically you should "completely forget about 32-bit ARM" if you don't want to wait on the efforts of others to fix this issue.

Now, is it an OS bug? Well, I guess that depends on how you look at it. Microsoft never intended anyone to really write software except through Visual Studio for the Windows Store only, and that the Windows 8 Product Guide for Developers notes "You can program your apps using C#, C++, or Visual Basic", i.e. high level languages that, in general, means you shouldn't be worrying about what the compiler outputs anyway, whether it's x86, x64, Thumb-2, or some other architecture. If you look at it from that point of view, then the OS can manage the CPU however it wants and it's not really a "bug" since it's working as designed. It's just an annoyance to those trying to work outside of Microsoft specs.
1st November 2013, 06:22 AM |#435  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by southbird

I assume you got your answer in your other thread:

Yes, that post was written before I discovered that golden nugget about OS bug with ARM mode... otherwise I'd kept trying to fix something that was impossible from the beginning. I ended up rewriting a few thousand lines of arm asm. It wasn't that bad, since most of it assembles just fine for thumb2. Major pain happens when some instructions need to be rewritten/modified to be acceptable for thumb2. It took me less time to rewrite it than I wasted trying to run simplest arm asm

Quote:
Originally Posted by southbird

Basically you should "completely forget about 32-bit ARM" if you don't want to wait on the efforts of others to fix this issue.

Now, is it an OS bug? Well, I guess that depends on how you look at it...

Well, to me it's pretty clear: either it's a bug, or intended "feature" with primary intention to defeat rival browsers to get their products ported to arm-WinRT on time or make them crippled so that end-users stop liking these sluggish browsers and had a second look at old good explorer
Rewriting JIT engines to generate Thumb2 instead of arm is a huge task: suddenly all instructions are encoded differently and on top of that there are different constraints now... AFAIK one my classmate works on v8 engine at google... lots of new tasks I guess for them
Even though MS talks about high level languages, they still distribute armasm as part of windows RT sdk/visual studio. There are newer docs on their site for armasm. In armasm you can specify to assemble in 32-bit mode which cannot run on the device. So, it's difficult to say why they did it this way... it difficult to believe that they are so dumb to make that mistake, at the same time I don't see any reason to force it to be Thumb2.
1st November 2013, 01:41 PM |#436  
kitor's Avatar
Senior Member
Thanks Meter: 28
 
More
Quote:
Originally Posted by mtlgui

or intended "feature" with primary intention to defeat rival browsers to get their products ported to arm-WinRT on time or make them crippled so that end-users stop liking these sluggish browsers and had a second look at old good explorer .

As long as you're running non-jailbroken device, this argument is invalid, as you just can't run any native code. After jailbreaking it's yours problem, not MS, so why should they care?
3rd November 2013, 02:15 AM |#437  
Myriachan's Avatar
Senior Member
Thanks Meter: 177
 
More
There is a certain amount of opcode interpretation done by the NT kernel. As an example from the x86 world, the NT kernel distinguishes between exception codes STATUS_INTEGER_DIVIDE_BY_ZERO and STATUS_INTEGER_OVERFLOW. The latter means integer divide overflow, which can easily occur in assembly language or intrinsics, but in straight C can only occur if you divide 0x80000000 by -1 as signed division.

The problem is that the x86 processor exception is the same for both divide by zero and divide overflow - interrupt 0. In order to distinguish the two cases, the NT kernel actually has to decode the faulting CPU instruction to see whether its parameter was zero.

On ARM, you see this with the invalid opcode handler. The UND (intentionally-undefined) opcode handler assigns special meaning to the low byte.

If the kernel allowed user mode to use ARM code, it would mean that the kernel would have to be able to decode opcodes in ARM mode, as well. I guess that they didn't want to have to do that.
The Following 2 Users Say Thank You to Myriachan For This Useful Post: [ View ] Gift Myriachan Ad-Free
3rd November 2013, 03:57 AM |#438  
Senior Member
Flag Thessaloniki
Thanks Meter: 223
 
More
Quote:
Originally Posted by Myriachan

There is a certain amount of opcode interpretation done by the NT kernel. As an example from the x86 world, the NT kernel distinguishes between exception codes STATUS_INTEGER_DIVIDE_BY_ZERO and STATUS_INTEGER_OVERFLOW. The latter means integer divide overflow, which can easily occur in assembly language or intrinsics, but in straight C can only occur if you divide 0x80000000 by -1 as signed division.

The problem is that the x86 processor exception is the same for both divide by zero and divide overflow - interrupt 0. In order to distinguish the two cases, the NT kernel actually has to decode the faulting CPU instruction to see whether its parameter was zero.

On ARM, you see this with the invalid opcode handler. The UND (intentionally-undefined) opcode handler assigns special meaning to the low byte.

If the kernel allowed user mode to use ARM code, it would mean that the kernel would have to be able to decode opcodes in ARM mode, as well. I guess that they didn't want to have to do that.

This kinda complicates things , no? Are there any other interrupt/exception handlers that work like this?

Sent from my GT-I9505 using Tapatalk
3rd November 2013, 09:02 AM |#439  
Myriachan's Avatar
Senior Member
Thanks Meter: 177
 
More
Quote:
Originally Posted by MemoryController

This kinda complicates things , no? Are there any other interrupt/exception handlers that work like this?

Yes. It looks like the page fault handler also uses this mechanism to know where the page fault was. I guess ARM doesn't have anything like the x86's CR2 register =/
3rd November 2013, 09:11 AM |#440  
Senior Member
Flag Thessaloniki
Thanks Meter: 223
 
More
Quote:
Originally Posted by Myriachan

Yes. It looks like the page fault handler also uses this mechanism to know where the page fault was. I guess ARM doesn't have anything like the x86's CR2 register =/

I was reading the ARM ARM yesterday and you can use CP15 c6 to get MVA of page fault and c5 for the reason.

Sent from my GT-I9505 using Tapatalk
4th November 2013, 08:54 AM |#441  
Inactive Recognized Developer
Flag Seattle
Thanks Meter: 2,950
 
More
@kitor: Native code is fully supported on RT; what are you talking about? You can use C/C++ source code, and libraries written in the same, just fine. MS restricts which native APIs you are allowed to use for Store apps, but many Store apps - especially games - are mostly or entirely native code.
Thread Closed Subscribe to Thread

Tags
hack, jailbreak, windows, windows rt, winrt
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes