mirror of
https://github.com/alfishe/amiga-bootcamp.git
synced 2026-06-13 00:26:28 +00:00
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.
This commit is contained in:
parent
f07a368bf1
commit
21751c0025
172 changed files with 19701 additions and 0 deletions
86
11_libraries/utility.md
Normal file
86
11_libraries/utility.md
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
[← Home](../README.md) · [Libraries](README.md)
|
||||
|
||||
# utility.library — TagItems, Hooks, Date Utilities
|
||||
|
||||
## Overview
|
||||
|
||||
`utility.library` (OS 2.0+) provides the universal tag-based parameter passing system, callback hooks, and date/time utilities used throughout AmigaOS.
|
||||
|
||||
---
|
||||
|
||||
## TagItem System
|
||||
|
||||
```c
|
||||
/* utility/tagitem.h — NDK39 */
|
||||
struct TagItem {
|
||||
ULONG ti_Tag; /* tag identifier */
|
||||
ULONG ti_Data; /* tag value */
|
||||
};
|
||||
|
||||
/* Special tag values: */
|
||||
#define TAG_DONE 0 /* end of tag list */
|
||||
#define TAG_END TAG_DONE
|
||||
#define TAG_IGNORE 1 /* skip this tag */
|
||||
#define TAG_MORE 2 /* ti_Data = pointer to another TagItem array */
|
||||
#define TAG_SKIP 3 /* skip next ti_Data tags */
|
||||
#define TAG_USER (1<<31) /* user-defined tags start here */
|
||||
```
|
||||
|
||||
### Tag Utility Functions
|
||||
|
||||
| Function | Description |
|
||||
|---|---|
|
||||
| `FindTagItem(tag, tagList)` | Find first matching tag |
|
||||
| `GetTagData(tag, default, tagList)` | Get tag value with default |
|
||||
| `NextTagItem(&tagListPtr)` | Iterate through tags |
|
||||
| `TagInArray(tag, array)` | Check if tag is in an array |
|
||||
| `FilterTagItems(tagList, filter, logic)` | Filter tag list |
|
||||
| `CloneTagItems(tagList)` | Allocate copy of tag list |
|
||||
| `FreeTagItems(tagList)` | Free cloned tag list |
|
||||
| `MapTags(tagList, mapList, flags)` | Remap tag IDs |
|
||||
|
||||
---
|
||||
|
||||
## Hook System
|
||||
|
||||
```c
|
||||
/* utility/hooks.h */
|
||||
struct Hook {
|
||||
struct MinNode h_MinNode;
|
||||
ULONG (*h_Entry)(void); /* assembler entry point */
|
||||
ULONG (*h_SubEntry)(void); /* C function pointer */
|
||||
APTR h_Data; /* user data */
|
||||
};
|
||||
```
|
||||
|
||||
Convention: `h_Entry` receives `A0=hook, A2=object, A1=message`.
|
||||
|
||||
```c
|
||||
/* Convenience macro for SAS/C and GCC: */
|
||||
ULONG myHookFunc(struct Hook *hook __asm("a0"),
|
||||
Object *obj __asm("a2"),
|
||||
APTR msg __asm("a1"))
|
||||
{
|
||||
/* ... */
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct Hook myHook = { {NULL}, (HOOKFUNC)myHookFunc, NULL, myData };
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Date Utilities
|
||||
|
||||
```c
|
||||
struct ClockData cd;
|
||||
Amiga2Date(seconds, &cd); /* seconds since 1.1.1978 → date */
|
||||
ULONG secs = Date2Amiga(&cd); /* date → seconds */
|
||||
ULONG secs = CheckDate(&cd); /* validate and convert */
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## References
|
||||
|
||||
- NDK39: `utility/tagitem.h`, `utility/hooks.h`, `utility/date.h`
|
||||
Loading…
Add table
Add a link
Reference in a new issue