[Windows Mobile] airxtreme:
Using OsKitchen Zero

What you need to know first

The first thing you need to know is that Windows Mobile is not like a desktop operating system: you can't take a ROM from another phone and flash it on a different phone model because Windows Mobile relies on an extremely specific kernel and drivers that are compiled by the manufacturer for each device model. The Windows Mobile ROM contains only the Windows folder - yes, that's right, the ROM is just the plain Windows folder with NO subfolders - while every other folder (Windows\Start Menu, Program Files, My Documents and also Start Menu links etc.) is generated when the ROM boots the first time.

Every official Windows Mobile ROM is composed of packages. Microsoft and device makers create those packages to split windows mobile and the additional software into separated components. The real "Windows Mobile" code, interchangeable between phones, is stored in packages commonly called SYS packages, while everything the manufacturer added (the drivers and the additional applications for customization) are called the OEM packages. The EXT packages are "fake" packages that the kitchen uses to overcome the limitations of standard packages (for example EXT packages are often used to build multilanguage packages without having to create a single additional package for each language).

The Windows Mobile package structure is very simple. SYS and OEM packages are identical in structure and can only contain:

A DSM file (a file that contains some package informations, for example what other packages it require or what files it contains, most kitchens usually ignore this)

A RGU file (a registry file containing the registry entries associated with the packages)

Other files or modules that compose the package: the modules are folders that usually have file-like names (meaning they have an extension) and are a different way to store executable and DLL files on the ROM.

Note: A SYS/OEM package cannot have any subdirectory with the exception of modules directories.

EXT packages - that as already said are "fake" packages that are converted to the Windows Mobile package format by the kitchen - have a different layout: everything goes into a "files" folder except the registry files (app.reg), dsm files, initflashfiles entry files (.dat) and there can be subfolders with a LCID (language-ID) code as name (a LCID is a string composed of four HEXadecimal numbers identifying a language, e.g. 0409 for US English, 040C for Spanish, etc.) to store language-specific files in the same structure (.dsm and .reg in another "files" subfolder, like for the main folder).

EXT packages are the main way custom packages or packages from other devices are distributed on websites and forums. Recent HTC ROMs contains additional informations that allow kitchens to automatically convert OEM packages to the more user-friendly EXT packages: this allows to quickly remove applications just by disabling the package; other ROMs instead have everything stored in a single package (usually OEMMisc) and require more work to remove original applications.

The only important thing you still need to know is how the rest of the filesystem structure (Program Files, My Documents, Start Menu, etc.) is created during the first boot. All the system folders are generated and populated during the first boot because, as wrote before, the ROM contains only the Windows folder. Windows Mobile has two facilities for the first-boot (hard-reset) initialization: INITFLASHFILES.DAT, a text file that is usually in the OEM_Lang folder and that only allows creating folders and copying files (Documents folders, default pictures, and most start menu entries are usually added this way) and .PROVXML files that are some XML files that can do other advanced operations (like setting registry keys, certificates, phone settings).

Usually anything you can perform with PROVXML files, that unfortunately are difficult to edit and require a large knowledge of the format, can also be easily performed using initflashfiles and registry files. You can use the app.dat and app.reg files inside EXT packages (or initflashfiles.txt and RGU files in OEM packages) to add entries to both the initflashfiles file and to the registry: the kitchen will use them properly during the building process adding the app.dat entries to initflashfiles.txt and the reg entries to the final registry (the ROM boots with a precompiled registry HV file but you'll usually never have to mess with that when using a kitchen).

Manufacturers also use some advanced proprietary post-install tools to install custom cabs, apply themes and operator configurations (e.g. AutoRun, RunCC). Those rely on TXT configuration (*config.txt) files and can cause trouble (error messages about missing files during the first boot) when removing packages or files from packages that those config file point to if you don't update them.

When you want to upgrade a Windows Mobile Build the changes in the start menu are usually so many that it's REALLY recommended to start over with a new fresh initflashfiles.txt for that windows mobile build (you can find one for each language in the Da_G's rollup threads). Since in the official ROMs the start menu entries are all crammed into the initflashfiles.txt file (the app.dat exists only in the "fake" EXT packages) you will have to either take the time to create app.dat files for each package or to copy back all the initflashfiles entries for OEM/EXT applications back after you put the new initflashfiles for the windows mobile build you changed. The kitchen will try to move the config.txt and initflashfiles entries inside the correct packages while the ROM is imported to make SYS upgrades easier.

Now that you know the basics you can proceed to the first step...

Preparing the kitchen (Importing the Device ROM file)

1. Download osKitchen Zero and unpack the ZIP archive

2. Find a ROM update file for your device: the kitchen can import the EXE from all HTC and some Samsung updaters or alternatively the raw ROM file (the main used extensions: .NBH,.BIN and .NB are supported)

3. Open osKitchen Zero and the Import ROM Wizard will open

4. Select the device you want to work on from the drop-down list, you can actually write any device name because the list is just for reference to make sure people understand that the kitchen has been tested only with those devices

5. Select the ROM update file

6. Click NEXT

Building your first ROM to make sure everything works

At this point the main kitchen window will open. Since you imported a ROM all the "Project Settings" options will only have one choice, go on and select the only available choice for all the fields (device model, device profile, windows mobile build, language) and clicking Yes in case the kitchen asks you to automatically apply recommended changes should be enough to build a bootable and working ROM. The only setting that has more than one choice is the Compression setting that if you want to have the most available space to add your programs should be set to "LZX", if you want to use another compression first make sure that your phone will be able to flash a bigger ROM file.

Now you can go ahead and build your first ROM by clicking the "Start building button": the kitchen will work for a while, then tell you that the building process has been completed and ask you if you want to open the Output ROM folder; you can then answer yes, take the ROM file that has been generated and flash it, making sure it's the right format for your phone.

NOTE: don't try importing a ROM made for other phones different than the one you want to flash because the kitchen will rebuild the ROM for the device you imported and not any other. If you flash a ROM made for another device you risk bricking your device.

Once the ROM works (if it's a supported device it should work fine on the first try, if it doesn't please report the issue here so we can help fixing it) you can start working on the ROM. So that's it, you're ready to go. If you read the "What you need to know first" you will probably already have an idea of where to start for whatever change you want to do.