[Android Software/Hacking General [Developers Only]] oxiroxt:
Hi all,

I've got some news for you. First off, let me thank tmzt, without his help I couln't have accomplished anything of this. So thank you tmzt, and you're most than welcome to post on this thread.

*New values for pxafb_mode_info structure. No pixclock confirmation for the moment.

*No more flashing nor vibration while booting. This should avoid some potential damage.

*We can now mount an ext2 partition on "my storage". Not in the external memory card yet.

New values for pxafb_mode_info structure.

Open arch/arm/mach-pxa/hpipaq214-lcd.c , and chage "struct pxafb_mode_info" to look like this:

static struct pxafb_mode_info hpipaq214_mode = {
.pixclock = 96153,
.xres = 240,
.yres = 400,
.bpp = 16,
.hsync_len = 8,
.left_margin = 8,
.right_margin = 8,
.vsync_len = 4,
.upper_margin = 38,
.lower_margin = 38,
.sync = 0,
};

How did we get this?:

tmzt asked me to paste this code on haretconsole:

pd 0x44000000 0x20

With the output:

44000000 | 03b008f9 07071cef 26260d8f 04700014 | ..........&&..p.
44000010 | 8400fe92 3f3f3f3f 00000000 00000000 | ....????........

...and a program (decoder?) I don't know about, he determined the correct margin values for pxafb_mode_info. I think it should have given some info about the pixclock, but unfortunately it didn't. tmzt suspects this info may be elsewhere in the memory.

No more flashing nor vibration while booting.

Open arch/arm/mach-pxa/hpipaq214.c , and change hpipaq214_init to look like this:

static void __init hpipaq214_init(void)
{
hpipaq214_init_lcd();
hpipaq214_init_mmc();
/*
hpipaq214_init_mfp();
hpipaq214_init_misc();
hpipaq214_init_lcd();
hpipaq214_init_mmc();
hpipaq214_init_keypad();
hpipaq214_init_nand();
hpipaq214_init_usb();
hpipaq214_init_audio();
hpipaq214_init_power();

//add the various platform devices
platform_add_devices(hpipaq214_devices, ARRAY_SIZE(hpipaq214_devices));
*/
}

Open arch/arm/mach-pxa/hpipaq214-lcd.c , and change hpipaq214_init_lcd to look like this:

void __init hpipaq214_init_lcd(void)
{
/* int err;

platform_device_register(&hpipaq214_backlight_device);

err = gpio_request(gpio_lcd_setup, "LCD setup gpio");
if(err){
printk("Unable to register LCD setup gpio (%i)\n",gpio_lcd_setup);
gpio_lcd_setup = -1;
}else{
gpio_direction_output(gpio_lcd_setup, 1); //keep it on for now!
}
*/
set_pxa_fb_info(&hpipaq214_lcd_info);
}

What's this for?:

As you can see, we're commenting out a lot of hardware initialization. This will prevent potentially damaging the omnia and let us focus on what we need for the moment. The mmc initialization is needed for the next step, so it's left uncommented.

With the above changes I'm finally able to boot from the "my storage" device, and I don't quite recall whether I'm able to boot from the card as well...

We can now mount an ext2 partition on "my storage".

Connect your omnia to the computer using the usb cord, and in winmo select "my storage" as usb connection, instead of activesync or the external card.

Make a backup of the complete "my storage" device on your computer. In my computer this was detected as /dev/sde, with /dev/sde1 being an extended partition, and /dev/sde5 being a logical vfat partition. I made the backup using dd, like this: "dd if=/dev/sde of=/home/oxi/mybackup.bin". This kind of backup (a whole device) will ensure you're keeping not only the partitions content, but the partition table as well, so you should be ok if you ever want to restore. This took around an hour to complete for my 16gb mem. Maybe you can speed up the process by using high blocksize value in dd.

Make the new partition/s on the "my storage" device. You may want to use fdisk or cfdisk for this. Since the default vfat partition is logical, I kept the extended partition, created a new logical 2gb ext2 partition at the end and then created a new logical vfat partition at the beginning. I did this so to prevent possible problems if the omnia/winmo couldn't rightly handle primary partitions on this memory. Now I must say I'm not that sure I did the right thing. Now winmo is able to see the ext2 partition and depicts it as "my storage2"; also, my computer will mount it as an vfat if no type is specified. So I wouldn't recommend this partition schema. I will be repartitioning the "my storage" device to have just two primary partitions, the first one being vfat, and the other one ext2, ASAP, because I don't really like all this behaviour. But I can't recommend this second schema as I have not tried it yet.

Note that the default vfat partition is of type: 0b, not the usual 06.

Edit: Of course, create the new filesystems on the partitions.

mkfs.vfat /dev/sdXY
mkfs.ext2 /dev/sdXZ

I have now tried the second schema, that is, creating two primary partitions. Results are exactly the same. For some strange reason, when you disconnect the usb cord, winmo has the bad habbit of writing two files in each partition, no matter if it's an ext2 partition, winmo will write them to it in FAT format. This apparently doesn't pose any problems, but just to be on the safe side I run a fsck.ext2 on the partition everytime before I mount it on my computer.

You can now deploy a busybox(or whatever) on the ext2 partition. Just set the cmdline of default.txt accordingly, by setting the proper init parameter, and setting the root to your ext2 partition.

If you're using an extended, and logical partitions:

root=mmcblk0p6	1 is the extended partition, 5 is the first logical partition (vfat in my case), 6 is the second logical partition (ext2 in my case)

If you're using primary partitions:

root=mmcblk0p2	1 is the first primary partition (the vfat partition, maybe), 2 is the second primary partition (the ext2 partition, maybe)

Note that if you have an external memory card inserted, you will need to use mmcblk1 to access the "my storage" device, because even if we can't use yet the external card, it is detected and named as mmcblk0. If no card is inserted then the "my storage" device will be named mmcblk0, and the examples above should work for you.

Edit: Set rootdelay parameter on cmdline to an appropriate value, so to give time for the memories to be detected. A value of 10 is more than enough.

Now I feel we should be directing our efforts on trying to establish a connection with the computer, as a means of communicating with the device without having to constantly reboot, etc. Maybe start by uncommenting the usb initialization related stuff and set up a telnetd or ssh in a busybox.

I hope I'm not leaving anything behind...

Once again, thanks go to tmzt

Needless to say, I don't take any responsibility for any damage, data loss, etc. you may get by using this info.

Cheers,

oxi