FreeCalypso > hg > freecalypso-tools
annotate README @ 465:003e48f8ebe1
rvinterf/etmsync/fsnew.c: cast 0 to (char *) for execl sentinel
I generally don't use NULL and use plain 0 instead, based on a "NULL
considered harmful" discussion on the classiccmp mailing list many aeons
ago (I couldn't find it, and I reason that it must have been 2005 or
earlier), but a recent complaint by a packager sent me searching, and I
found this:
https://ewontfix.com/11/
While I don't give a @#$% about "modern" systems and code-nazi tools,
I realized that passing a plain 0 as a pointer sentinel in execl is wrong
because it will break on systems where pointers are longer than the plain
int type. Again, I don't give a @#$% about the abomination of x86_64 and
the like, but if anyone ever manages to port my code to something like a
PDP-11 (16-bit int, 32-bit long and pointers), then passing a plain 0
as a function argument where a pointer is expected most definitely won't
work: if the most natural stack slot and SP alignment unit is 16 bits,
fitting an int, with longs and pointers taking up two such slots, then
the call stack will be totally wrong with a plain 0 passed for a pointer.
Casting the 0 to (char *) ought to be the most kosher solution for the
most retro systems possible.
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 11 Feb 2019 00:00:19 +0000 |
parents | 3ec8ef8b2d37 |
children | dddcd55883fe |
rev | line source |
---|---|
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
1 You are looking at the top level of the FreeCalypso host tools package. All |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
2 tools in this package have been written to run on a Unix-based or Unix-like |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
3 host system, such as a GNU/Linux PC or laptop, with the expectation that the |
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
4 user will compile them from the source using her regular system C compiler. |
434
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
5 See INSTALL for installation instructions. Most of these tools interface to |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
6 and operate on Calypso-based GSM devices, while a few perform some ancillary |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
7 functions. Please see doc/Host-tools-overview for the listing of what tools |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
8 are available and what they do. |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
9 |
434
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
10 The most commonly needed tool for flashing firmware images (fc-loadtool) and |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
11 some of the more rarely needed tools (fc-xram, fc-iram when used with Mot C1xx |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
12 phones, and fc-buzplay) have target-side components, i.e., a part of their |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
13 functionality is implemented in Calypso ARM7 code pieces which these tools feed |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
14 to the Calypso chip's boot ROM or to Mot/Compal's bootloader on Mot C1xx phones. |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
15 The most important of these ARM7 code pieces is loadagent (implements flash |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
16 reading and writing, hardware peeks and pokes, and the chain loading function |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
17 for fc-xram) which is needed for all of our supported Calypso targets (it is |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
18 also common to all of them, no variants), and the second most important piece |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
19 is compalstage, which is needed for Compal (Mot C1xx) phones only. |
390
c7599298998c
README: updated for the new set of top-level source directories
Mychaela Falconia <falcon@freecalypso.org>
parents:
211
diff
changeset
|
20 |
434
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
21 If you are working with a packaged release of FC host tools, as opposed to a |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
22 random snapshot of the source tree, precompiled binaries for loadagent and |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
23 compalstage will be included in the target-bin directory, otherwise you will |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
24 need to build them from source: the source for loadagent and compalstage (plus |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
25 a few extra target utilities that are of interest only to developers) resides |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
26 in target-utils, and you will first need to build and install a special ARM7 |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
27 gcc toolchain as explained in the INSTALL document. |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
28 |
434
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
29 There is a good amount of documentation included in the doc directory, and |
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
30 there is more documentation in our dedicated freecalypso-docs repository: |
0
e7502631a0f9
initial import from freecalypso-sw rev 1033:5ab737ac3ad7
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff
changeset
|
31 |
434
3ec8ef8b2d37
top README simplified, source dirs info moved to Source-dirs
Mychaela Falconia <falcon@freecalypso.org>
parents:
390
diff
changeset
|
32 https://bitbucket.org/falconian/freecalypso-docs |