amiga-bootcamp/11_libraries/expansion.md
Ilia Sharin 21751c0025 docs(amiga): complete AmigaOS 3.1/3.2 developer reference — 172 files across 17 sections
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.
2026-04-23 12:17:35 -04:00

82 lines
2.2 KiB
Markdown

[← Home](../README.md) · [Libraries](README.md)
# expansion.library — Zorro Bus and AutoConfig
## Overview
`expansion.library` handles automatic configuration of Zorro II/III expansion boards. At boot, the OS scans the expansion bus and assigns base addresses to each board based on its AutoConfig ROM.
---
## AutoConfig Sequence
1. Board asserts `CFGIN` to request configuration
2. CPU reads 256-byte config area at `$E80000`
3. Board reports: manufacturer ID, product ID, board size, flags
4. OS assigns a base address via `WriteExpansionByte`
5. Board relocates to assigned address
6. Next board in chain is configured
---
## struct ConfigDev
```c
/* libraries/configvars.h — NDK39 */
struct ConfigDev {
struct Node cd_Node;
UBYTE cd_Flags; /* CDF_* flags */
UBYTE cd_Pad;
struct ExpansionRom cd_Rom; /* AutoConfig ROM data */
APTR cd_BoardAddr; /* assigned base address */
ULONG cd_BoardSize; /* board size in bytes */
UWORD cd_SlotAddr; /* slot address */
UWORD cd_SlotSize;
APTR cd_Driver; /* driver bound to this board */
struct ConfigDev *cd_NextCD; /* next in chain */
/* ... */
};
struct ExpansionRom {
UBYTE er_Type; /* board type + size code */
UBYTE er_Product; /* product number */
UBYTE er_Flags;
UBYTE er_Reserved03;
UWORD er_Manufacturer; /* manufacturer ID */
ULONG er_SerialNumber;
UWORD er_InitDiagVec; /* boot ROM offset */
/* ... */
};
```
---
## Finding Expansion Boards
```c
struct Library *ExpansionBase = OpenLibrary("expansion.library", 0);
struct ConfigDev *cd = NULL;
while ((cd = FindConfigDev(cd, 2167, 11))) {
/* manufacturer=2167 (Individual Computers), product=11 (ACA500plus) */
Printf("Board at $%08lx, size %lu\n", cd->cd_BoardAddr, cd->cd_BoardSize);
}
```
---
## Common Manufacturer IDs
| ID | Manufacturer |
|---|---|
| 514 | Commodore |
| 2017 | GVP |
| 2167 | Individual Computers |
| 8512 | Phase5 |
---
## References
- NDK39: `libraries/configvars.h`, `libraries/expansion.h`
- ADCD 2.1: expansion.library autodocs