Amiga Hunk

Hunk is the executable format of programs under the classic AmigaOS ( up to version 3.9) for the Amiga based on the Motorola 68000 processor family. The name " Hunk " is derived from the manner in which such software is internally structured; namely as several small chunks or pieces (English hunks ). Each one of these hunks can contain data and executable code.

  • Classic AmigaOS 6.1 6.1.1 Hunk_Overlay
  • 6.1.2 Extended Hunk Format (EHF )
  • 6.1.3 ELF

Hunk structure

The hunks in the executable programs the Amiga exist in at least three different forms. There are 32 -bit, 16 -bit and occasionally also 8 -bit Hunks.

The various hunks are standardized in AmigaOS and documented in detail in The AmigaDOS Manual. This standardization was monitored by Commodore themselves and grow as needed.

The standardizations were for developers over the years as guidelines for Amiga system-compliant programming. The structures were officially coded in the system and could be changed only by a Commodore Committee for new versions of AmigaOS. Subsequently, they were issued to the developers.

The structure of the Amiga Hunk format is very simple. There is, in principle, of three parts: a header (Header), an ID ( the size of the Hunks ) and subsequently a segment which contains the program code or data.

The header should be identical to the Amiga and a known type.

Characteristics of an executable program Amiga

The programs can be started either from the graphical operating system shell of AmigaOS, the desktop ( workbench), from the Amiga CLI (Amiga shell) or from a file manager.

Files under the AmigaOS do not require file extensions. Files can arbitrarily be renamed, including the file extension and do not change with their file type. Under AmigaOS file types on Hunks, header or a magic cookie to be recognized. This magic cookie ($ 000003f3 ) is used, for example, from AmigaOS for identification of executable programs and is part of the header. The name comes from the fairy tale Alice in Wonderland. A similar method is also used by Unix-like operating systems, and there called Magic Number.

Structure of an executable program Amiga

The internal structure of an Amiga program is also quite simple. The structure begins with the magic cookie, followed by the number of all available Hunks and a segment that all Hunks in sequence (starting with 0 ) contains. The first hunk always wears the number zero.

Just before the start Hunksegment, is a table that includes the length of each Hunks. Each hunk begins here with an ID that is assigned to a certain Hunktyp ( HUNK_CODE or HUNK_DATA ).

Hunktypen

The AmigaOS known Hunktypen:

Metadata

The Amiga would be quite able to store metadata in Hunks. The structure of the hunks could in any case be relatively easily adapted. These changes but were rejected in favor of the ELF format. Today, however, there is no Commodore Committee more, which could monitor these changes and implement.

Therefore, the Amiga stores part of its metadata in the so-called. Info files. The principle of these files is a little like the old executable programs on the Macintosh, while the resource fork.

The. Info files are usually created every time you create files ( project files ) under AmigaOS with. The. Info file contains information such as the actual icon of the file, information about the creator of the file creation time, required display software, file base type or user comments. In AmigaOS is no fixed link to applications such as in MacOS.

. info files are not viewable directly on the workbench. The Workbench provides the file and its. Info file appears as a unit, for displaying an icon bitmap information is used from the. Info file.

If the user double- clicks on the icon with the left mouse button to run, that program is started, which is set as the display program in the. Info file and pass the actual file as an argument. A menu can be opened with the right mouse button in the renamed file or an information window can be opened. In the information window, the user can change a majority of meta-information.

Both files, the actual file and the. Info file that will always move together when you move on the workbench with the mouse or marked. You are always treated as a stop. If you want to manipulate the files individually, one has to rely on the CLI or a file manager such as Directory Opus.

If the. Info file represents an executable program that contains information about the stack size of the program (4096 bytes, 8192 bytes, etc.). The information will also be considered if it is started via the CLI of the AmigaOS.

The user also has the option to remove the. Info file, but it also removes all meta-information and the icon.

Icons

The icons are a part of. Info files, and are embedded in the principle and not the raw bitmaps Standard-Amiga-IFF/ILBM-Format. The user can change the bitmaps in the. Info files IconEdit edit accompanying standard program with the AmigaOS. Since AmigaOS 2.0 and the program is in - export to also be able to IFF / ILBM images.

Store some more Amiga programs, such as the non- human Paint of Cloanto, are able to load the bitmap information from the. Info files, and display. The classic Amiga icons (up to AmigaOS 3.1) are so-called two- state icons. They include two bitmaps, one for the normal state and a depressed state for the. The two bitmaps are on -the-fly as it were replaced when an icon is selected or unselected.

More modern Amiga surfaces such as the ReAction GUI ( AmigaOS 9.3 to 1.4 ) or the MUI (classic AmigaOS, AROS and MorphOS ) use other ways to use icons.

All modern Amiga -like operating systems ( AmigaOS 4.0/4.1, MorphOS and AROS ) are able, raw bitmaps, IFF/ILBM- and PNG-Daten/Dateien to use as Icondaten.

More AmigaOS known executable formats

Classic AmigaOS

AmigaOS (up to 3.9) recognizes these formats.

Hunk_Overlay

The Hunk_Overlay type is one of the Commodore started by default Hunks. He was meant to solve low memory problems. This Hunk implements a method to load programs that are larger than the actual amount of memory in the operating system.

In this method, a root structure is maintained with references to smaller fragments of code / modules in memory, the actual code fragments are loaded only when needed into memory, thus practically a kind of overlay programming.

This design approach was relatively clever, but in practice its use was so awkward that this method was only used very rarely. Most developers simply ignore this possibility.

Extended Hunk Format (EHF )

In 1997, the hardware manufacturers phase5 a PowerPC-based accelerator cards. Since the Amiga but still ran on 680x0 processors, the PowerPC processor was used as a kind of co-processor. The result was that both processors had to take turns using the RAM ( Task-/Contextswitching ) and the system was to be strongly slowed down. In order to master the problem, the AmigaOS-3.5/3.9-Entwickler Haage & Partner, presented a different way to share data and code with PowerPC hardware. The possibility existed of a new PowerPC-API/Kernel names WarpOS / WarpUP who behaved conform to the system by expanding the Amiga Hunk format. This new format is called Extended Hunk Format (EHF ) and extends the classic Amiga hunks to the type HUNK_PPC_CODE.

ELF

The hardware manufacturers Phase 5 led with his PowerPC hardware, known from the Unix world ELF format ( part of PowerPC-API/Kernel PowerUP ). The format was later acquired by AmigaOS 4.x, MorphOS and AROS. An ELF emulation was later incorporated by third parties in WarpOS / WarpUP.

AmigaOS 4.0 and MorphOS

AmigaOS 4.x and MorphOS can run the ELF format natively on the hardware since both operating systems run natively on PowerPC hardware. Both of which are also able to execute natively EHF. MorphOS is additionally able to execute the ELF format for m68k/PowerPC-Beschleunigerkarten ( powerup ) for classic Amigas.

Both operating systems are also able to perform the classic Amiga Hunk format in an emulation layer. Of almost the complete AmigaOS 3.1 API is emulated. This is realized by a JITM (Just In Time Machine ), which maps all 68000 instructions on PowerPC instructions and achieved a fairly high speed emulation. The JIT engine under AmigaOS 4.x is, Petunia and the JIT engine of MorphOS is called trance.

Credentials

  • The AmigaDOS Manual Third Edition (Bantam Books), Commodore Business Machines, July 1991. ISBN 0-553-35403-5
  • Amiga ROM Kernel Reference Manual, Includes and Autodocs ( 3rd edition; dark gray cover) Addison -Wesley, 1991, ISBN 0-201-56773-3.
  • Commodore Business Machines: 1989 Amiga Developers Conference Notes, Commodore, 1989 CATS part numbers: . NOTES89 and NOTES89D
  • Commodore Business Machines: V3.1 Amiga Developer Update Disc Set, Commodore, 1994 CATS part number:. AMDEV3.1 ( now part of The Developer CD )
  • Commodore Business Machines: 1988 Amiga Developers Conference Notes Commodore, 1988 CATS part numbers: . NOTES88 and NOTES88D
  • Stephen Levy: Amiga Programmer's Guide, Compute! Publications, 1986. ISBN 0-87455-028-9
  • Eugene P. Mortimore: Amiga Programmer's Handbook, Sybex, 1985, ISBN 0-89588-343-0.
57313
de