mirror of
https://github.com/alfishe/amiga-bootcamp.git
synced 2026-06-13 00:26:28 +00:00
Comprehensive technical documentation covering: - Hardware: OCS/ECS/AGA custom chip registers, Copper & Blitter deep dives - Boot sequence: cold boot through startup-sequence - Binary format: HUNK executable spec, relocation, debug info - Linking & ABI: .fd files, LVO tables, register calling conventions - Exec kernel: tasks, interrupts, memory, signals, semaphores - AmigaDOS: file I/O, FFS/OFS layout, CLI/Shell scripting - Graphics: planar bitmaps, Copper programming, HAM/EHB modes - Intuition: screens, windows, IDCMP, BOOPSI - Devices: trackdisk, SCSI, serial, timer, audio, keyboard - Libraries: utility, expansion, IFFParse, locale, ARexx - Networking: bsdsocket API, SANA-II, TCP/IP stack comparison - Toolchain: GCC, vasm/vlink, SAS/C, NDK, debugging - Reverse engineering: IDA/Ghidra setup, compiler fingerprints, case studies - CPU & MMU: 68040/060 emulation libs, PMMU, cache management - Driver development: SANA-II, Picasso96/RTG, AHI audio All files include breadcrumb navigation. No local paths or proprietary content.
2.4 KiB
2.4 KiB
Executable Loader & HUNK Format
Overview
This section covers the complete lifecycle of an AmigaOS executable:
- HUNK file format — the binary container for all AmigaOS executables, libraries, and object files
- Loader pipeline — how
dos.libraryloads and relocates an executable into memory - Object files — how compilers produce relocatable object files for the linker
- Overlays — how programs larger than available memory use the overlay system
Contents
| File | Topic |
|---|---|
| hunk_format.md | Complete HUNK binary specification |
| hunk_ext_deep_dive.md | HUNK_EXT: exports, imports, commons |
| hunk_relocation.md | HUNK_RELOC32/16/8 mechanics |
| hunk_debug_info.md | HUNK_SYMBOL, HUNK_DEBUG (stabs) |
| exe_load_pipeline.md | LoadSeg → Process creation |
| object_file_format.md | Compiler object files (HUNK_UNIT) |
| overlay_system.md | HUNK_OVERLAY memory segmentation |
Why HUNK?
HUNK is the native AmigaOS executable format, used from AmigaOS 1.0 through 3.x. It predates ELF/COFF and has these key properties:
- Segmented: separate code, data, and BSS hunks with independent memory allocation
- Relocatable: all absolute references are patched at load time (no ASLR; base address changes each run)
- Typed memory: each hunk can request
CHIPorFASTmemory independently - Symbol-complete: optional HUNK_SYMBOL and HUNK_DEBUG hunks carry debugging information
Key Concepts
| Term | Meaning |
|---|---|
| Hunk | One contiguous block in the binary (code, data, BSS, etc.) |
| Segment | A loaded hunk at runtime — a BPTR-linked list |
| Segment list | Chain of loaded hunks returned by LoadSeg() |
| BPTR | Amiga byte pointer — 32-bit value right-shifted by 2 (ptr >> 2) |
| Relocation | Patching absolute addresses based on actual load address |
| LVO | Library Vector Offset — negative offset from library base |
References
- ADCD 2.1:
Includes_and_Autodocs_3._guide/— dos.library LoadSeg autodoc - NDK39:
dos/dos.h— BPTR, segment handling macros - Amiga ROM Kernel Reference Manual: Libraries — AmigaDOS chapter
- http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0150.html