mailer | 1 Oct 10:13 2008

dave: r18674 - trunk/utils/AMS/hacking

Date: 2008-10-01 10:13:10 +0200 (Wed, 01 Oct 2008)
New Revision: 18674

Log Message:
Original, unmodified version of the ARM thumb implementation of the UCL ucl_nrv2e_decompress_8
function from upx-3.03 - licensed under the GPL (v2 or later).  This will be used to decompress the original
firmware image in the next version of mkamsboot.

Added:
   trunk/utils/AMS/hacking/nrv2e_d8.S

Added: trunk/utils/AMS/hacking/nrv2e_d8.S
===================================================================
--- trunk/utils/AMS/hacking/nrv2e_d8.S	                        (rev 0)
+++ trunk/utils/AMS/hacking/nrv2e_d8.S	2008-10-01 08:13:10 UTC (rev 18674)
 <at>  <at>  -0,0 +1,187  <at>  <at> 
+/* arm_nrv2e_d8.S -- ARM decompressor for NRV2E
+
+   This file is part of the UPX executable compressor.
+
+   Copyright (C) 1996-2008 Markus Franz Xaver Johannes Oberhumer
+   Copyright (C) 1996-2008 Laszlo Molnar
+   Copyright (C) 2000-2008 John F. Reiser
+   All Rights Reserved.
+
+   UPX and the UCL library are free software; you can redistribute them
+   and/or modify them under the terms of the GNU General Public License as
+   published by the Free Software Foundation; either version 2 of
+   the License, or (at your option) any later version.
+
(Continue reading)

mailer | 1 Oct 11:15 2008

dave: r18675 - trunk/utils/AMS/hacking

Date: 2008-10-01 11:15:44 +0200 (Wed, 01 Oct 2008)
New Revision: 18675

Log Message:
Untested (i.e. will almost certainly brick your device if you attempt to use it) first attempt at making
mkamsboot store the original firmware as a UCL compressed image.  If it works, then this means we have about
40KB (depending on target and OF version) for our bootloader code.  I repeat: This is UNTESTED and needs
reviewing fully before attempting to install on a device.

Added:
   trunk/utils/AMS/hacking/extract_fw.c
Modified:
   trunk/utils/AMS/hacking/Makefile
   trunk/utils/AMS/hacking/mkamsboot.c
   trunk/utils/AMS/hacking/nrv2e_d8.S
   trunk/utils/AMS/hacking/test.S

Modified: trunk/utils/AMS/hacking/Makefile
===================================================================
--- trunk/utils/AMS/hacking/Makefile	2008-10-01 08:13:10 UTC (rev 18674)
+++ trunk/utils/AMS/hacking/Makefile	2008-10-01 09:15:44 UTC (rev 18675)
 <at>  <at>  -1,4 +1,3  <at>  <at> 
-
 # Change INFILE to point to your original firmware file
 INFILE=$(HOME)/FW/AMS/CLIP/m300a-1.1.17A.bin

 <at>  <at>  -6,6 +5,8  <at>  <at> 
 # (e.g.) m300a.bin
 OUTFILE=patched.bin

(Continue reading)

mailer | 1 Oct 12:25 2008

dave: r18676 - trunk/utils/AMS/hacking

Date: 2008-10-01 12:25:31 +0200 (Wed, 01 Oct 2008)
New Revision: 18676

Log Message:
Bug fix #1 for mkamsboot - pass the correct parameters to the ucl unpack function.

Modified:
   trunk/utils/AMS/hacking/mkamsboot.c
   trunk/utils/AMS/hacking/test.S

Modified: trunk/utils/AMS/hacking/mkamsboot.c
===================================================================
--- trunk/utils/AMS/hacking/mkamsboot.c	2008-10-01 09:15:44 UTC (rev 18675)
+++ trunk/utils/AMS/hacking/mkamsboot.c	2008-10-01 10:25:31 UTC (rev 18676)
 <at>  <at>  -269,6 +269,7  <at>  <at> 

     put_uint32le(&buf[0x420], firmware_size + 1);  /* UCL unpack entry point */
     put_uint32le(&buf[0x424], firmware_size - ucl_size);  /* Location of OF */
+    put_uint32le(&buf[0x428], ucl_size);           /* Size of UCL image */

     /* Update checksum */
     sum = calc_checksum(buf + 0x400,firmware_size + uclunpack_size);

Modified: trunk/utils/AMS/hacking/test.S
===================================================================
--- trunk/utils/AMS/hacking/test.S	2008-10-01 09:15:44 UTC (rev 18675)
+++ trunk/utils/AMS/hacking/test.S	2008-10-01 10:25:31 UTC (rev 18676)
 <at>  <at>  -18,6 +18,7  <at>  <at> 
 /* These values are filled in by mkamsboot - don't move them from offset 0x20 */
 ucl_unpack:      .word   0 /* Entry point (plus 1 - for thumb) of ucl_unpack */
(Continue reading)

mailer | 1 Oct 20:28 2008

dave: r18677 - trunk/utils/AMS/hacking

Date: 2008-10-01 20:28:55 +0200 (Wed, 01 Oct 2008)
New Revision: 18677

Log Message:
We need to strip the header (26 bytes) from the UCL file - based on the information in tools/ucl2src.pl.  Also
add some sanity checking of the UCL file.

Modified:
   trunk/utils/AMS/hacking/mkamsboot.c

Modified: trunk/utils/AMS/hacking/mkamsboot.c
===================================================================
--- trunk/utils/AMS/hacking/mkamsboot.c	2008-10-01 10:25:31 UTC (rev 18676)
+++ trunk/utils/AMS/hacking/mkamsboot.c	2008-10-01 18:28:55 UTC (rev 18677)
 <at>  <at>  -76,6 +76,12  <at>  <at> 
 #define PAD_TO_BOUNDARY(x) (((x) + 0x1ff) & ~0x1ff)

 
+/* This magic should appear at the start of any UCL file */
+static const unsigned char uclmagic[] = {
+    0x00, 0xe9, 0x55, 0x43, 0x4c, 0xff, 0x01, 0x1a
+};
+
+
 static off_t filesize(int fd) {
     struct stat buf;

 <at>  <at>  -92,6 +98,12  <at>  <at> 
     return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
 }
(Continue reading)

mailer | 1 Oct 21:54 2008

dave: r18678 - trunk/utils/AMS/hacking

Date: 2008-10-01 21:54:12 +0200 (Wed, 01 Oct 2008)
New Revision: 18678

Log Message:
Correct the content of an error message (thanks to Jens for spotting) and fix a warning

Modified:
   trunk/utils/AMS/hacking/mkamsboot.c

Modified: trunk/utils/AMS/hacking/mkamsboot.c
===================================================================
--- trunk/utils/AMS/hacking/mkamsboot.c	2008-10-01 18:28:55 UTC (rev 18677)
+++ trunk/utils/AMS/hacking/mkamsboot.c	2008-10-01 19:54:12 UTC (rev 18678)
 <at>  <at>  -200,12 +200,12  <at>  <at> 
     }

     if (uclheader[12] != 0x2e) {
-        fprintf(stderr,"[ERR]  Unsupported UCL encryption format (0x%02x) - only 0x2e supported.\n",uclheader[12]);
+        fprintf(stderr,"[ERR]  Unsupported UCL compression format (0x%02x) - only 0x2e supported.\n",uclheader[12]);
         return 1;
     }
     ucl_size = get_uint32be(&uclheader[22]) + 8;

-    if (ucl_size + 26 > filesize(fducl)) {
+    if (ucl_size + 26 > (unsigned)filesize(fducl)) {
         fprintf(stderr, "[ERR]  Size mismatch in UCL file\n");
         return 1;
     }

_______________________________________________
(Continue reading)

mailer | 2 Oct 01:19 2008

dave: r18679 - trunk/utils/AMS/hacking

Date: 2008-10-02 01:19:14 +0200 (Thu, 02 Oct 2008)
New Revision: 18679

Log Message:
It turns out that in-place UCL decompression isn't as easy as we thought, so we copy the OF to an unused part of
RAM before decompressing it.  This works - I have successfully patched m300a-1.1.17A.bin and installed
on my Clip with this code.  Thanks to Rafael Carre (funman) for the actual patch.

Modified:
   trunk/utils/AMS/hacking/test.S

Modified: trunk/utils/AMS/hacking/test.S
===================================================================
--- trunk/utils/AMS/hacking/test.S	2008-10-01 19:54:12 UTC (rev 18678)
+++ trunk/utils/AMS/hacking/test.S	2008-10-01 23:19:14 UTC (rev 18679)
 <at>  <at>  -27,10 +27,30  <at>  <at> 
 loop:   subs  r1, r1, #1
         bne   loop

-        /* Call the ucl decompress function, which will branch to 0x0
-           on completion */
+        /* First copy the compressed firmware to unused RAM */
+
         ldr   r0, ucl_start   /* Source */
         ldr   r1, ucl_size    /* Source length */
+
+        mov   r2, #0x40000    /* Destination end */
+        sub   r2, r2, r1
+
+memcpy:
(Continue reading)

mailer | 2 Oct 10:22 2008

nls: r18680 - trunk/apps/plugins

Date: 2008-10-02 10:22:44 +0200 (Thu, 02 Oct 2008)
New Revision: 18680

Log Message:
Fix FS#9296 by catching repeat events for wheel targets too, moved a bit of code around to simplify things.

Modified:
   trunk/apps/plugins/calculator.c

Modified: trunk/apps/plugins/calculator.c
===================================================================
--- trunk/apps/plugins/calculator.c	2008-10-01 23:19:14 UTC (rev 18679)
+++ trunk/apps/plugins/calculator.c	2008-10-02 08:22:44 UTC (rev 18680)
 <at>  <at>  -890,86 +890,6  <at>  <at> 
 }

 /* -----------------------------------------------------------------------
-move button index
-Invert display new button, invert back previous button
------------------------------------------------------------------------ */
-void moveButton(int button){
-    switch(button){
-        case CALCULATOR_LEFT:
-        case CALCULATOR_LEFT | BUTTON_REPEAT:
-            move_with_wrap_and_shift(
-                &btn_col, -1, BUTTON_COLS,
-                &btn_row,  0, BUTTON_ROWS);
-            break;
-
-        case CALCULATOR_RIGHT:
(Continue reading)

mailer | 2 Oct 13:29 2008

dave: r18681 - trunk/docs

Date: 2008-10-02 13:29:34 +0200 (Thu, 02 Oct 2008)
New Revision: 18681

Log Message:
Add Rafael Carre (funman) for his work on SansaV2 hacking and contributions to mkamsboot and related code

Modified:
   trunk/docs/CREDITS

Modified: trunk/docs/CREDITS
===================================================================
--- trunk/docs/CREDITS	2008-10-02 08:22:44 UTC (rev 18680)
+++ trunk/docs/CREDITS	2008-10-02 11:29:34 UTC (rev 18681)
 <at>  <at>  -419,6 +419,7  <at>  <at> 
 Vitja Makarov
 Francisco Vila
 Christian Lees
+Rafaël Carré

 The libmad team
 The wavpack team

_______________________________________________
rockbox-cvs mailing list
rockbox-cvs <at> cool.haxx.se
http://cool.haxx.se/cgi-bin/mailman/listinfo/rockbox-cvs
mailer | 2 Oct 14:37 2008

dave: r18682 - trunk/utils/AMS/hacking

Date: 2008-10-02 14:37:47 +0200 (Thu, 02 Oct 2008)
New Revision: 18682

Log Message:
Remove the dependency on sufficient free space in the padding at the end of the firmware block by storing the
ucl unpack function in the main firmware block, immediately before the compressed firmware image.  Also
simplify the memcpy function in test.S.  This has been tested successfully on a Clip.

Modified:
   trunk/utils/AMS/hacking/mkamsboot.c
   trunk/utils/AMS/hacking/test.S

Modified: trunk/utils/AMS/hacking/mkamsboot.c
===================================================================
--- trunk/utils/AMS/hacking/mkamsboot.c	2008-10-02 11:29:34 UTC (rev 18681)
+++ trunk/utils/AMS/hacking/mkamsboot.c	2008-10-02 12:37:47 UTC (rev 18682)
 <at>  <at>  -26,34 +26,41  <at>  <at> 

 Insert a Rockbox bootloader into an AMS original firmware file.

-We replace the main firmware block (bytes 0x400..padded_firmware_size+0x400)
-with the following:
+We replace the main firmware block (bytes 0x400..0x400+firmware_size)
+as follows:

-Bytes 0..(firmware_size-ucl_size) - Our bootloader code
-Bytes (firmware_size-ucl_size)..firmware_size - UCL compressed OF image
-Bytes firmware_size..padded_firmware_size - UCL decompress function

-mkamsboot writes the following values at offsets into our bootloader code:
(Continue reading)

mailer | 2 Oct 19:53 2008

dave: r18683 - trunk/tools

Date: 2008-10-02 19:53:35 +0200 (Thu, 02 Oct 2008)
New Revision: 18683

Log Message:
Fix some new ports to ensure target_id is unique

Modified:
   trunk/tools/configure

Modified: trunk/tools/configure
===================================================================
--- trunk/tools/configure	2008-10-02 12:37:47 UTC (rev 18682)
+++ trunk/tools/configure	2008-10-02 17:53:35 UTC (rev 18683)
 <at>  <at>  -1625,7 +1625,7  <at>  <at> 
     ;;

    53|m200)
-    target_id=31
+    target_id=48
     modelname="m200"
     target="-DSANSA_M200"
     memory=2 # always
 <at>  <at>  -1744,7 +1744,7  <at>  <at> 
     ;;

    110|meizum6sl)
-    target_id=20
+    target_id=49
     modelname="meizum6sl"
     target="-DMEIZU_M6SL"
(Continue reading)


Gmane