|
|
Rockbox the Creative Zen Vision:MAboutWatch the ZVM Port Thread and FS#8686Port Status
Install methodWARNING: this is only for people who know what they're doing, don't try this if you don't understand the consequences!WARNING: this will format your player and you will lose all your data! To people who want to replicate my case this is what you got to do:
losetup -o 52429312 /dev/loop0 /dev/XXX mkfs.vfat -F 32 /dev/loop0 mount -t vfat /dev/loop0 /mnt/XXX
Information about the ZVM 30GBPictures/scans
Internal components
How internals are connectedDM320:
Original FirmwareFirmware InfoThe firmware used by Creative is Nucleus RTOS.They use Nucleus PLUS and the ARM925 TI v. 1.14 toolchain to compile it according to strings found in FBOOT. This is based on MicroWindows (Nano-X), as several assert messages are found pointing to (open source) source code. (even NeurosTechnology uses Nano-X) Also libpng is incorporated (and zlib of course). Other strings of companies working on the firmware:
Modifying the firmwareModifying the firmware is as easy as deleting a block/block data, inserting the new data, adjusting the Size attribute of the block and the CIFF block and computing the NULL checksum of the CIFF block (so without the NULL block).You don't have to fill the entire firmware with all the blocks, if you for example just want to replace Hdeviceinfo.xml with another one, you only have to make a CIFF, CINF, DATA and NULL block (so you do not have to include all the others). Another way is using CreativeWizard (Windows only and requires .NET 2.0). Uploading a firmwareYou can either compile the program located in utils/MTP/ in Rockbox SVN or you can get the hacked version of the official firmware updater.Firmware Boot
0x1EE0000This is the FRESCUE structure parsing code, located at 0x228 in FBOOT in ZVM firmware.It disables all caches and MMU and cleans it. Then it parses the loaded data (given by arguments R0->memory pointer and R1->size) and loads it into the corresponding memory addresses. Several checksum checks are done (described at jukebox2.jrm) and if one fails, code jumps to an infinite loop. After all loading is done, code jumps to 0x0. Below is a C code example for loading a firmware image.
#define OF_firmware_load(mem_addr, size) asm volatile ( \
"mov r1, %1\n" \
"mov r0, %0\n" \
"ldr pc, =0x1EE0000\n" \
: \
: "r"(mem_addr), "r"(size)\
);
OF_firmware_load(ptr_to_loaded_image, size_of_loaded_image);
Upload Code To The PlayerThe code you want to upload should be raw binary, so no ELF format. Scramble is included in Rockbox SVN. If you run it like this:scramble -creative=zvm inputfile outputfileIt will take a binary file and output a Rockbox compatible Hjukebox2.jrm wrapped up in a CIFF structure (meaning: Rockbox thinks it is loading from 0x900000 so the binary is loaded at that address and 0x0 contains MOV PC, 0x900000) LCD infoThe LCD is controlled via the serial interface of the TMS320 (a driver in Rockbox is present) and the built-in OSD facilities (serial is only LCD on/off). Some uncategorized data: raw dump of spi_send_block: http://pastecode.com/?show=f627241ebanalyzed version:
function spi_send_block(char arg_0, char arg_1) {
IO_GIO_BITSET2 &= (1 << 0x5);
spi_send_byte(0x74);
spi_send_byte(0);
spi_send_byte(arg_0 & 0xFF);
spi_send_byte(0x25);
IO_GIO_BITCLR2 &= (1 << 0x5);
IO_GIO_BITSET2 &= (1 << 0x5);
spi_send_byte(0x76);
spi_send_byte( (arg_1 >> 8) & 0xFF);
spi_send_byte(arg_1 & 0xFF);
spi_send_byte(0x25);
IO_GIO_BITCLR2 &= (1 << 0x5);
}
LCD init function: http://mcuelenaere.pastebin.com/f23b3226a
HDD partitioning infoThe first sector consists of this structure:
struct partition_struct
{
unsigned int end;
unsigned int start;
char name[8];
};
struct hdd_struct
{
char MBLK[4];
int block_size;
long long total_disk_size;
struct partition_struct minifs;
struct partition_struct cfs;
};
A file header on the minifs partition consists of this (incomplete) structure stored at 0x144200 (= sector 0xA21):
struct __attribute__ ((aligned (32))) minifs_file
{
char name[16];
unsigned int unknown;
unsigned int size;
unsigned int index;
unsigned int index2; /* The same as above */
};
There can be maximum 128 headers (so 32*128=0x1000 bytes)
Some interesting links:
Links are down, maybe archive.org has some remains..
BACKUP:
Notes:
Firmware Format010 Editor TemplateDescriptionThe firmware is Little Endian. A firmware always starts with the ASCII string FFIC (=CIFF). Followed by the total size of the file minus the last (NULL) block and possible some padding bytes.After this header comes a block structure, always started with a 4-byte string header (e.g. FNIC, ATAD, LLUN, CNEC, 0TXE or LTŠ). Then comes (again) the size of this block. Then you have, based on the type of block: a) a data block with size of Size b) a 32-byte Unicode name(=filename) and the data block of (Size-32). Overview table
Normal files to be found in an official firmware
CINF blockThe CINF block is the identifier of the firmware i.e. it says if the firmware belongs to a Creative ZVM 30/60GB, Creative ZEN, etc..For example: the 30GB ZVM contains the Unicode string 'Creative Zen Vision:M' and the 60GB contains 'Creative Zen Vision:M Go!'. NULL blockThe NULL block in the current Creative ZVM's is a HMAC-SHA-1 computed checksum of the CIFF block using the key for your device.ŠTL blockThe ŠTL block gets written to the ZVM's HDD as jukebox2.jrmIt is encrypted using Blowfish in CBC mode with the key used for your device and after that you have to decompress/decode it using the CENC algorithm (described on DellDJPort). EXT0 blockThis contains the code uploaded to the PIC. The format is:char header[4]; char padding[2]; unsigned char length_a; unsigned char length_b; total_size = (length_b + (length_a << 8) + 0xA) & 0xFFFF; jukebox.opt fileThis file contains the firmware's factory-set settings; like in the EU firmware it has VMX=0, which defines the EU volume cap. Based on firmware reverse engineering the player also accepts DBG=1 and FM=0.Presumably the first one sets a debug flag (nothing notable happens, I've tested it myself) and the second one could disable the FM radio functionality (not tested). jukebox2.jrm fileThe format of this file is similar to the nk.bin format: it contains a main block (EDOC), 4 bytes long followed by a WORD which indicates the size of the file.Then you have another WORD which has a currently unknown value (can be set at 0x0000 without problems). After that you have an array of this type of struct:
typedef struct {
UINT Address;
UINT Length;
UINT Checksum;
UCHAR Data[Length];
} BLOCK;
Address is the physical address to which Data is loaded.This array loops until the end of the CODE block. The checksum is calculated as follows:
FSeek(0xC);
local int i = 0x239C;
local uint j = 0;
local uint temp = 0;
while(i>0){
if(i<4) break;
temp = ReadUInt(FTell()); //FTell() tells us the current stream position and ReadUInt() reads 4 bytes
j += temp + (temp>>16);
FSkip(4); //FSkip() skips x bytes in the stream (ReadUInt() doesn't move the pointer)
i -= 4;
if(i<4) break;
temp = ReadUInt(FTell());
j += temp + (temp>>16);
FSkip(4);
i -= 4;
if(i<4) break;
temp = ReadUInt(FTell());
j += temp + (temp>>16);
FSkip(4);
i -= 4;
if(i<4) break;
temp = ReadUInt(FTell());
j += temp + (temp>>16);
FSkip(4);
i-= 4;
}
j = j << 16;
Printf("%x", j);
At the end of the file you have another block (NULL) - the header is also 4 bytes long - followed by the size in WORD format (which is always 20 bytes) and then (presumed) a SHA-1-HMAC hash of the CODE block; although the key hasn't been found yet; but the device seems to ignore this block if it isn't present.
Flash filesThe format used is unknown, as no flash dumps yet are available and no reverse engineering has been done to find this.What is presumed, is that following files are on the flash chip:
Other Creative players' firmware informationSince these information about the firmware applies to (almost?) the whole Creative Zen line, you'll find here some info for other players (like NULL block key, CINF header, ŠTL block key, ...)
CreativeWizardCreativeWizard is a .NET 2.0 application intended for analyzing and modifying Creative Zen firmwares. You can download it at epiZENter.For creating a firmware, following steps are required:
External Links
Wiki Links
CategoryFrontpage: Creative Zen Vision:M Port Index [New Ports]
r131 - 06 May 2008 - 17:12:05 - MaurusCuelenaere
|