Sign in Join
Wiki copytemporary

Amiga Legacy Support: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11*(Amiga only)*
22
33This page details compiling for "legacy" AmigaOS/m68k versions, specifically AmigaOS 1.x; traditionally also called Kickstart 1.x. (Kickstart describes the ROM part of the operating system, while Workbench is the desktop, usually loaded from a floppy or hard disk.) At this point the support is in an initial state, with some features missing. These will be added as needed. Note that the support is only present in the SVN trunk. There are no plans to backport it to the stable 3.2.x branch.
44
55The traditional [[Amiga|AmigaOS 3.x]] support serves as a baseline for all information here, this page only details the differences.
66
77## Requirements
88
99At this point, the minimum version a "legacy Amiga" Free Pascal RTL can work with is AmigaOS v1.2 (internal version v33). This was the lowest version ever shipped on a physical ROM chip in any Amiga system.
1010
1111## Compiler
1212
1313The same compiler which targets "high-end" classic Amiga systems can also generate binaries for "legacy" systems with the right configuration and command line switches. There is no need to use a separate compiler. Only a separate set of RTL and Packages units are needed.
1414
1515## Default CPU
1616
1717Most "legacy" Amiga systems run with the stock Motorola 68000 CPU, while Free Pascal defaults to generating code for the Motorola 68020 or newer CPUs. This can be changed with the **-Cp68000** command line argument. For further information on legacy m68k CPU support, including special support for unaligned accesses, see the [[m68k]] CPU page.
1818
1919## Stack and Heap
2020
2121Free Pascal's run time library on Amiga tries to allocate 256KiB stack for safety reasons, and tries to allocate 1MiB of heap on startup for performance reasons. When targeting limited systems, it is recommended to lower these values using the **-Cs** and **-Ch** command line arguments, or by adding the **{\$MEMORY}** directive to the main program. Example:
2222
23-`// This will allocate 8KiB stack and 64KiB heap on program start`\
24-`{$MEMORY 8192,65536}`
23+``` pascal
24+// This will allocate 8KiB stack and 64KiB heap on program start
25+{$MEMORY 8192,65536}
26+```
2527
2628## Compiling the RTL with "legacy" support
2729
2830To compile an RTL which is able to run on AmigaOS versions lower than 3.0 (pre-v39), you need to specify the define **AMIGA_V1_2_ONLY** while compiling the RTL. This can be achieved by adding the **-dAMIGA_V1_2_ONLY** argument to the OPT part of *make* arguments. This will automatically exclude code from the RTL which depends on newer OS functions, and automatically include some helper functions which are required to support the RTL on these very old systems. Example:
2931
30-` make rtl OPT="-Cp68000 -dAMIGA_V1_2_ONLY"`
32+```
33+ make rtl OPT="-Cp68000 -dAMIGA_V1_2_ONLY"
34+```
3135
3236Note that the "legacy" RTL is functional on a newer AmigaOS as well, but as a trade-off it has to use quite a few hacks and digging into system structures, to bridge the gap created by the lack of necessary OS features. Additionally, it also uses a less advanced memory allocation scheme, and might lack some features. Therefore it is not recommended to ship executables linked with the legacy RTL, when the primary targets are "high-end" Amiga systems.
3337
3438## Linker
3539
3640Free Pascal defaults to *vlink* on Amiga. For the legacy support to work correctly, **vlink 0.16c or newer** is recommended.
3741
3842## Missing features
3943
4044- FindFirst/FindNext functions of the RTL's DOS and sysutils units depend on *dos.library v36+* functions, replacements are partially implemented with basic functionality and don't support full pattern matching for example (further improvements planned)
4145- environment variable support of the RTL's DOS and sysutils units depend on *dos.library v36+* functions, these are not functional (planned)
4246- setting a file's datestamp is not trivial, so related DOS and sysutils functions might not be functional (might not be possible)
4347- some file operations are non-functional, like *truncate()* (not easily possible)
4448- ParamStr(0) will not include the full path of the executable in all cases (not easily fixable)
4549- probably more...
4650
4751---
4852*From the Free Pascal wiki, page "Amiga Legacy Support", as it stood on 2021-12-26 after a change by Chain-Q, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
4953Category: AmigaOS
5054Category: Operating Systems and Platforms

Back to history