Want more Storage? New bugfixed version 2.1 rc2!

Search This thread

tadzio

Senior Member
Nov 23, 2003
474
11
Munich, Germany
Edit: New version available! Compatible with Kaiser, Titan, Artemis, Hermes etc.
New version 2.1rc2! This is a major upgrade to version 2.0 (and a bugfix to 2.1rc1). The ImgfsTools now support generating ROMs for Kaiser, Hermes, Titan, Artemis and probably quite some more. All Hermes-specific code was replaced with code working for all devices :)

The new version is attached to this post.

These are the screenshots of the original version. Have a look:

storage.jpg


This is a completely unmodified LVSW edition WM6. It usually has 47 MByte Storage.... :eek:

What happened? Well, the IMGFS partition (a.k.a. OS.nb) has 8 MByte free space. Until now it was not possible to shrink the IMGFS partiton and enlarge Storage in return, so that space was wasted.

This has changed - now also on the Kaiser! :D

I modified mamaich's ImgfsTools so that they now create the smallest possible OS.nb from a 'dump' directory, and also write the partition table and MSFLSH header matching the new size. The result is what you see above.

This is an excerpt from the ReadMe file from the new version 2.1rc2:


ImgFS Tools Version 2

================================================================
(Current version: 2.1rc2)


What it is
==========

These little programs help you with cooking your own ROM. They allow you to unpack an OS.nb file into individual files as you'd find them on your device, and to re-pack them into a new OS.nb which you can flash to your device. Of course, betweem unpacking and re-packing, you'll want to add/modify/remove some of them. :)

The tools are enhanced versions of mamaich's imgfs_tools - a huge Thank You goes to mamaich for creating them, and also for releasing the source code!

The most significant enhancement is that the IMGFS inside the generated OS.nb is no longer of fixed size, but is as small as possible. This means: the more of the unpacked files you remove before re-packing, the smaller it'll get and consequently the bigger your Storage memory will become. Also, the tools are no longer device-specific and should also work other devices than the Hermes.

*** WARNING: ***
Before you flash a ROM created with these tools, make sure you know how to recover from a non-booting ROM! For Hermes and Kaiser, you should install a HardSPL before you use these tools! I accept no responsibility for bricked devices!


Supported devices
=================
These tools have been tested on HTC devices only, and are known to work on Hermes, Kaiser, Titan and Artemis. Other devices were not tested and may or may not work.
If you want to try, I will gladly support you. However, I cannot accept responsibility for bricked devices!


How it works
============

On a high level, this is the chain of actions needed to unpack OS.nb:

RUU-signed.nbh ---(*NBHExtract)---> OS.nb ---(NBSplit)---> OS.nb.payload -->
--(ImgfsFromNb)---> imgfs.bin ---(ImgfsToDump)---> 'dump' directory

At that stage, you will want to edit the 'dump' directory. I recommend using bepe's excellent *Package Tool for this.

The reverse process is:

'dump' directory ---(ImgfsFromDump)---> imgfs-new.bin ---(ImgfsToNb)--->
OS-new.nb.payload ---(NBMerge)---> OS-new.nb ---(*NBHGen)--->
RUU-signed-new.nbh

(The tools marked with '*' are not part of the ImgfsTools, but are also available for free from xda-developers.com. There is also one additional tool, NBInfo, in this package.)



Version History
===============

2007-10-17 2.1rc2
ROMs generated by 2.1RC1 would not boot if created with a certain combination of parameters. Fixed.


2007-10-14 2.1RC1
Major overhaul:
- All Hermes-specific assumptions (like the sector size being always 0x200) are now gone.
- "conservative" mode added to ImgfsToNb and NBMerge
- on devices that have only two MSFLSH flash regions, ImgfsToNb overwrote a few bytes in the XIP section, causing unpredictable results. This was fixed.
- Removed "-emu" support from NBSplit and NBMerge, as this didn't work with WM6 emulator images.


2007-03-18 2.0 RC 2
All tools now linked statically to the MS runtime library, no longer needs DLL. No other changes.

2007-03-18 2.0 RC 1
Initial Release. Starting with version 2 to not collide with mamaich's version numbers.

===================

Enjoy!

Cheers
tadzio
 
Last edited:

jasjamming

Senior Member
Nov 7, 2006
1,247
1
In the Basement
Have a look:

storage.jpg


This is a completely unmodified LVSW edition WM6. It usually has 47 MByte Storage.... :eek:

What happened? Well, the IMGFS partition (a.k.a. OS.nb) has 8 MByte free space. Until now it was not possible to shrink the IMGFS partiton and enlarge Storage in return, so that space was wasted.

This has just changed! :D

I modified mamaich's ImgfsTools so that they now create the smallest possible OS.nb from a 'dump' directory, and also write the partition table and MSFLSH header matching the new size. The result is what you see above.

This currently runs on my TyTN with boot loader 1.10 OliPro. I haven't had a chance to test it with other configurations, but I see no reason why it shouldn't work.

I do not plan to offer any cooked ROMs myself, as there are many excellent chefs in this forum already. But I would think a new approach to ROM cooking may emerge: make a ROM as small as at all possible, removing anything that users may not want, and turn every removed feature into a .cab that users can install to Storage (bepe's excellent Package Tool makes this very simple!). This will give maximum flexibility without wasting any memory.

Give me one more day to write up the documentation, and then I'll upload the new Imgs Tools version.

Cheers
Daniel

sounds great man,

once your instructions are posted I will use this technique for Black version 1.2.

Well Done,

Cheers,
 

xultar

Senior Member
Aug 11, 2003
331
2
Atlanta, GA
Have a look:

storage.jpg


This is a completely unmodified LVSW edition WM6. It usually has 47 MByte Storage.... :eek:

What happened? Well, the IMGFS partition (a.k.a. OS.nb) has 8 MByte free space. Until now it was not possible to shrink the IMGFS partiton and enlarge Storage in return, so that space was wasted.

This has just changed! :D

I modified mamaich's ImgfsTools so that they now create the smallest possible OS.nb from a 'dump' directory, and also write the partition table and MSFLSH header matching the new size. The result is what you see above.

This currently runs on my TyTN with boot loader 1.10 OliPro. I haven't had a chance to test it with other configurations, but I see no reason why it shouldn't work.

I do not plan to offer any cooked ROMs myself, as there are many excellent chefs in this forum already. But I would think a new approach to ROM cooking may emerge: make a ROM as small as at all possible, removing anything that users may not want, and turn every removed feature into a .cab that users can install to Storage (bepe's excellent Package Tool makes this very simple!). This will give maximum flexibility without wasting any memory.

Give me one more day to write up the documentation, and then I'll upload the new Imgs Tools version.

Cheers
Daniel


Brilliant! Truly BRILLIANT!
 

Alcibiade

Senior Member
Dec 23, 2006
2,065
144
New York
That's just great... We're all going to run for the smallest ROM possible ! Even maybe strip out Windows Media Player (We all use other players...) and some of the useless aplications (Who uses Solitaire or Bubble Breaker ?)
 

tadzio

Senior Member
Nov 23, 2003
474
11
Munich, Germany
I just added ImgfsTools2.zip to the first post of this thread.

Disclaimer: I only tested this with my Hermes. Please be careful if you use it with other devices. Oh, and it can't hurt to be careful even with a Hermes! :)

Feedback welcome! If you run into any problems with these tools, please post in this thread!

Enjoy!
Daniel
 

Percz

Senior Member
Apr 13, 2006
212
8
37
Norfolk, England
www.megazirt.co.uk
Am I right that embedding things into the ROM makes them run slightly faster? Some things that everyone will use would be better off kept into the ROM in that case, which would bring in the disagreement of what everyone thinks should be included. It would be very intresting to see if someone can build a completely pure OS though.
 

tadzio

Senior Member
Nov 23, 2003
474
11
Munich, Germany
Am I right that embedding things into the ROM makes them run slightly faster?

Glad you asked. :)

If by "things" you mean applications, the opposite is true.

As code cannot be executed directly from NAND flash, everything has to be copied to RAM before execution (the term XIP - eXecute In Place - is misleading here. There is no true XIP in a Hermes). Some executables and DLLs are stored as "modules" in ROM, i.e. already prepared to be copied "as is" to RAM. Moving these from ROM modules to normal files in Storage will indeed make them load slower, although once loaded execution will be the same speed.

However, applications are not stored as modules. Even in ROM they are normal files, and speed-wise it makes absolutely no difference if they are loaded from ROM or Storage into RAM.

But there is one more important aspect: the size of the Windows directory. Even Microsoft admits that having 1800 files in one directory slows the device down significantly. And unfortunately, all files in IMGFS are in the Windows directory (with initflashfiles.dat, you can only copy them elsewhere, not move them).

So, if we manage to remove as many files and apps as possible from the ROM (and hence the Windows directory), and package them into .cabs in a way that they get installed into directories other than Windows, I would think we would see some increase in speed, since accessing the Windows directory would be quite a bit faster - and I guess the OS accesses that directory rather often.

At the moment, this is only theory. I haven't tried to prove it yet. :)

Cheers
Daniel
 

rv1nd

Member
Jul 11, 2006
20
0
That's just great... We're all going to run for the smallest ROM possible ! Even maybe strip out Windows Media Player (We all use other players...) and some of the useless aplications (Who uses Solitaire or Bubble Breaker ?)

Leave few things in there. whats the point of having all that memory with nothing in it. I love bubble breaker.

Also as mentioned it would be great if we can merge ExtRom into main memory.

Nice work!