Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Booting .4.1.1 Kernel (Old Bootloader)

OP ggow

11th November 2014, 07:12 PM   |  #1  
ggow's Avatar
OP Senior Member
Thanks Meter: 417
 
400 posts
Join Date:Joined: Feb 2014
Donate to Me
More
@Cpasjuste,

In the image headers I noticed that the ramdisk and tag addresses have changed.

ramdisk addr: 0x02000000 -> 0x01000000
tags addr: 0x01e00000 -> 0x00000100

Please correct me if I'm wrong...
The bootloader (lk) loads the ramdisk and kernel tags (device tree) at these physical RAM locations.
Last edited by ggow; 11th November 2014 at 07:18 PM.
The Following User Says Thank You to ggow For This Useful Post: [ View ]
12th November 2014, 05:25 PM   |  #2  
Senior Member
Thanks Meter: 883
 
675 posts
Join Date:Joined: Jun 2007
Donate to Me
More
@ggow

Yes i saw that but it have no effect. I'm focusing on the .dt part because I found a few things :

- The DT images can correctly be extracted with a tool named "mkboot".

- When using the DT image from kk kernel, the bootloader complains about DT not found (fastboot boot boot.img)

- Opened both DT image in hex editor, noticed some differences in the headers. I switched kk DT headers by jb DT headers, the bootloader don't complain
anymore so I guess it can now found it. But the kernel will just hang immediately.

- The DT syntax seems to have changed (arch/arm/boot/dts/thor.dtsi), this may be the problem for our old bootloader ?!

- Now I'd like to use compiled dt from kk kernel, but has you may have noticed the DT compilation fail about "fb_mem" not declared. I think I need to fix this, then maybe use old jb tools ( $KERNEL_OUT/scripts/dtc/dtc -p 2048 -O dtb -o thor-v1.dtb arch/arm/boot/dts/thor-v1.dts) to compile them, unlike kk kernel which now compile them with the kernel.

From what iv read dt, kernels and bootloaders are linked together, so there is also maybe some changes to be done in the dt sources. But this start to be out of my knowledge.

I asked to hashcode for that but I guess he is very busy.
Last edited by Cpasjuste; 12th November 2014 at 05:38 PM.
The Following User Says Thank You to Cpasjuste For This Useful Post: [ View ]
12th November 2014, 05:42 PM   |  #3  
ggow's Avatar
OP Senior Member
Thanks Meter: 417
 
400 posts
Join Date:Joined: Feb 2014
Donate to Me
More
Quote:
Originally Posted by Cpasjuste

@ggow

Yes i saw that but it have no effect. I'm focusing on the .dt part because I found a few things :

- The DT images can correctly be extracted with a tool named "mkboot".

- When using the DT image from kk kernel, the bootloader complains about DT not found (fastboot boot boot.img)

- Opened both DT image in hex editor, noticed some differences in the headers. I switched kk DT headers by jb DT headers, the bootloader don't complain
anymore so I guess it can now found it. But the kernel will just hang immediately.

- Now I'd like to use compiled dt from kk kernel, but has you may have noticed the DT compilation fail about "fb_mem" not declared. I think I need to fix this, then maybe use old jb tools ( $KERNEL_OUT/scripts/dtc/dtc -p 2048 -O dtb -o thor-v1.dtb arch/arm/boot/dts/thor-v1.dts) to compile them, unlike kk kernel which now compile them with the kernel.

From what iv read dt and kernels are linked together, so there is also maybe some changes to be done in the dt sources. But this start to be out of my knowledge.

I noticed the "fb_mem" not declared error and couldn't find any reference to it anywhere. I switched the dt.img header also and got to the point where the kernel was not dumping out to fastboot any more, but instead bootloops.

I have messaged amazon once again to post the source code for apollo and thor for update .4.1.1 .
12th November 2014, 05:43 PM   |  #4  
Senior Member
Thanks Meter: 883
 
675 posts
Join Date:Joined: Jun 2007
Donate to Me
More
Hehe we are at the same point it seems (nowhere)
The Following User Says Thank You to Cpasjuste For This Useful Post: [ View ]
13th November 2014, 05:07 PM   |  #5  
Senior Member
Thanks Meter: 883
 
675 posts
Join Date:Joined: Jun 2007
Donate to Me
More
Today I did spent a lot of time on this. After a lot of dt hacks/test I'm unable to resolve this problem for now. So I had another idea and started to port kexec hardboot for our device. I'm at the point where is successfully load kernel and DT (something is different for our device, the msm_id struct, which I solved) and reboot but will hang or restart just after a few seconds of the reboot. I think I'm almost there but I may have some problem to find correct memory addresses which are not overwritten by the boot loader. Let me know if you want to take a look I'll upload patches. But well even if we succeed we may still encounter the same DT problem.

In the "dt.img" there is 3 dtb files in, which are scanned by the bootloader for the correct hw revision. I did find that our device use the "thor-v2-apq.dts/.dtb" dt file for booting (not the thor-v1 nor v2) which correspond to our hardware revision. This is in correlation to the 4.1 kernel which only compile this dtb.

When loading the 4.1 dt image with kexec I was able to debug and see that while the header of each dtb parts have changed, there's still the correct hw revision included (of course!?). This one is correctly loaded by kexec and so probably by the bootloader (but in the new dt.img we still need to modify the img header for our bootloader to find it). By the way, I wonder how this final dt.img is built !?

I just don't know yet what is the thor.dtsi file in the 4.1 kernel, the one missing the fb_mem def. This is not included in the dt.img so should it be modified to match our old thor-v2-apq.dts instead the new one ?

By the way manual compilation (and decompilation!) does work with the dtc utility (apt-get install device-tree-compiler).
Last edited by Cpasjuste; 13th November 2014 at 05:17 PM.
13th November 2014, 05:18 PM   |  #6  
ggow's Avatar
OP Senior Member
Thanks Meter: 417
 
400 posts
Join Date:Joined: Feb 2014
Donate to Me
More
Yes, upload the the patches for kexec. Definitely interested in taking a look. I have configured a kernel last night with kexec config enabled (great minds think alike)

This DT problem is troubling me. Perhaps not everything is included in this kernel for Apollo or Thor to boot.

I received a reply from amazon, they said they will post the missing source for the last 3 updates very soon (no idea of time frame).

Sent from my Full Android on C6603 using Tapatalk
13th November 2014, 06:54 PM   |  #7  
Senior Member
Thanks Meter: 883
 
675 posts
Join Date:Joined: Jun 2007
Donate to Me
More
I don't think the sources are the problem as we have it on stock 4.1 boot.img. I'll upload the patches tomorrow with a little briefing.
18th November 2014, 11:39 AM   |  #8  
Senior Member
Thanks Meter: 883
 
675 posts
Join Date:Joined: Jun 2007
Donate to Me
More
@ggow : 4.1.1 kernel booted (not from sources. As you noted this sources may be incomplete).

I'll post the kernel this night, with a clean 4.1.1 system if i have the time.
The Following 2 Users Say Thank You to Cpasjuste For This Useful Post: [ View ]
18th November 2014, 05:05 PM   |  #9  
ggow's Avatar
OP Senior Member
Thanks Meter: 417
 
400 posts
Join Date:Joined: Feb 2014
Donate to Me
More
Thumbs up
Quote:
Originally Posted by Cpasjuste

@ggow : 4.1.1 kernel booted (not from sources. As you noted this sources may be incomplete).

I'll post the kernel this night, with a clean 4.1.1 system if i have the time.

Good News, well done
19th November 2014, 03:12 PM   |  #10  
Senior Member
Thanks Meter: 883
 
675 posts
Join Date:Joined: Jun 2007
Donate to Me
More
Quote:
Originally Posted by ggow

Good News, well done

Finally, sorry for the delay So here is the modded 4.1.1 boot image. In short : binary extract correct dts from 4.1.1 stock dt image and happend it to 4.1.1 stock zImage.

Didn't had the time to finish my gapps rom based on 4.1.1 but should not be too long

http://android.mydedibox.fr/hdx/boot-4.1.1.img

The Following User Says Thank You to Cpasjuste For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes