[Windows Mobile Software Development] spocky12:
Hi Ameet, thanks for your answer. I'm sorry, I didn't explain correctly. The excerpt from map.txt is from my Original Lg rom. It's perfectly working.

Then, based on this working xip/map, I applied the steps below.

[B]Initial Xip[/B]
....
802bb674 - 802bc89c L00001228 filedata b00d0fcf-0459-5ea5-d217-f50a2e1ce607.dsm
[COLOR=Red]802bc89c - 802de89c L00022000 NUL[/COLOR]
802de89c - 802de89c L00000000 End: highest physical address

[COLOR=SeaGreen]802de89c - 802df000 L00000764 NUL[/COLOR]

802df000 - 802df000 L00000000 Start: start of RAM
802df000 - 802e0000 L00001000 initialized data of region_4 nk.exe
802e0000 - 802e6000 L00006000 uninitialized data of region_1 nk.exe
802e6000 - 8030a000 L00024000 initialized data of region_2 nk.exe
8030a000 - 8030b000 L00001000 initialized data of region_5 nk.exe
8030b000 - 8030b000 L00000000 ------ start of RAM free space
8030b000 - 86400000 L060f5000 NUL
86400000 - 86400000 L00000000 End: end of RAM

So I

- Changed Physlast from 802DE89C to 802BC89C to remove red NUL part

- Changed Ramstart from 802DF000 to 802BD000(=22000 higher) to reduce the green NUL part.

- Changed UlRamFree from 8030b00 to 802e9000 (=22000 higher)

Using XipPort on this would produce a file with a NUL line between [Start: start of RAM] and [initialized data of region_4 nk.exe], like this:

802bd000 - 802bd000 L00000000 Start: start of RAM
802bd000 - 802df000 L00022000 NUL
802df000 - 802e0000 L00001000 initialized data of region_4 nk.exe

So changed nk.exe\imageinfo.txt so that nk regions are placed 22000 higher, which finally resulted in this file (with xipport + reallocp)

[B]Final Xip[/B]
...
802bb674 - 802bc89c L00001228 filedata b00d0fcf-0459-5ea5-d217-f50a2e1ce607.dsm
802bc89c - 802bc89c L00000000 End: highest physical address

802bc89c - 802bd000 L00000764 NUL

802bd000 - 802bd000 L00000000 Start: start of RAM
802bd000 - 802be000 L00001000 initialized data of region_4 nk.exe
802be000 - 802c4000 L00006000 uninitialized data of region_1 nk.exe
802c4000 - 802e8000 L00024000 initialized data of region_2 nk.exe
802e8000 - 802e9000 L00001000 initialized data of region_5 nk.exe
802e9000 - 802e9000 L00000000 ------ start of RAM free space
802e9000 - 86400000 L06117000 NUL
86400000 - 86400000 L00000000 End: end of RAM

As you can see, everything is fine and nothing overlaps.

Last thing that I understood : for this to work, I need to used mreloc'nk to change its address. When I open it, it says current address is 802e0000 (=region 1 address). So I need to move it to new region 1 address which is 802be000. But when I write this number and click on doit, it automatically changes to 802bd000 (in fact, whatever value I write, when I click on doit, displayed value is 1000 higher, so I had to write 802bf000 to have it relocated to 802be000.

Now everything seems fine to me, but it doesn't boot. As for why I don't use another tool, it's because I've got a ks20 and other tools don't work with it. Ie, latest bepe's kitchen crashes when processing my nk, I think there are things his tool doesn't expect to find (maybe unordered nk regions, or the fact that there are 4 regions and not 2...). I tried to contact him, but he didn't answer, so I have to do it the old xipport way.

Anyways, don't spend too much time on it, I just wanted to know if I forgot some steps, or did something wrong. If it doesn't work, it's not that important, I just miss a few kb in memory.