View Single Post
  #10 (permalink)  
Old 08-10-2008, 09:54 PM
gguruusa's Avatar
gguruusa
Deep Thinker
Offline
Location: Mountain top
 
Join Date: Jan 2007
Posts: 3,252
Reputation: 4726
gguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributionsgguruusa should be added to the payroll for their contributions
Mentioned: 0 Post(s)
Tagged: 0 Thread(s)
Re: How To's For Developing.

I wrote this for a thread over at XDA-Developers, but no reason for them to have all the glory! (LennySh is translating a chinese tutorial that has pictures, if this isn't detailed enough for you)

How to Port a XIP

Your steps should look something like this :
NOTE: This does not cover more advanced topics. This is the BARE MINIMUM of steps to reliably get a working ported xip from a reasonably similar device.

If you don't know how to use a hex editor, don't know how to do hex arithmetic, or don't know how to put your phone in bootloader STOP NOW.

1) get your base rom (preferably an original and not someone's frankenrom)
2) get your donor rom (preferably an original and not someone's frankenrom)
3) cut the xip section out of each rom using a hex editor. XIP sections start with ECEC and end with a bunch of FFFFFs (there are two XIP sections, you usually want the 2nd one starting at x31000 or x32000 and ending at the the start of IMGFS)
4) use xipport (there are two versions, make sure you get the later version) to dump your base xip (if you end up missing imageinfo.txt files, you are using the wrong xipport version)
5) use xipport to "Make Maps" of your base xip
6) use xipport to "make pkgs" of your base xip
7) rename the base xip out dir to out.base
use xipport to dump your donor xip
9) use xipport to "make maps" of your donor xip
10) use xipport to "make pkgs" of your donor xip
11) rename the donor xip out dir to out.donor
12) copy out.base to out (or dump your base xip and make pkgs again)

at this point, you should have out.base, out.donor, and out (a copy of out.base)

13) delete the MSXipKernel and MSXIPKernelLTK folders from files and modules in your out dir
14) copy the MSXipKernel and MSXIPKernelLTK folders from files and modules in your out.donor dir to the same locations in your out dir

You are done with out.base and out.donor. Everything from here on is done in out.

Make some space for your new, bigger xip by deleteing the following:
15) delete hd.dll and hd.dll.txt from modules/MSXIPKernel
16) delete osaxst0.dll and osaxst0.dll.txt from modules/MSXIPKernel
YOU MAY NEED MORE SPACE DEPENDING ON YOUR BASE and DONOR
(Moving WinCEnls from XIP to SYS is a good way to get a bunch of space)

Use M'reloc to relocate the V(irtual base) and D(ata) sections of all your donor modules donor modules are the ones in modules/MSXipKernel and moules/MSXipKernelLTK
17) Use the Map.txt file to identify your base address
1 Use M'reloc to move the modules so they are contiguous. (you hex calculator can help you here...adress of prior module+length of prior module = start of next module)
19) update the (module)/imageinfo.txt file v= and d= entries with the new values you used in M'reloc
20) repeat 1-19) for each donor modue, being careful to remove any overlaps.

DO NOT MOVE nk.exe. If you really must move it, you have to use M'reloc-nk.
Personally, I recommend against moving any of the OEMXIPkernel modules, but to each his own.

20) use xipport to "Undo" (this undoes the "Make Pkgs")
If xipport fails, you botched your directory structure up. Delete OUT and start again from step 12)

21) use xipport to "Make Maps"
If xipport fails, you botched your m'reloc assignments. Start again from 17)

22) search map.txt for !!!!!!! in first two sections (data and virtual base)
if you find any, go back to 17) to resolve.

At this point, you should have no !!!!!! in the first 2 sections of map.txt

23) Use xipport to ReAlloc P
24) use xipport to "Make Maps"
25) search map.txt for !!!!!!
if you find any, you need advanced help.

You have now "ported" your donor xip (assuming it works!).

26) use xipport to "Build XIP out.bin"
27) use xipport to "Insert XIP" into your base rom at the XIP address you cut the base xip from in step 3)

2 flash your rom.
If it boots, check settings/system/about version numbers for your donor xip build number.

If the build number does not match the donor rom, you screwed up 14), 26), or 27)
If it won't boot, you either screwed something up or your donor xip is not compatible. Try again or seek advanced help. Once you understand the technique, steps 21)-27) can be done while m'relocing to test your changes incrementally.
__________________
Grammar: The difference between knowing your shit and knowing you're shit.
This post has been thanked 11 times.