# amanieusystems/tango32-module architecture

> Architecture diagram of the GitHub repository amanieusystems/tango32-module, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/amanieusystems/tango32-module
- Repository: https://github.com/amanieusystems/tango32-module

## Overview

Tango32 is a Linux kernel module that lets a 64-bit process, including the Tango translator’s translated 32-bit programs, invoke compatibility operations unavailable entirely in userspace. The workflow is ioctl requests on `/dev/tango32`, dispatched to handlers for process memory metadata and selected 32-bit syscall behaviors. The public ABI defines versioning and request structures; implementation details are sampled only partially, so the graph shows the handler branches visible in the excerpts and documented ABI capabilities without inferring their internal calls.

Main entry points: [`tango32.c`](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c) (Ioctl dispatcher), [`tango32.h`](https://github.com/amanieusystems/tango32-module/blob/master/tango32.h) (Ioctl ABI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Ioctl interface"]
  node_dispatcher["Ioctl dispatcher<br/>[tango32.c]"]
  node_abi["Ioctl ABI<br/>[tango32.h]"]
end

subgraph group_handlers["Compatibility handlers"]
  node_memory["Memory metadata<br/>[tango32.c]"]
  node_file_ioctl["Compat file ioctl<br/>[tango32.c]"]
  node_robust_list["Robust list<br/>[tango32.c]"]
  node_directory["Directory entries<br/>[tango32.c]"]
  node_seek["Compat seek<br/>[tango32.c]"]
end

node_process(("64-bit process"))
node_device["/dev/tango32"]

node_process -->|"issues ioctls"| node_device
node_device -->|"dispatches"| node_dispatcher
node_dispatcher -->|"uses definitions"| node_abi
node_dispatcher -->|"routes requests"| node_memory
node_dispatcher -->|"routes requests"| node_file_ioctl
node_dispatcher -->|"routes requests"| node_robust_list
node_dispatcher -->|"routes requests"| node_directory
node_dispatcher -->|"routes requests"| node_seek

click node_dispatcher "https://github.com/amanieusystems/tango32-module/blob/master/tango32.c"
click node_abi "https://github.com/amanieusystems/tango32-module/blob/master/tango32.h"
click node_memory "https://github.com/amanieusystems/tango32-module/blob/master/tango32.c"
click node_file_ioctl "https://github.com/amanieusystems/tango32-module/blob/master/tango32.c"
click node_robust_list "https://github.com/amanieusystems/tango32-module/blob/master/tango32.c"
click node_directory "https://github.com/amanieusystems/tango32-module/blob/master/tango32.c"
click node_seek "https://github.com/amanieusystems/tango32-module/blob/master/tango32.c"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dispatcher,node_abi toneBlue
class node_memory,node_file_ioctl,node_robust_list,node_directory,node_seek toneAmber
class node_process,node_device toneIndigo
```

## Components

### Ioctl interface

- [Ioctl dispatcher](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c): `tango32.c`
- [Ioctl ABI](https://github.com/amanieusystems/tango32-module/blob/master/tango32.h): `tango32.h`

### Compatibility handlers

- [Memory metadata](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c): `tango32.c`
- [Compat file ioctl](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c): `tango32.c`
- [Robust list](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c): `tango32.c`
- [Directory entries](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c): `tango32.c`
- [Compat seek](https://github.com/amanieusystems/tango32-module/blob/master/tango32.c): `tango32.c`

### Other components

- **64-bit process**
- **/dev/tango32**

## Connections

- 64-bit process → /dev/tango32: issues ioctls (evidence: `README.md`)
- /dev/tango32 → Ioctl dispatcher: dispatches (evidence: `README.md`)
- Ioctl dispatcher → Ioctl ABI: uses definitions (evidence: `tango32.c`)
- Ioctl dispatcher → Memory metadata: routes requests (evidence: `tango32.c`)
- Ioctl dispatcher → Compat file ioctl: routes requests (evidence: `tango32.c`)
- Ioctl dispatcher → Robust list: routes requests (evidence: `tango32.c`)
- Ioctl dispatcher → Directory entries: routes requests (evidence: `tango32.c`)
- Ioctl dispatcher → Compat seek: routes requests (evidence: `tango32.c`)
