Garux T3 Comments
This article describes code modifications, I have made to original Garux source code to make it work on Tungsten T3 and other PXA-based Palm devices
I'll start from frmMain.c - m68k part of the bootloader.
static void OutAndWait(char* text, Int32 sec)
{
FormPtr form = FrmGetActiveForm();
CtlSetLabel(FrmGetObjectPtr(form, FrmGetObjectIndex(form,
1111)), text);
FrmDrawForm(form);
SysTaskDelay(SysTicksPerSecond()*sec);
}
This function is used to show pre-arm debug messages on screen. It just copies text string to field and waits a requested number of seconds.
this function:
static Boolean frmMain_btnBootLinux_OnSelect(EventPtr event)
is really more interesting. It's the bootloader core itself 
At first I open serial port
done = SrmOpen(0x8000, 9600, &portId);
StrIToA(buf, done);
StrCopy(buf2, "SrmOpen result: ");
StrCat(buf2, buf);
OutAndWait(buf2, 2);
OutAndWait("10 seconds timeout...", 7);
and wait 10 seconds to allow desktop Linux recognize new USB device (palm) and start a logger.
Then I load the kernel image
kernelDB = DmOpenDatabaseByTypeCreator('2612',
'LINX', dmModeReadOnly);
imageH = DmGetResource(RESOURCE, 0000);
imageSize = MemHandleSize(imageH);
image = MemHandleLock(imageH);
As you can see, image should be located at 'imge' (RESOURCE) resource number 0 in the database '2612'/'LINX'. How do I get kernel image in one chunk? I just make Image and then cat ImageHeader.prc Image > linux.prc
ImageHeader.prc contains prc header, there's no size field as far as I know, so you can use Image of any size. linux.prc is then should be copied to the handheld by the means of SD/MMC flash, IrDA or Bluetooth. Don't even try to HotSync it! The process crashes because this is not a usual database.
ARM code receives information about kernel in this structure:
ki.kernelPtr = (unsigned long) image;
ki.kernelSize = imageSize;
The image size is calculated in runtime, so you don't need to recompile Garux any more if you change kernel image. I want to make a small fix that would allow to pass a command line this way too.







