Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,771,386 Members 52,153 Now Online
XDA Developers Android and Mobile Development Forum

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

Tip us?
 
ilikenwf
Old
(Last edited by ilikenwf; 21st April 2012 at 05:59 AM.)
#1  
ilikenwf's Avatar
Senior Member - OP
Thanks Meter 32
Posts: 144
Join Date: Oct 2009
Thumbs up Got kexec-mod, kexec-tools working, atags in progress - Should Also Work With DroidX

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!
The Following 3 Users Say Thank You to ilikenwf For This Useful Post: [ Click to Expand ]
 
Albinoman
Old
#2  
Albinoman's Avatar
Senior Member
Thanks Meter 893
Posts: 863
Join Date: Jul 2011
Location: Arizona

 
DONATE TO ME
This looks great! If you need any help just ask
 
ilikenwf
Old
(Last edited by ilikenwf; 21st April 2012 at 05:39 AM.)
#3  
ilikenwf's Avatar
Senior Member - OP
Thanks Meter 32
Posts: 144
Join Date: Oct 2009
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
 
calebcoverdale
Old
#4  
Member
Thanks Meter 2
Posts: 52
Join Date: Dec 2011
Location: Spanish Lookout
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
 
ilikenwf
Old
#5  
ilikenwf's Avatar
Senior Member - OP
Thanks Meter 32
Posts: 144
Join Date: Oct 2009
Quote:
Originally Posted by calebcoverdale View Post
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.
 
ilikenwf
Old
#6  
ilikenwf's Avatar
Senior Member - OP
Thanks Meter 32
Posts: 144
Join Date: Oct 2009
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.
 
Albinoman
Old
#7  
Albinoman's Avatar
Senior Member
Thanks Meter 893
Posts: 863
Join Date: Jul 2011
Location: Arizona

 
DONATE TO ME
I like where this is going! Keep working!

Sent from my DROID2 using xda premium
If you like my work please donate! Logcat or it didn't happen- http://forum.xda-developers.com/show....php?t=1726238
 
ilikenwf
Old
#8  
ilikenwf's Avatar
Senior Member - OP
Thanks Meter 32
Posts: 144
Join Date: Oct 2009
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.
 
ilikenwf
Old
#9  
ilikenwf's Avatar
Senior Member - OP
Thanks Meter 32
Posts: 144
Join Date: Oct 2009
We've moved our git repos to an organization for easier collaboration:

https://github.com/organizations/D2-DX-Customboot
 
sugwacee
Old
#10  
Member
Thanks Meter 18
Posts: 79
Join Date: Dec 2010
links are imcomplete.
use URL lable pls.

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

Advanced Search
Display Modes