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. |
||
|---|---|---|
| .. | ||
| compiler_stubs.md | ||
| fd_files.md | ||
| inline_stubs.md | ||
| library_structure.md | ||
| link_libraries.md | ||
| lvo_table.md | ||
| README.md | ||
| register_conventions.md | ||
| setfunction.md | ||
| shared_libraries_runtime.md | ||
| startup_code.md | ||
Linking & Library Integration
Overview
This section documents how AmigaOS shared libraries work at the binary level — how compilers produce library call stubs, how the linker wires them up, and how to reconstruct this mechanism during reverse engineering.
Contents
| File | Topic |
|---|---|
| library_structure.md | Library node, LVO table, OpenLibrary mechanics |
| fd_files.md | Function Definition files — the library ABI source |
| lvo_table.md | JMP table layout and reconstruction |
| compiler_stubs.md | How SAS/C, GCC, VBCC call libraries |
| setfunction.md | Runtime function patching with SetFunction |
| startup_code.md | c.o / gcrt0.S — startup and exit sequences |
The Library ABI Model
Every AmigaOS shared library exposes its functions through a negative-offset JMP table relative to the library base pointer:
Library base: LIB+0 → Library node (struct Library)
LIB-6 → JMP _funcN (last function)
LIB-12 → JMP _funcN-1
...
LIB-6 → JMP _func1 (first user function)
A C call like OpenLibrary("graphics.library", 0) compiles to:
MOVE.L 4.W, A6 ; A6 = SysBase (exec)
JSR -552(A6) ; LVO for OpenLibrary = -552
The negative offset (-552) is the Library Vector Offset (LVO) — a fixed ABI value defined in the library's .fd file and proto/ include.
References
- NDK39:
fd/directory,proto/includes,inline/inline stubs - ADCD 2.1: Library writing guide, ROM Kernel Manual
- http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0000.html