Get a Complete Set of Logs with Andy Log

The importance of proper logging is undeniable. No, we’re not talking about lumberjack work. … more

Try Some Android Lollipop Applications on Your Device

Android 5.0 Lollipop has been officially announced and lucky users of Google Nexus 5 … more

AutoCon Manages Your Connections to Perserve Battery Life

As we’ve talked about in the past, battery life is still somewhat of a sore … more

How to Unlock and Root a Nexus Device – XDA TV

It is official–Google has released the Nexus 6 and the Nexus 9. The Nexus family … more
Post Reply

Got kexec-mod, kexec-tools working, atags in progress - Should Also Work With DroidX

OP ilikenwf

20th April 2012, 03:47 PM   |  #1  
ilikenwf's Avatar
OP Senior Member
Thanks Meter: 32
 
144 posts
Join Date:Joined: Oct 2009
More
I realize people gave up slightly on the whole kexec thing over radio worries, but I now have the module compiling and inserting without error into the Droid2/DroidX gingerbread kernel. Next comes cross compiling the kexec-tools for userspace, to allow us to attempt inserting a different kernel.

To build, you'll need a compiled DroidX kernel from source, as well as the android NDK.

To build, make sure you have downloaded the DroidX GB kernel source and compiled it. There are guides everywhere on how to build Android kernels. Just make sure you use the proper cross compiler.

http://sourceforge.n....l.tgz/download

When you build, make sure to use
Code:
make mapphone_defconfig
Once the kernel is built, clone my repo and edit envsetup.sh to reflect the correct paths to your kernel source directory and the android NDK.
https://github.com/i...kexec-mod-d2-dx

Then, source it:
Code:
source envsetup.sh
Then, just run
Code:
make
and cross your fingers. You should then have a fresh kexec_load.ko file!

To see if it loads, you'll need to copy it to your sdcard, and then on the phone, using a console, do the following:
Code:
su (click allow)
insmod /sdcard/path/to/kexec_load.ko
If you don't get any errors, it inserted! Now, of course, to actually use it, we'd need the kexec-tools built, which I haven't gotten ready yet...but they're coming! To remove the module (no reason to leave it in memory for now):

Code:
rmmod kexec_load
Happy hacking, and help is always appreciated!
Last edited by ilikenwf; 21st April 2012 at 05:59 AM.
The Following 3 Users Say Thank You to ilikenwf For This Useful Post: [ View ]
21st April 2012, 05:10 AM   |  #2  
Albinoman's Avatar
Senior Member
Flag Arizona
Thanks Meter: 894
 
867 posts
Join Date:Joined: Jul 2011
Donate to Me
More
This looks great! If you need any help just ask
21st April 2012, 05:21 AM   |  #3  
ilikenwf's Avatar
OP Senior Member
Thanks Meter: 32
 
144 posts
Join Date:Joined: Oct 2009
More
Smile
Thanks! I probably could actually use some. I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there.
I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there, though I do have an atags module working, except it doesn't do anything without atags in the procfs (http://lists.infradead.org/pipermail...ry/004795.html).

kexec-tools:
https://github.com/i...xec-tools-dx-d2

To build, see the README.

Then, copy the binaries from /build/sbin/* to your device, and the move them to the /system/bin directory, and chmod them 770 to make them executable.


mod-atags:
https://github.com/i...mod-atags-d2-dx

Now, if I/we can just get atags and procfs stuff taken care of, we'll be able to go to the next step. I already have atags compiling as a module, but it won't stay inserted because we have no atags in the procfs. Note I can't just trace through code like this and know what everything is doing, but I know enough to hack at it and be dangerous :P
Last edited by ilikenwf; 21st April 2012 at 05:39 AM.
21st April 2012, 06:04 AM   |  #4  
Member
Flag Spanish Lookout
Thanks Meter: 2
 
52 posts
Join Date:Joined: Dec 2011
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
21st April 2012, 06:06 AM   |  #5  
ilikenwf's Avatar
OP Senior Member
Thanks Meter: 32
 
144 posts
Join Date:Joined: Oct 2009
More
Quote:
Originally Posted by calebcoverdale

I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?

No idea. I haven't even gotten the kernel to change yet, so I haven't gotten to mess with radio yet. The method itself should/would work though, but radio will require reverse engineering...perhaps find a similar phone with an open bootloader and disassemble and attempt to clone it's modules.
24th April 2012, 06:43 AM   |  #6  
ilikenwf's Avatar
OP Senior Member
Thanks Meter: 32
 
144 posts
Join Date:Joined: Oct 2009
More
The latest change I made may or may not work, it was an attempt to remove atags from the kexec module based on an old patch I found, which added the functionality. This at leaset made kexec -l zImage work, but when I run kexec -e, the kexec binary complains about atags not being there...hrmmmph.

I may have to revert it (and will if we can get atags somehow) ...but if we can get the kexec bin to ignore /proc/atags or just find a way to rip them out of the running kernel, we'll be in business.

The commit: https://github.com/ilikenwf/kexec-mo...a35ed92be4ee2c

I'm also looking into 2ndboot.
24th April 2012, 08:40 PM   |  #7  
Albinoman's Avatar
Senior Member
Flag Arizona
Thanks Meter: 894
 
867 posts
Join Date:Joined: Jul 2011
Donate to Me
More
I like where this is going! Keep working!

Sent from my DROID2 using xda premium
28th April 2012, 07:01 AM   |  #8  
ilikenwf's Avatar
OP Senior Member
Thanks Meter: 32
 
144 posts
Join Date:Joined: Oct 2009
More
Okies, so, I emailed aliasxerog (original kexec-mod writer), and I hope he'll get back to me. Even though his twitter says he's a "former android developer," maybe he'll be willing to give me some hints so I can pick up where he left off.

I also got the froyo version of the module building properly based on his module, yet again, (all after SBF'ing my phone back down to motoblur froyo - yech!) but neither currently work... (note there's a gingerbread and a froyo branch on my repo): https://github.com/i...kexec-mod-d2-dx

The froyo one throws the following error, which stops me dead in the water:
Code:
Could not find a free area of memory of 3007dc bytes...
The gingerbread one loads the kernel into memory but won't execute it due to our not having atags.
29th April 2012, 03:34 AM   |  #9  
ilikenwf's Avatar
OP Senior Member
Thanks Meter: 32
 
144 posts
Join Date:Joined: Oct 2009
More
We've moved our git repos to an organization for easier collaboration:

https://github.com/organizations/D2-DX-Customboot
15th May 2012, 08:38 AM   |  #10  
Member
Thanks Meter: 18
 
79 posts
Join Date:Joined: Dec 2010
links are imcomplete.
use URL lable pls.

Post Reply Subscribe to Thread

Tags
droid2, droidx, kexec, r2d2
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes