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.
3.1 KiB
3.1 KiB
ExecBase — Full Structure Reference
Overview
ExecBase is the root structure of AmigaOS, located at absolute address $4. It is a struct Library extended with all exec kernel state: memory lists, task queues, interrupt vectors, library lists, and hardware abstraction fields.
Locating ExecBase
struct ExecBase *SysBase = *((struct ExecBase **)4);
In assembly:
MOVEA.L 4.W, A6 ; A6 = SysBase
Key Field Groups
Library Header (offset 0)
struct Library LibNode; /* +0 — ln_Name = "exec.library" */
/* +20 — lib_Version (40 = OS3.1, 44 = OS3.2) */
Interrupts (offset +84)
UWORD AttnFlags; /* +0x128 — processor capability flags */
UWORD AttnResched; /* +0x12A — reschedule attention flag */
Task Scheduling
| Offset | Field | Description |
|---|---|---|
| +0x128 | TaskReady |
struct List — tasks ready to run |
| +0x132 | TaskWait |
struct List — tasks waiting on signals |
| +0x126 | IDNestCnt |
Interrupt disable nesting count |
| +0x127 | TDNestCnt |
Task disable nesting count |
Memory
| Offset | Field | Description |
|---|---|---|
| +0x130 | MemList |
struct List of MemHeader regions |
| +0x134 | ResourceList |
Resources list |
Library and Device Lists
| Offset | Field | Description |
|---|---|---|
| +0x17A | LibList |
struct List — loaded libraries |
| +0x182 | DeviceList |
struct List — loaded devices |
| +0x18A | IntrList |
Interrupt server list |
| +0x192 | PortList |
Public message ports |
| +0x19A | TaskList |
All tasks (not just ready/waiting) |
Vectors and ROM
| Offset | Field | Description |
|---|---|---|
| +0x26 | SoftVer |
Kickstart software revision |
| +0x10 | ChkBase |
Checksum of library header |
| +0x222 | PowerSupplyFrequency |
50 or 60 Hz |
| +0x21E | ChipRevBits0 |
Chip revision detection flags |
Chip Revision Flags (ChipRevBits0)
| Bit | Constant | Chip |
|---|---|---|
| 4 | ATNF_68010 |
68010 or better |
| 5 | ATNF_68020 |
68020 or better |
| 6 | ATNF_68030 |
68030 |
| 7 | ATNF_68040 |
68040 |
| 10 | ATNF_FPU40 |
68040 internal FPU |
Detecting CPU and Chipset
/* CPU: */
if (SysBase->AttnFlags & AFF_68020) { /* 020+ */ }
if (SysBase->AttnFlags & AFF_68040) { /* 040 */ }
/* Chipset (via graphics.library): */
struct GfxBase *gfx = (struct GfxBase *)OpenLibrary("graphics.library", 36);
if (gfx->ChipRevBits0 & GFXB_AA_ALICE) { /* AGA Alice chip */ }
ExecBase in IDA Pro
After loading Kickstart ROM:
- Create a segment at
$4containing a pointer - Follow the pointer to the ExecBase (in ROM)
- Apply
struct ExecBasetype (from NDK39 headers parsed viaFile → Parse C header) - All
N(A6)offsets auto-annotate as field names
References
- NDK39:
exec/execbase.h— authoritative field definitions - ADCD 2.1: exec.library autodoc
- Amiga ROM Kernel Reference Manual: Exec — ExecBase chapter
- http://amigadev.elowar.com/read/ADCD_2.1/Libraries_Manual_guide/node0072.html