FORUMS
Remove All Ads from XDA

[WIP][2.3.4]Kexec for the Droid X2-Development Thread

178 posts
Thanks Meter: 297
 
By twitish, Senior Member on 27th September 2012, 05:32 PM
Post Reply Email Thread
Hey all!

As some have seen, I have started serious work on getting kexec on the Droid X2 for Android 2.3.4. Here's what I have working so far:

Code:
procfs_rw.ko - Creates an empty slot in /proc/atags so we can place our atags in. 
LOADED AND ACCEPTED BY INSMOD!
Code:
kexec_load.ko - The main kernel module of Kexec.
LOADED AND ACCEPTED BY INSMOD!
Code:
kexec-tools - The actual kexec binary. This is what loads the new kernel and executes it.
Code:
Motorola DX2 Test Kernel - Nothing more than the stock DX2 kernel with native kexec and atag support, along with "-twitish" appended to the kernel version.
What works so far:
I have gotten the kernel to accept the proc_rw as well as the kexec_load modules.
The ATAGS (Some, maybe not all) have been found and load just fine.

What we need:
Patience

What can you possibly do to help?
Tomorrow I'm going to do a write-up on how I got my development environment set-up and post my git-hub links. If you have any experience with Linux and/or kexec, I encourage you to try it out and see what you can find. I can't notice everything.

Please be aware that I am NOT PROMISING I CAN GET KEXEC WORKING!!!!! I'm simply stating what I have done, and what I need.

I have a feeling we are close...very very close.

GitHub source to come soon.

Let's please try and keep this thread clean!
IF YOU WANT TO SAY "KEEP IT UP!" OR "GOOD JOB!" OR SOMETHING LIKE THAT, PLEASE JUST LIKE THIS POST!!!
The Following 57 Users Say Thank You to twitish For This Useful Post: [ View ] Gift twitish Ad-Free
 
 
27th September 2012, 05:32 PM |#2  
twitish's Avatar
OP Senior Member
Flag Virginia
Thanks Meter: 297
 
Donate to Me
More
Reserved For Tutorial on how to compile and stuff. (not today)
The Following 3 Users Say Thank You to twitish For This Useful Post: [ View ] Gift twitish Ad-Free
27th September 2012, 05:33 PM |#3  
twitish's Avatar
OP Senior Member
Flag Virginia
Thanks Meter: 297
 
Donate to Me
More
Reserved for (HOPEFULLY) Final Release.
The Following 3 Users Say Thank You to twitish For This Useful Post: [ View ] Gift twitish Ad-Free
27th September 2012, 05:59 PM |#4  
Pr0f_Farnsw0rth's Avatar
Member
Flag Seattle
Thanks Meter: 12
 
Donate to Me
More
Exciting! Keep up the great work. This could open lots of doors for our phone!
27th September 2012, 07:20 PM |#5  
agentlotek's Avatar
Member
Flag Houma, LA
Thanks Meter: 4
 
More
Reading Comprehension-FAIL!

Quote:
Originally Posted by Pr0f_Farnsw0rth

Exciting! Keep up the great work. This could open lots of doors for our phone!

Quote:
Originally Posted by twitish

Let's please try and keep this thread clean!
IF YOU WANT TO SAY "KEEP IT UP!" OR "GOOD JOB!" OR SOMETHING LIKE THAT, PLEASE JUST LIKE THIS POST!!!

28th September 2012, 01:10 AM |#6  
twitish's Avatar
OP Senior Member
Flag Virginia
Thanks Meter: 297
 
Donate to Me
More
PROGRESS REPORT FOR 09/27/12:
I have extracted the necessary cdt.bin from the phone and after talking with [mbm] (creator of sbf_flash) I was able to extract the ATAGS from it. The ATAGS are accepted by kexec, the new kernel is loaded into RAM, and then *poof* it freezes when kexec is actually executed. I'm going to try and see what I can find tomorrow by looking through the source of kexec. I think the problem lies in the kexec-tools, it seems to be looking at an incorrect memory block. (The one it is looking at doesn't exist on our device).
Still haven't heard back from Kholk, however, here's hoping that I wake up tomorrow with a PM from him.

ONE STEP CLOSER...

Again, unless you have something to say that pertains to the actual development of kexec, don't post. Just click "Thanks".
The Following 26 Users Say Thank You to twitish For This Useful Post: [ View ] Gift twitish Ad-Free
28th September 2012, 04:14 AM |#7  
ztotherad's Avatar
Senior Member
Flag Illinois
Thanks Meter: 614
 
More
Quote:
Originally Posted by twitish

PROGRESS REPORT FOR 09/27/12:
I have extracted the necessary cdt.bin from the phone and after talking with [mbm] (creator of sbf_flash) I was able to extract the ATAGS from it. The ATAGS are accepted by kexec, the new kernel is loaded into RAM, and then *poof* it freezes when kexec is actually executed. I'm going to try and see what I can find tomorrow by looking through the source of kexec. I think the problem lies in the kexec-tools, it seems to be looking at an incorrect memory block. (The one it is looking at doesn't exist on our device).
Still haven't heard back from Kholk, however, here's hoping that I wake up tomorrow with a PM from him.

ONE STEP CLOSER...

Again, unless you have something to say that pertains to the actual development of kexec, don't post. Just click "Thanks".

definitely cant wait to get this up and running.. i will definitely help when git is posted and see what i can do
28th September 2012, 05:10 AM |#8  
Inactive Recognized Developer
Wichita
Thanks Meter: 1,368
 
Donate to Me
More
I hate to be the "negative nacy" here, but unfortunately for twitish and the rest of the X2 community.... this is nothing new. If any of you have been following the work that I've done on kexec mine does the exact same thing, if not getting a bit further. I'm not trying to seem like the a-hole here crashing the party, but we can't sit here and think that at this state this is 'developement." In fact, it's not even up to date to what I have going for it because: the ATAGs

I highly doubt (as in I know) that whatever you have going in the /proc/atags is incorrect and will not properly load kexec. I have the correct atags data that we need. If you're willing to help me work on it, I will be willing to hand it over. But keep in mind that this isn't exactly something I'm just going to hand over easily, as they've been slightly tweaked for what we need.

As for why it's freezing (besides the atags thing). It is a problem with the cpu_reset function not properly working with ARMv7 platforms for 2.6.32 and it's even worse for the Tegra 2. Needless the say, from what I can tell, the caches aren't being properly cleared to allow the cpu to reset into the proper location with out it freaking out.

If you would like anymore information, please PM me here and I will give you more details.
The Following 10 Users Say Thank You to dragonzkiller For This Useful Post: [ View ] Gift dragonzkiller Ad-Free
28th September 2012, 05:00 PM |#9  
twitish's Avatar
OP Senior Member
Flag Virginia
Thanks Meter: 297
 
Donate to Me
More
Quote:
Originally Posted by dragonzkiller

I hate to be the "negative nacy" here, but unfortunately for twitish and the rest of the X2 community.... this is nothing new. If any of you have been following the work that I've done on kexec mine does the exact same thing, if not getting a bit further. I'm not trying to seem like the a-hole here crashing the party, but we can't sit here and think that at this state this is 'developement." In fact, it's not even up to date to what I have going for it because: the ATAGs

I highly doubt (as in I know) that whatever you have going in the /proc/atags is incorrect and will not properly load kexec. I have the correct atags data that we need. If you're willing to help me work on it, I will be willing to hand it over. But keep in mind that this isn't exactly something I'm just going to hand over easily, as they've been slightly tweaked for what we need.

As for why it's freezing (besides the atags thing). It is a problem with the cpu_reset function not properly working with ARMv7 platforms for 2.6.32 and it's even worse for the Tegra 2. Needless the say, from what I can tell, the caches aren't being properly cleared to allow the cpu to reset into the proper location with out it freaking out.

If you would like anymore information, please PM me here and I will give you more details.

Sent a PM. I'll start looking into the kexec code.

I figured you had the correct ATAGs, I knew you had been in contact with kholk and probably got them. As for me, mine were simply extracted from the CDT because that would at least give me a starting point.

No worries about being a negative nancy! Lol. I'd rather have someone come in and tell me I'm doing something wrong than waste my time following something that doesn't work.

I'm looking forward to future collaboration dragonzkiller. Hopefully we can get this working.
The Following 10 Users Say Thank You to twitish For This Useful Post: [ View ] Gift twitish Ad-Free
1st November 2012, 11:18 PM |#10  
twitish's Avatar
OP Senior Member
Flag Virginia
Thanks Meter: 297
 
Donate to Me
More
Progress Report!!
Hey guys!!! How are you?? I'm great now. Life is back to normal!!! Anyways, Here's some good news!!!


So, I got Kexec to finally REBOOT THE PHONE!!! However, it doesn't load the new kernel. It may have been a bad kernel though, as I haven't touched any of this since about a month ago. So! A new one is compiling right now.

I don't think it is the new kernel though, it probably has to do with either the incorrect ATAGs I'm probably using. (Haven't talked to DZK yet, WILL DO!!!) Or it's something else that I don't know. HA!

Anyways, I'm back. I'm all in. And I'm TRYING MY HARDEST to get you guys kexec.

I'm sure at this point it is a really simple fix. (HOPEFULLY!)

Tl;dr

It loads the new kernel, loads the initrd, REBOOTS!!! (it froze before), then reboots back into the stock kernel.

NEW INFO:
Compiled the new kernel, no-go. Freezes again. Hopefully DZK's ATAGs are the trick.
The Following 10 Users Say Thank You to twitish For This Useful Post: [ View ] Gift twitish Ad-Free
2nd November 2012, 12:06 AM |#11  
Lrs121's Avatar
Senior Member
Flag Moscow, ID
Thanks Meter: 613
 
Donate to Me
More
Sounds great. What kind of set up do you have and what are the requirements for setting up a machine to try and work on a kexec for the mx2 myself.

Sent from my CM10 MX2
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes