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:16:52 -04:00
|
|
|
|
[← Home](../README.md) · [AmigaDOS](README.md)
|
|
|
|
|
|
|
|
|
|
|
|
# Process Management — CreateNewProc, SystemTagList, Execute
|
|
|
|
|
|
|
|
|
|
|
|
## Overview
|
|
|
|
|
|
|
|
|
|
|
|
AmigaDOS provides several ways to launch child processes, ranging from the low-level `CreateNewProc` to the shell-level `Execute` and `SystemTagList`.
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## CreateNewProcTags (OS 2.0+)
|
|
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
|
/* dos/dostags.h — NDK39 */
|
|
|
|
|
|
struct Process *proc = CreateNewProcTags(
|
|
|
|
|
|
NP_Entry, myFunction, /* function pointer */
|
|
|
|
|
|
NP_Name, "Worker", /* task name */
|
|
|
|
|
|
NP_StackSize, 8192, /* stack size in bytes */
|
|
|
|
|
|
NP_Priority, 0, /* scheduling priority */
|
|
|
|
|
|
NP_Input, Open("NIL:", MODE_OLDFILE),
|
|
|
|
|
|
NP_Output, Open("NIL:", MODE_NEWFILE),
|
|
|
|
|
|
NP_CloseInput, TRUE, /* close input on exit */
|
|
|
|
|
|
NP_CloseOutput, TRUE,
|
|
|
|
|
|
NP_CurrentDir, DupLock(currentDir),
|
|
|
|
|
|
TAG_DONE);
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### Tag Constants
|
|
|
|
|
|
|
|
|
|
|
|
| Tag | Value | Meaning |
|
|
|
|
|
|
|---|---|---|
|
|
|
|
|
|
| `NP_Entry` | — | Function to run as the new process |
|
|
|
|
|
|
| `NP_Seglist` | — | Alternative: run from a loaded segment list |
|
|
|
|
|
|
| `NP_Name` | — | Process name (appears in task list) |
|
|
|
|
|
|
| `NP_StackSize` | — | Stack size in bytes (default 4096) |
|
|
|
|
|
|
| `NP_Priority` | — | Task priority (−128 to +127) |
|
|
|
|
|
|
| `NP_Input` | — | BPTR stdin handle |
|
|
|
|
|
|
| `NP_Output` | — | BPTR stdout handle |
|
|
|
|
|
|
| `NP_Error` | — | BPTR stderr handle (OS 3.0+) |
|
|
|
|
|
|
| `NP_CurrentDir` | — | Lock for current directory |
|
|
|
|
|
|
| `NP_HomeDir` | — | Lock for PROGDIR: |
|
|
|
|
|
|
| `NP_CopyVars` | — | Copy parent's local vars to child |
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## SystemTagList — Run a Shell Command
|
|
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
|
/* Execute a command string as if typed in a shell: */
|
|
|
|
|
|
LONG rc = SystemTagList("dir SYS: ALL", NULL);
|
|
|
|
|
|
/* rc = return code from the command */
|
|
|
|
|
|
|
|
|
|
|
|
/* With custom I/O: */
|
|
|
|
|
|
LONG rc = SystemTagList("list RAM:", (struct TagItem[]){
|
|
|
|
|
|
{ SYS_Input, Open("NIL:", MODE_OLDFILE) },
|
|
|
|
|
|
{ SYS_Output, Open("RAM:output.txt", MODE_NEWFILE) },
|
|
|
|
|
|
{ TAG_DONE, 0 }
|
|
|
|
|
|
});
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## Execute — Legacy Command Execution
|
|
|
|
|
|
|
|
|
|
|
|
```c
|
|
|
|
|
|
/* dos.library LVO −132 */
|
|
|
|
|
|
BOOL Execute(STRPTR command, BPTR input, BPTR output);
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
- `command` — shell command string
|
|
|
|
|
|
- `input` — BPTR to additional input (0 = none)
|
|
|
|
|
|
- `output` — BPTR to output handle (0 = current)
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## WaitForChild / Process Exit
|
|
|
|
|
|
|
|
|
|
|
|
Child processes are independent tasks. To synchronize:
|
|
|
|
|
|
1. Use a shared `MsgPort` — child sends a death message
|
|
|
|
|
|
2. Check `pr_Result2` after the child task exits
|
|
|
|
|
|
3. Use `SYS_Asynch` tag with `SystemTagList` for fire-and-forget
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## References
|
|
|
|
|
|
|
|
|
|
|
|
- NDK39: `dos/dostags.h`, `dos/dosextens.h`
|
|
|
|
|
|
- ADCD 2.1: `CreateNewProc`, `SystemTagList`, `Execute`
|
2026-04-23 12:24:21 -04:00
|
|
|
|
- [tasks_processes.md](../06_exec_os/tasks_processes.md) — Task/Process structures
|