Commit graph

69 commits

Author SHA1 Message Date
Rafaël Carré
c36a644cc6 mkamsboot: use version.sh properly
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24843 a1c6a512-1295-4272-9138-f99709370657
2010-02-22 05:41:09 +00:00
Rafaël Carré
b6c20c17e4 mkamsboot: prevents 2 potential problems
We checked if the new firmware block (bootloader+ucl function+packed
bootloader & OF) fit in the OF file, but not if it would run properly.

For example the Clipv2 OF is bigger than 0x50000 bytes uncompressed, but
it fitted in this space when packed and concatenated to a packed
bootloader + ucl function and dualboot code (but we use 1MB of RAM and
not 0x50000 anyway).

Now we check that both bootloader and OF are small enough to be unpacked
at runtime: the unpacked data must be smaller than available memory and
not overlap with ucl function and packed data (although the unpacked and
packed data could probably overlap a bit, I don't know how to calculate
this and this could be quite complex).

total_size() is replaced by check_sizes() which will perform all the
checks and set an error string if the firmware can't be patched.
(both mkamsboot and rbutilqt modified accordingly)

The second problem is that dualboot.S assumed r3 and r5 were left
untouched in the device specific checks. This was undocumented and very
error prone when modifying these checks.

r3 is the last byte of packed copy (bootloader or OF)
r5 is the entry point of uclunpack function derived from r3, so move r5
calculation after the device specific code.

Even if r3 is currently unused in the device specific code, we store it
in memory after copying the ucl function, when it points to the last byte
of packed data (not yet copied at this point since we didn't chose if we
boot the OF or the bootloader), and restore it just before using it so no
restriction is placed on registers usage in device specific code.

Add a new variable ucl_dest in dualboot.S set by mkamsboot.c, which
represents the last bound of buffer where we copy the ucl function, and
then the packed data (bootloader or OF).

RAM_SIZE definition is moved from dualboot.S to mkamsboot.c new
model_memory_size(), where it is a bit better documented.

Tested on e200v2 and Clip+

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24772 a1c6a512-1295-4272-9138-f99709370657
2010-02-19 14:10:26 +00:00
Björn Stenberg
b4f6c6ffba Tweaked dependencies a bit
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24770 a1c6a512-1295-4272-9138-f99709370657
2010-02-19 08:09:41 +00:00
Rafaël Carré
75919d5f3d Revert r24763 : LIBOBJS is already included in OBJS
The problem seems related to dependency on a directory

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24765 a1c6a512-1295-4272-9138-f99709370657
2010-02-19 07:16:51 +00:00
Rafaël Carré
a63b225a14 mkamsboot binary depends on the same object files than libmkamsboot
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24763 a1c6a512-1295-4272-9138-f99709370657
2010-02-19 07:05:39 +00:00
Rafaël Carré
40e833af5f Clip+ remove setting GPIOB PIN0, it seems needed only for power
Also only use 0x50000 bytes of memory since the files just fit in.
TODO: make mkamsboot abort if the decompressed OF or bootloader doesn't
fit in RAM / or overlap on compressed data or uclunpack function

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24727 a1c6a512-1295-4272-9138-f99709370657
2010-02-17 18:27:50 +00:00
Rafaël Carré
7c8dbf46a8 mkamsboot: update dualboot.c / dualboot.h in place
This removes the need for copying these files to ../ and removes the
risk of only copying one of the files (which led to bricking 2 c200v2
already)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24719 a1c6a512-1295-4272-9138-f99709370657
2010-02-17 14:37:06 +00:00
Bertrik Sikken
b4fd5d852a Include dualboot.h in dualboot.c as an additional compile time sanity check
Author: Tobias Diedrich
Flyspray: FS #11009


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24636 a1c6a512-1295-4272-9138-f99709370657
2010-02-13 18:53:29 +00:00
Jack Halpin
aa8da2333e Sansa Clip+: Unset B0 correctly in dualboot.S
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24582 a1c6a512-1295-4272-9138-f99709370657
2010-02-10 14:35:52 +00:00
Jack Halpin
74c48090ac Sansa Clip+: Unset pin B0 correctly in dualboot.S
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24573 a1c6a512-1295-4272-9138-f99709370657
2010-02-09 22:29:23 +00:00
Jack Halpin
de3489a6c8 Sansa Clip+ : Add dualboot support for sansa clip+ to mkamsboot.
Dualboot works on the sansa clip+ by holding either the left "|<<" or home buttons.
The USB pin is still undiscovered at this point and should replace the home button when found.
By including the home button for dualboot we avoid bricking due to a single button failure.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24561 a1c6a512-1295-4272-9138-f99709370657
2010-02-08 06:43:47 +00:00
Michael Chicoine
b1dfdd4c7a Update mkamsboot for Fuze OF 01.02.31
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24311 a1c6a512-1295-4272-9138-f99709370657
2010-01-21 14:34:04 +00:00
Rafaël Carré
8b926e98f8 Add Sansa Clip+ target to test mkamsboot
UNTESTED, could ver well brick your Clip+
If it works, booting should just be delayed by a small delay (perhaps
not noticeable)
Hopefully the Clipv2 checks will work for Clip+ and then we'll be able
to test the other Clipv2 code (LCD/button)

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24219 a1c6a512-1295-4272-9138-f99709370657
2010-01-13 03:05:29 +00:00
Dominik Riebeling
69a5ff7f8a Make lipo calls silent.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23982 a1c6a512-1295-4272-9138-f99709370657
2009-12-13 21:30:28 +00:00
Dominik Riebeling
d587794dfc Remove special lib Makefile targets that aren't used anymore.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23871 a1c6a512-1295-4272-9138-f99709370657
2009-12-06 10:19:39 +00:00
Dominik Riebeling
f0d0ba86ff Fix building universal binaries.
When building various libraries for Rockbox Utility make sure they use the same compiler as Qt. Pass Qt's CC instead of explicitly setting it. This fixes issues linking on OS X (with recent XCode building universal binaries requires the use of gcc-4-0 while the default one is 4.2).

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23779 a1c6a512-1295-4272-9138-f99709370657
2009-11-28 22:39:05 +00:00
Dominik Riebeling
cca6f747f8 Handle TARGET_DIR in universal library building.
Building universal libraries needs to take TARGET_DIR into account as when set the individual libraries are placed into the build output folder and didn't got found anymore.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23778 a1c6a512-1295-4272-9138-f99709370657
2009-11-28 22:39:00 +00:00
Rafaël Carré
a721007e39 mkamsboot: fix linking (typo from r23520)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23571 a1c6a512-1295-4272-9138-f99709370657
2009-11-08 21:00:55 +00:00
Dominik Riebeling
d47366bb78 Remove unused variable.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23523 a1c6a512-1295-4272-9138-f99709370657
2009-11-04 21:57:28 +00:00
Dominik Riebeling
ea6178065c Clean up mkamsboot building. No functional changes.
- split out standalone functions to a separate file.
- adjust and clean up Makefile.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23520 a1c6a512-1295-4272-9138-f99709370657
2009-11-04 20:58:40 +00:00
Dominik Riebeling
606a333a5f Fix building of Rockbox Utility by restoring object list for libmkamsboot.a
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23505 a1c6a512-1295-4272-9138-f99709370657
2009-11-03 22:05:35 +00:00
Tomer Shalev
15ea6e663f FS#10741 - rbutil: Fix mkamsboot Makefile dependancies
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23443 a1c6a512-1295-4272-9138-f99709370657
2009-10-31 17:18:17 +00:00
Dave Chapman
747b9ca258 mkamsboot: allow the version string to be overridden from the commandline - e.g. "make APPVERSION=v1.1 mkamsboot".
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23097 a1c6a512-1295-4272-9138-f99709370657
2009-10-11 09:47:15 +00:00
Rafaël Carré
e51dbc0f4f mkamsboot: support Fuze OF v 1.02.28
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23067 a1c6a512-1295-4272-9138-f99709370657
2009-10-10 11:21:15 +00:00
Rafaël Carré
30ea0b6368 mkamsboot: build and package (dmg) an universal OSX binary
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23034 a1c6a512-1295-4272-9138-f99709370657
2009-10-09 08:49:41 +00:00
Dominik Riebeling
32b367b042 Don't warn if the archive has to be created.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23013 a1c6a512-1295-4272-9138-f99709370657
2009-10-08 20:10:03 +00:00
Dominik Riebeling
2417023652 Make mkamsboot Makefile operate silent per default.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22629 a1c6a512-1295-4272-9138-f99709370657
2009-09-05 08:54:52 +00:00
Dominik Wenger
4d86861ce5 rbutil: modify buildsystem so you can build outside of the rbutilqt directoy. (similar to the normal buildsystem). Attention: Spaces in the path will cause errors.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22624 a1c6a512-1295-4272-9138-f99709370657
2009-09-04 21:31:17 +00:00
Dominik Riebeling
4dd44bffb0 Explicitly set CC to prevent make trying to use cc instead. Fixes build issues on w32.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22623 a1c6a512-1295-4272-9138-f99709370657
2009-09-04 19:54:18 +00:00
Dominik Riebeling
ac77c08f11 Make mkamsboot Makefile more silent.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22320 a1c6a512-1295-4272-9138-f99709370657
2009-08-15 14:26:08 +00:00
Dominik Wenger
cb55d5c65f rbutil: move extern "C" declaration into mkamsboot.h
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22319 a1c6a512-1295-4272-9138-f99709370657
2009-08-15 14:09:05 +00:00
Dominik Wenger
f4e2d83f04 mkamsboot: move intermediate files into a build directory and allow building of a universal lib (for macs)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22318 a1c6a512-1295-4272-9138-f99709370657
2009-08-15 13:54:13 +00:00
Dominik Wenger
a66dfa4ab7 rbutil: add ams sansa targets. (FS#10185)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22317 a1c6a512-1295-4272-9138-f99709370657
2009-08-15 13:04:21 +00:00
Rafaël Carré
b5f9f6152b mkamsboot: remove runtime copyright notice
add a cast to remove a warning in printf()

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21925 a1c6a512-1295-4272-9138-f99709370657
2009-07-17 17:51:01 +00:00
Thomas Martitz
ff2f839c39 Change to versioning for mkamsboot to <rXXXXX>-<DATE> for svn builds. A fixed number like 1.1 can (and should) be used for releases.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21652 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 10:35:47 +00:00
Rafaël Carré
ef7ad19d37 mkamsboot: change version string to 1.1, move devices list in the header
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21650 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 08:25:44 +00:00
Thomas Martitz
f9eeab2b6c Slightly rewrite some parts of mkamsboot for better output and some sanity in the early array declarations. No functional change.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21648 a1c6a512-1295-4272-9138-f99709370657
2009-07-05 02:30:33 +00:00
Rafaël Carré
8bb5e430e5 mkamsboot: refuse to patch an untested OF, and provide a list of tested OF versions
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21189 a1c6a512-1295-4272-9138-f99709370657
2009-06-04 16:31:11 +00:00
Rafaël Carré
a96f2373db mkamsboot : brackets at the start of functions must be on their line - thanks to linuxstb for noticing
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21122 a1c6a512-1295-4272-9138-f99709370657
2009-05-28 21:19:21 +00:00
Rafaël Carré
96165abec2 FS#10253 : mkamsboot v1.0
- Bump version to 1.0
- Add Clipv2 target
- Make mkamsboot work as a library (work by domonoky : FS#10185, with a few modifications by me)
  . Use a macro with variadic arguments for error cases in functions which might error.
  . Add detailed descriptions to functions exported by the library (in the header file)
- modify bin2c.c to produce only one pair of .c/.h files with several files embedded in it
- move files needing to be built by an ARM cross compiler into dualboot/
- commit produced .c/.h files (containing nrv2e_d8.S and dualboot.S built for Clip, Fuze, e200v2, c200v2, m200v4, Clipv2)
- Write a real README file
- cosmetics: indent dualboot.S properly, remove trailing spaces, limit lines to 80 characters
- comments: add/correct comments in dualboot.S and mkamsboot.c
- move back extract_fw.c to utils/AMS/hacking

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21118 a1c6a512-1295-4272-9138-f99709370657
2009-05-28 18:27:08 +00:00
Rafaël Carré
b0e0ec832b mkamsboot: really error out if OF model is different from bootloader model
Error out if firmware md5sum isn't known, and leave the current code #if 0'ed for easier testing

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21073 a1c6a512-1295-4272-9138-f99709370657
2009-05-25 10:35:15 +00:00
Rafaël Carré
9ed51a029d mkamsboot : use left button for dual boot on Sansa Clip for consistency with other Sansa models
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21029 a1c6a512-1295-4272-9138-f99709370657
2009-05-22 10:44:06 +00:00
Rafaël Carré
f2c07a6b8a mkamsboot : remove a misleading comment (we only use IRAM)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21028 a1c6a512-1295-4272-9138-f99709370657
2009-05-22 10:44:03 +00:00
Thomas Martitz
238337087e Support Fuze 01.02.26 OF version.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20688 a1c6a512-1295-4272-9138-f99709370657
2009-04-11 20:46:28 +00:00
Bertrik Sikken
e60ca805b6 Add md5 for clip OF version 1.01.32 to mkamsboot (verified to work)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20326 a1c6a512-1295-4272-9138-f99709370657
2009-03-16 18:55:39 +00:00
Björn Stenberg
679d2c11d1 Added dualboot usb detection for Clip, so OF boots on usb insert.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19613 a1c6a512-1295-4272-9138-f99709370657
2008-12-29 23:31:09 +00:00
Michael Giacomelli
68e24d3a16 Commit updated mkamsboot for c200v2 patching. Tested and seems to be working using USB for dualboot.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19575 a1c6a512-1295-4272-9138-f99709370657
2008-12-24 04:23:52 +00:00
Dave Chapman
db1ea97fe8 Add MD5 checksum for v1.01.22 of the Fuze original firmware.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19444 a1c6a512-1295-4272-9138-f99709370657
2008-12-15 14:17:13 +00:00
Dominik Wenger
032b3d4691 m200v4: correct the BOOTDIR define, and invert the button check in the dualboot.S
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19217 a1c6a512-1295-4272-9138-f99709370657
2008-11-25 18:17:41 +00:00
Rafaël Carré
48b4e5213b mkamsboot: dualboot button for Sansa Fuze
Sansa Fuze and e200v2 appear to have the same keymapping (except maybe for still missing buttons/wheel)
Thanks to Thomas Martitz for his finding

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19201 a1c6a512-1295-4272-9138-f99709370657
2008-11-24 18:45:07 +00:00