yashsingh1/xdaforums huggingface dataset:
[Android Q&A, Help & Troubleshooting] wuzzzzz:
Unfortunately i just experienced the same problem. Searching on Google and it seems its becoming a common complaint. I think its a hardware problem.

P. S.

Mine is just 4 days old.
[Motorola Droid X2] twitish:
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:

[B]procfs_rw.ko[/B] - Creates an empty slot in /proc/atags so we can place our atags in.
[B]LOADED AND ACCEPTED BY INSMOD![/B]

[B]kexec_load.ko[/B] - The main kernel module of Kexec.
[B]LOADED AND ACCEPTED BY INSMOD![/B]

[B]kexec-tools[/B] - The actual kexec binary. This is what loads the new kernel and executes it.

[B]Motorola DX2 Test Kernel[/B] - 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. :D

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. :D

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!!!
[Motorola Droid X2] twitish:
Reserved For Tutorial on how to compile and stuff. (not today)
[Motorola Droid X2] twitish:
Reserved for (HOPEFULLY) Final Release. :D
[Motorola Droid X2] Pr0f_Farnsw0rth:
Exciting! Keep up the great work. This could open lots of doors for our phone!
[Motorola Droid X2] agentlotek:
Reading Comprehension-FAIL! :p
[Motorola Droid X2] 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. :D

ONE STEP CLOSER...

Again, unless you have something to say that pertains to the actual development of kexec, don't post. Just click "Thanks". :D
[Motorola Droid X2] ztotherad:
definitely cant wait to get this up and running.. i will definitely help when git is posted and see what i can do
[Motorola Droid X2] 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.
[Motorola Droid X2] twitish:
Sent a PM. I'll start looking into the kexec code. :D

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.
[Motorola Droid X2] twitish:
Progress Report!!

Hey guys!!! How are you?? I'm great now. :D 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. :D

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. :D

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.
[Motorola Droid X2] Lrs121:
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
[Motorola Droid X2] twitish:
Any sort of computer that you have will work. I'm using an older desktop with Arch Linux on it.

You just have to be able to set-up a cross-compiler, be comfortable enough with the Linux Kernel and have the proper files necessary to boot the new kernel.
[Motorola Droid X2] Lrs121:
Perfect ill have to get my Linux systme up and running and get on it. Ill have some stuff to look up but ill be on track with it soon

Sent from my CM10 MX2
[Motorola Droid X2] Deleted member 4177996:
I would suggest seeing if it can load a different stock kernel so you rule out that its a problem with the kernel.
[Motorola Droid X2] twitish:
The kernel that I'm trying to load is a stock kernel. It's just I was trying out some stuff and it may have been one of my experiments.
[Motorola Droid X2] dragonzkiller:
You need to check /data/system/dropbox after the system "reboots." If at any point the phone showed the Motorola logo it was because of a kernel panic and not because of a kexec reboot. In that folder there should be gziped files about APAINC_CONSOLE. That contains the dmesg of what was happening when the panic occurred. Probably a bad pointer or a pointer to a NULL space in memory.
[Motorola Droid X2] 32BitWhore:
Is it weird that I'm impressed by every post you make? It's weird, isn't it.
[Motorola Droid X2] DroidDioxide:
Collaboration :)
[Motorola Droid X2] ztotherad:
definitely love reading collaboration between devs trying to fix a phone that was abandoned by a good phone company (other than not unlocking the bootloader on the droid x2)
[Motorola Droid X2] twitish:
I checked it. And no, the Motorola logo did not show.

If anything, it might have just soft rebooted randomly. Knowing this phone that's not out of the question. Lol.
[Motorola Droid X2] dragonzkiller:
For those of you who are wondering, I'm playing around with a kexec-hardboot that works on another Tegra 2. It's going to require a lot of working around but it mentions the problems with the phone freezing during the reboot phase. I've managed to get it really close to working, but this goes back to the NULL pointer thing I mentioned earlier. If I can get it to not be a null pointer, we'd (probably) be golden.
[Motorola Droid X2] jsgraphicart:
Thanks for the awesome update. :)
[Motorola Droid X2] GoClifGo05:
Good news for the X2. Thanks DZK.
[Motorola Droid X2] AKShotgun:
Looking at this post makes me want to have linux machine.
[Motorola Droid X2] DigitalMD:
What have you gpt? You can always run Linux in a VM,,,,,,,,,,,,,,,,
[Motorola Droid X2] sickopsycho:
Or you can always run a dual boot. I actually prefer a dual boot BC it runs faster with less hardware conflicts
[Motorola Droid X2] AKShotgun:
I'm thinking about that
[Motorola Droid X2] AKShotgun:
I wonder how development is going on this
[Motorola Droid X2] 32BitWhore:
I'm assuming it's stalled after DZK's last post, seeing as he seems to be further along than twitish and his phone is toasted. I'm considering doing some reading up seeing as I'm comfortable in a Linux environment. Never personally messed with kexec but maybe DZK will part with some wisdom before he bows out entirely.
[Motorola Droid X2] Lrs121:
I have a lot to learn but is it possible to take the output string from something like abootimg -i to get a large group of information about the bootimg to create atags for a device? im certain that some of the information in the output would be important such as the memory offset address for the kernel in which the new kernel would be inserted replacing the old.

Example output from the readme on abootimg

$ ./abootimg -i boot.img
71
72
Android Boot Image Info:
73
74
* file name = boot.img
75
76
* image size = 8388608 bytes (8.00 MB)
77
page size = 2048 bytes
78
79
* Boot Name = ""
80
81
* kernel size = 3002744 bytes (2.86 MB)
82
ramdisk size = 1639626 bytes (1.56 MB)
83
84
* load addresses:
85
kernel: 0x10008000
86
ramdisk: 0x11000000
87
tags: 0x10000100
88
89
* cmdline = mem=448M@0M nvmem=64M@448M vmalloc=320M video=tegrafb console=tty0 usbcore.old_scheme_first=1 quiet splash elevator=noop tegraboot=sdmmc cmdpart=1:7168:10240,2:17408:16384,3:35840:614400,4:4004864:27096064
90
91
* id = 0x07571070 0x13950a6a 0x185c996f 0x9ab7b64d 0xcccd09bd 0x00000000 0x00000000 0x00000000
[Motorola Droid X2] twitish:
The ATAGS do contain all that information plus some, however its in a different format than what we could write by hand (aka binary). The only way to get the ATAGs is through a kernel module *built in*, which it wasn't on our devices. There is an incomplete version in the CDT.bin, and I believe what Dzk did is get a copy from one of our sister devices (Atrix or Xoom) and edit it to match our device.

Dzk is more connected than I am and I wasn't aware of the fact that the CDT is an incomplete ATAGs. I have a good 2 weeks free and am hoping to really work on this. I hope I can touch bases with Dzk soon.
[Motorola Droid X2] Lrs121:
So the only thing stopping us from using the atag in the cdt.bin is incompletion. And porting one from another device is no small task in of itself due to the way its written. The questions I have now is what's missing from our incomplete atag? Can our atag be compared to another similar devices and updated to include the missing code? And what is it written in the? formmating I've seen is like a mixture and cross of ASCII and object oriented coding.

Sent from my MX2
[Motorola Droid X2] twitish:
We have the ATAGs. That is not what is holding this up. Yes, the ATAGs that we have were made by editing another devices.
[Motorola Droid X2] Lrs121:
Sorry forgot to mention I'm working with the mx2 not the dx2. Which means there's a probability that the atags wont work. What exactly is holding it up for the dx2? I know that the atags work and the kexec gets the device to reboot.

Sent from my MX2
[Motorola Droid X2] twitish:
I'm sure that the MX2 and the DX2 have the same ATAGs. Once it's working on the DX2 I could easily port it to the MX2 provided I had a copy of the CDT.bin if in fact there are any differences.

The problem lies in the actual Kexec binary not liking the Tegra 2. First, it doesn't quite clear the caches properly, and when it does there seems to be a bad pointer somewhere.
[Motorola Droid X2] Lrs121:
There is probably minor differences in the kernel itself between the devices which is why dzk had to create a wifi module specificaly for the mx2. If you could port it that be great but focus on the dx2 for now I've go something brewing on the back burner that should(I hope) unlock the kernel for mx2s. Also is it just the tegra processor in our phone? I imagine other devs have gotten it to work on other tegra 2 devices. If so could we do a port of sorts to better suit our devices? Which I imagine is what you are and what dzk was working on.

Sent from my MX2
[Motorola Droid X2] 4x4snowboard:
kexey freeze problems

so I was talking with a developer for htc about our struggle here and he actually said that the problem with using the kexey command is that even if it succeeds you loose the ability to govern the processor, so it runs full tilt always. He even went so far as to say that's why DZK's phone probably went out. I don't know if that's correct, but I'm wondering if anyone knows differently...
[Motorola Droid X2] twitish:
Dzk (as far as I know) never got a new kernel to boot. And I don't seem to have any problems on my Kexec cm10 Razr....

If there's something wrong with the kernel then yes, I could see that getting true.
[Motorola Droid X2] Lrs121:
If my intuition is right a kexec should work for both devices as long as the stock kernel is the same version especially the revision number

Sent from my MX2
[Motorola Droid X2] 4x4snowboard:
ok, so now my 2nd question is this, what would it take/is it possible/ to write a polymorphic algorithm to hack the bootloader on our phone?
[Motorola Droid X2] twitish:
who knows. It would take YEARS to finish though. And even if you had the key, there is no way to use it. The "fastboot oem unlock" command is a stub for us. Therefore it just doesn't do anything.
[Motorola Droid X2] AKShotgun:
They got the bootloader unlocked on the attic 4g. Does that mean anything?
[Motorola Droid X2] DigitalMD:
no, means nothing to us..., the problem is the Dx2 is still bootlaoder locked and moto and verizon won't unlock it. they would rather you buy a new phone.
[Motorola Droid X2] twitish:
The Atrix 4G's bootloader was unlocked via a leak found on the Moto Servers. The file automatically ran the "fastboot oem unlock" and issued the correct key there.

If you boot into fastboot on our device, type in "fastboot oem unlock", enter EVEN A VALID KEY, the function of that command is basically this:

int oem( char *command[], char string *key[] ) {
//HAHA!!! THIS DOES NOTHING!!!
return 0;
}

THEREFORE, we WILL NOT be able to unlock the bootloader. Kexec is the only way.

P.S. Anymore questions, please post in another thread. Do not derail this thread.
[Motorola Droid X2] AKShotgun:
Has anyone tried 2ndboot? It supposedly runs like kexec.
[Motorola Droid X2] Lrs121:
From my understanding its simmilar but not quite the same, 2ndboot uses scripts to essentially cause the os to transfer the boot process to a second "bootloader" (a bunch of scripts with the calls for loading the rom and kernel modules) which form my reading it acrually works closer to the system we use for 2nd init. Im not gonna say its not possible to use cause anything is possible especially if we can work the scripts for the 2ndboot into the 2nd init setup allowing to the 2nd init to process the scripts used to load 2nd boot "bootloader." in theory this would be easier to do given that the main issue with kexec is essentially by passed by using tools that were written from the ground up to work with arm all it needs is compiling for our cpus specific architecture. in reality it coimes down to twittish hes got everything to make either one work eventually even, i cant really do it cause i dont have a DX2 to work with only the mx2 cause it uses the devices kernel source code and only the dx2's has been partially released. I could probably compile it but id be up to someone else to run it on their phone and provide me with logs and details as to whats working and what isnt making the proceess to get it furntioning longer. also as a side note it seems to have been made for omap devices i dont know if it will work on tegra processors.
[Motorola Droid X2] 4x4snowboard:
So I feel like the little kid anxiously awaiting a great surprise, and repeatedly asking, "is it ready?" "When can I have it?"... but I still am desirous to know, "what's up? Is it ready? When can I have it?" Sorry to be a bother....
[Motorola Droid X2] twitish:
Unfortunately, I haven't touched this since about thanksgiving. I have a final tonight and then I'm done for the semester. Hopefully I can continue working then. :)
[Motorola Droid X2] 4x4snowboard:
i can understand that. I've got my last one tomorrow as well... yay....
[Motorola Droid X2] 4x4snowboard:
so what's been happening around here? it seems like things have slowed down again....
[Motorola Droid X2] tshelby73:
My guess is everyone but me got a new phone for Christmas and Droid x2 has been abandoned
[Motorola Droid X2] ktklein72:
Nope. I'm still using mine.
[Motorola Droid X2] bad bone:
Not the only 1:(

don't be scared it's only a phone :)

ogd x d2g x2 sg3

old ladies :( ^
[Motorola Droid X2] Lrs121:
I dont know about twitish but my progress has pretty much stalled out trying to get a kernel built if i can get that done ill be this much closer to finishing.
[Motorola Droid X2] tamlin42:
Plenty of people still using dx2, but if you're like me and got it when they were offering it B1G1, you're coming up for upgrade around april. Not much reason in dev'ing for it anymore, even if people WERE dev'ing for it.

Everything that can be done for these phones has been done barring the intervention of the manufacturer or carrier.
[Motorola Droid X2] PunkUnity:
So this is pretty much dead then? No reviving the X2 with some KK love?
[Motorola Droid X2] josuearisty:
I think its better to let this phone rest in peace or better use it with stock roms as a multimedia player to play videos and more to a hdtv, like Im doing.

Enviado desde mi MB865 mediante Tapatalk
[Motorola Droid X2] ultravioletnanokitty:
so [MENTION=4152732]dragonzkiller[/MENTION]... now that this poor device lies dormant and covered in dust, do you feel like posting your "droid x2 kexec work wolder" on github or something? i've got my long-unused dx2 here just begging for some new development, and i'm starting to work on kexec for the verizon/att galaxy s4 as well. seems to me that keeping essential information for getting kexec working hidden will do nothing but ensure that the droid x2 dies a sad and undeserved death... yes, i am aware of how old this device is and how minimal its specs are. i am aware of the overall lack of support for tegra2-based devices in android, especially newer versions. i'm also aware that the majority of users have long abandoned this little-appreciated device, but i feel you're one of the best to appreciate just how much it can do ^^ i'd still like to do my best to bring better cm builds (of all versions possible) to this device, even if i'm the only one who ever uses them. perhaps i won't get anywhere, but if the sources are out there there's at least a chance that i or someone else will!

hoping you're willing to give this device hope...
[Motorola Droid X2] pattyboi:):
as much as i wish he would share any of his source..dont hold your breath,afaik DK is far gone :/ if we had source id more than happily try to get kexec going myself,especially since i remember the pain of having to use this thing
[Motorola Droid X2] josuearisty:
I use my dx2 as a multimedia device, very good to play videos online and offline through hdmi connected to my hdtv.
[Motorola Droid X2] Maximinus I:
If everyone who has questions about dzk and his work would go to the dx2 general forum he has a post that explains everything. He will give no further support for the dx2.
[Motorola Droid X2] griz.droidx:
Why can't people at least post or provide their old code I'll never understand. The closed / locked down nature of Moto and Big Red have screwed the community enough. There was a discussion in the DX2 forum about open source and sharing of code according to XDA"s requirements but seeing as we're on the internets and some are in countries elsewhere we can't make anyone do anything. Just a shame all around. Glad I only paid 20 bucks for an old DX2. My original DX is still seeing development of sorts even though the sharing of code issue is the same.

Thanks to the everyone who tried regardless.
[Motorola Droid X2] Oggie7797:
[MENTION=4764101]twitish[/MENTION] you may not need to use kexec...at least not fully, take a look at the motorola defy and the droid x. yes these run the OMAP3 board but regardless, they use second boot *NOT* kexec to boot alternate kernels. It boots the stock kernel and boots into (similar to Safestrap/kexec but different) a somewhat standby mode for 10sconds allowing you to select recovery or the ROM and it then boots a new kernel and then runs the system. Our system, preinstall, data, cache, etc... partitions are all wiped and replaced with another ROM's just like a standard CWM flash would do, the only exception being that there is a folder in /system named "bootstrap" responsible for holding the kernel, recovery, and related scripts. This isn't a way to run multiple ROMs by any means, but it does allow us to boot a non-stock kernel.
[Motorola Droid X2] chiruscan:
DX2 has the same Linux kernel as the Droid X doesnt it? 2.6.X?

If so, I think porting KK would bring the same random reboot problem the first X has.
[Motorola Droid X2] Oggie7797:
No lol because its totally different platforms. By that logic we could say that every single device running 2.6+kk has reboots. Last I checked, defy didn't have that issue. Correct me if I'm wrong on that though.
[Motorola Droid X2] chiruscan:
AFAIK Defy still has the random reboot problem or at least did up until very recently.

The Atrix has a KK Rom so the best thing to do would be to try to port that to the X2 since they are so similar hardware wise.
[Motorola Droid X2] sd_shadow:
doesn't atrix have a unlocked bootloader?
[Motorola Droid X2] Oggie7797:
According to [MENTION=4895937]palmbeach05[/MENTION] through conversation one day he told me they got an unlocked BL through an sbf that they call the pudding sbf or something lol not sure if he was talking about atrix 2 or HD though..
[Motorola Droid X2] sd_shadow:
seems like porting a Rom from an unlocked bootloader to a lock bootloader is going to be a lot of work.

and dx2 bsr was old 2 years ago
[Motorola Droid X2] chiruscan:
Wasnt the CM 10 JB Rom a port from the Atrix?
[Motorola Droid X2] palmbeach05:
It might be possible for that to happen, if the X2 development team decides to use the Atrix KK ROM for inspiration

Atrix and Atrix HD both have unlocked bootloaders. AFAIK Atrix 2 never found an exploit.

Yes, Atrix does have what you mentioned. Somehow we had gotten a sbf of just the bootloader. It was an unlocked version of the bootloader that was flashed over the locked one and allowed access to unlocking the bl after running fastboot oem unlock. of course one of the biggest issues we have here on the DX was the lack of fastboot support.

[MENTION=5660618]Oggie7797[/MENTION] did that one commit I made a while back, did that help with battery life at all?
[Motorola Droid X2] Oggie7797:
Wrong forum bro this is the droid x2 they do indeed have fastboot support. And I dunno I never got around to building the kernel..