# martinezjavier/ldd3 architecture

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

- Interactive diagram: https://gitdiagram.com/martinezjavier/ldd3
- Repository: https://github.com/martinezjavier/ldd3

## Overview

This repository is a collection of Linux Device Drivers 3 example drivers, maintained for compatibility with newer kernels—not one end-user application. Its principal interaction is user space accessing a registered device driver through device operations; the SCULL family demonstrates memory-backed character devices, while other examples cover networking, buses, TTYs, USB, PCI, and low-level I/O. The graph preserves the major driver families and shared compatibility/bus code. Evidence is limited to the README and SOURCE INDEX references and excerpts; relationships between unsampled examples are intentionally omitted.

Main entry points: [`scull/main.c`](https://github.com/martinezjavier/ldd3/blob/master/scull/main.c) (SCULL memory device), [`include/access_ok_version.h`](https://github.com/martinezjavier/ldd3/blob/master/include/access_ok_version.h) (Access compatibility), [`sculld/main.c`](https://github.com/martinezjavier/ldd3/blob/master/sculld/main.c) (SCULL device-bus variant), [`scullp/main.c`](https://github.com/martinezjavier/ldd3/blob/master/scullp/main.c) (SCULL page variant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scull["SCULL devices"]
  node_scull["SCULL memory device<br/>[main.c]"]
  node_scull_access["SCULL access control<br/>[access.c]"]
  node_scull_pipe["SCULL pipe<br/>[pipe.c]"]
  node_scullc["SCULL cache variant<br/>[main.c]"]
  node_scullc_mmap["SCULL cache mapping<br/>[mmap.c]"]
  node_sculld["SCULL device-bus variant<br/>[main.c]"]
  node_scullp["SCULL page variant<br/>[main.c]"]
  node_scullp_mmap["SCULL page mapping<br/>[mmap.c]"]
  node_scullv["SCULL virtual-memory variant<br/>[main.c]"]
  node_scullv_mmap["SCULL VM mapping<br/>[mmap.c]"]
  node_scull_async["SCULL async helpers<br/>[scull-async.c]"]
end

subgraph group_device_examples["Device examples"]
  node_simple["Simple character driver<br/>[simple.c]"]
  node_short["Short I/O driver<br/>[short.c]"]
  node_shortprint["Parallel printer driver<br/>[shortprint.c]"]
  node_sbull["Block driver<br/>[sbull.c]"]
  node_pci["PCI skeleton<br/>[pci_skel.c]"]
  node_usb["USB skeleton<br/>[usb-skeleton.c]"]
  node_tty_serial["Tiny serial driver<br/>[tiny_serial.c]"]
  node_tty_driver["Tiny TTY driver<br/>[tiny_tty.c]"]
  node_misc_modules["Misc kernel examples"]
  node_misc_progs["Misc user programs"]
end

subgraph group_network["Network drivers"]
  node_snull["SNULL network driver<br/>[snull.c]"]
end

subgraph group_infrastructure["Driver infrastructure"]
  node_lddbus["LDD virtual bus<br/>[lddbus.c]"]
  node_lddbus_header["Bus interfaces<br/>[lddbus.h]"]
  node_access_compat["Access compatibility"]
  node_proc_compat["Proc operations compatibility<br/>[proc_ops_version.h]"]
end

node_user(("User space"))

node_user -->|"reads and writes"| node_scull
node_scull -->|"checks access"| node_access_compat
node_scull -->|"adapts proc operations"| node_proc_compat
node_scull -->|"uses definitions"| node_scull_pipe
node_user -->|"reads and writes"| node_scullc
node_scullc -->|"checks access"| node_access_compat
node_user -->|"accesses device"| node_sculld
node_sculld -->|"registers device"| node_lddbus
node_sculld -->|"uses bus interface"| node_lddbus_header
node_user -->|"reads and writes"| node_scullp
node_scullp -->|"checks access"| node_access_compat
node_scullp -->|"adapts proc operations"| node_proc_compat
node_user -->|"reads and writes"| node_scullv
node_scullv -->|"checks access"| node_access_compat
node_scullv -->|"adapts proc operations"| node_proc_compat
node_lddbus -->|"implements interface"| node_lddbus_header

click node_scull "https://github.com/martinezjavier/ldd3/blob/master/scull/main.c"
click node_scull_access "https://github.com/martinezjavier/ldd3/blob/master/scull/access.c"
click node_scull_pipe "https://github.com/martinezjavier/ldd3/blob/master/scull/pipe.c"
click node_scullc "https://github.com/martinezjavier/ldd3/blob/master/scullc/main.c"
click node_scullc_mmap "https://github.com/martinezjavier/ldd3/blob/master/scullc/mmap.c"
click node_sculld "https://github.com/martinezjavier/ldd3/blob/master/sculld/main.c"
click node_scullp "https://github.com/martinezjavier/ldd3/blob/master/scullp/main.c"
click node_scullp_mmap "https://github.com/martinezjavier/ldd3/blob/master/scullp/mmap.c"
click node_scullv "https://github.com/martinezjavier/ldd3/blob/master/scullv/main.c"
click node_scullv_mmap "https://github.com/martinezjavier/ldd3/blob/master/scullv/mmap.c"
click node_scull_async "https://github.com/martinezjavier/ldd3/blob/master/scull-shared/scull-async.c"
click node_simple "https://github.com/martinezjavier/ldd3/blob/master/simple/simple.c"
click node_short "https://github.com/martinezjavier/ldd3/blob/master/short/short.c"
click node_shortprint "https://github.com/martinezjavier/ldd3/blob/master/shortprint/shortprint.c"
click node_sbull "https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c"
click node_pci "https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c"
click node_usb "https://github.com/martinezjavier/ldd3/blob/master/usb/usb-skeleton.c"
click node_tty_serial "https://github.com/martinezjavier/ldd3/blob/master/tty/tiny_serial.c"
click node_tty_driver "https://github.com/martinezjavier/ldd3/blob/master/tty/tiny_tty.c"
click node_misc_modules "https://github.com/martinezjavier/ldd3/tree/master/misc-modules"
click node_misc_progs "https://github.com/martinezjavier/ldd3/tree/master/misc-progs"
click node_snull "https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c"
click node_lddbus "https://github.com/martinezjavier/ldd3/blob/master/lddbus/lddbus.c"
click node_lddbus_header "https://github.com/martinezjavier/ldd3/blob/master/include/lddbus.h"
click node_access_compat "https://github.com/martinezjavier/ldd3/blob/master/include/access_ok_version.h"
click node_proc_compat "https://github.com/martinezjavier/ldd3/blob/master/include/proc_ops_version.h"

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_scull,node_scull_access,node_scull_pipe,node_scullc,node_scullc_mmap,node_sculld,node_scullp,node_scullp_mmap,node_scullv,node_scullv_mmap,node_scull_async,node_user toneBlue
class node_simple,node_short,node_shortprint,node_sbull,node_pci,node_usb,node_tty_serial,node_tty_driver,node_misc_modules,node_misc_progs toneAmber
class node_snull toneMint
class node_lddbus,node_lddbus_header,node_access_compat,node_proc_compat toneRose
```

## Components

### SCULL devices

- [SCULL memory device](https://github.com/martinezjavier/ldd3/blob/master/scull/main.c): `scull/main.c`
- [SCULL access control](https://github.com/martinezjavier/ldd3/blob/master/scull/access.c): `scull/access.c`
- [SCULL pipe](https://github.com/martinezjavier/ldd3/blob/master/scull/pipe.c): `scull/pipe.c`
- [SCULL cache variant](https://github.com/martinezjavier/ldd3/blob/master/scullc/main.c): `scullc/main.c`
- [SCULL cache mapping](https://github.com/martinezjavier/ldd3/blob/master/scullc/mmap.c): `scullc/mmap.c`
- [SCULL device-bus variant](https://github.com/martinezjavier/ldd3/blob/master/sculld/main.c): `sculld/main.c`
- [SCULL page variant](https://github.com/martinezjavier/ldd3/blob/master/scullp/main.c): `scullp/main.c`
- [SCULL page mapping](https://github.com/martinezjavier/ldd3/blob/master/scullp/mmap.c): `scullp/mmap.c`
- [SCULL virtual-memory variant](https://github.com/martinezjavier/ldd3/blob/master/scullv/main.c): `scullv/main.c`
- [SCULL VM mapping](https://github.com/martinezjavier/ldd3/blob/master/scullv/mmap.c): `scullv/mmap.c`
- [SCULL async helpers](https://github.com/martinezjavier/ldd3/blob/master/scull-shared/scull-async.c): `scull-shared/scull-async.c`

### Device examples

- [Simple character driver](https://github.com/martinezjavier/ldd3/blob/master/simple/simple.c): `simple/simple.c`
- [Short I/O driver](https://github.com/martinezjavier/ldd3/blob/master/short/short.c): `short/short.c`
- [Parallel printer driver](https://github.com/martinezjavier/ldd3/blob/master/shortprint/shortprint.c): `shortprint/shortprint.c`
- [Block driver](https://github.com/martinezjavier/ldd3/blob/master/sbull/sbull.c): `sbull/sbull.c`
- [PCI skeleton](https://github.com/martinezjavier/ldd3/blob/master/pci/pci_skel.c): `pci/pci_skel.c`
- [USB skeleton](https://github.com/martinezjavier/ldd3/blob/master/usb/usb-skeleton.c): `usb/usb-skeleton.c`
- [Tiny serial driver](https://github.com/martinezjavier/ldd3/blob/master/tty/tiny_serial.c): `tty/tiny_serial.c`
- [Tiny TTY driver](https://github.com/martinezjavier/ldd3/blob/master/tty/tiny_tty.c): `tty/tiny_tty.c`
- [Misc kernel examples](https://github.com/martinezjavier/ldd3/tree/master/misc-modules): `misc-modules`
- [Misc user programs](https://github.com/martinezjavier/ldd3/tree/master/misc-progs): `misc-progs`

### Network drivers

- [SNULL network driver](https://github.com/martinezjavier/ldd3/blob/master/snull/snull.c): `snull/snull.c`

### Driver infrastructure

- [LDD virtual bus](https://github.com/martinezjavier/ldd3/blob/master/lddbus/lddbus.c): `lddbus/lddbus.c`
- [Bus interfaces](https://github.com/martinezjavier/ldd3/blob/master/include/lddbus.h): `include/lddbus.h`
- [Access compatibility](https://github.com/martinezjavier/ldd3/blob/master/include/access_ok_version.h): `include/access_ok_version.h`
- [Proc operations compatibility](https://github.com/martinezjavier/ldd3/blob/master/include/proc_ops_version.h): `include/proc_ops_version.h`

### Other components

- **User space**

## Connections

- User space → SCULL memory device: reads and writes (evidence: `scull/main.c`)
- SCULL memory device → Access compatibility: checks access (evidence: `scull/main.c`)
- SCULL memory device → Proc operations compatibility: adapts proc operations (evidence: `scull/main.c`)
- SCULL memory device → SCULL pipe: uses definitions (evidence: `scull/pipe.c`)
- User space → SCULL cache variant: reads and writes (evidence: `scullc/main.c`)
- SCULL cache variant → Access compatibility: checks access (evidence: `scullc/main.c`)
- User space → SCULL device-bus variant: accesses device (evidence: `sculld/main.c`)
- SCULL device-bus variant → LDD virtual bus: registers device (evidence: `sculld/main.c`)
- SCULL device-bus variant → Bus interfaces: uses bus interface
- User space → SCULL page variant: reads and writes (evidence: `scullp/main.c`)
- SCULL page variant → Access compatibility: checks access (evidence: `scullp/main.c`)
- SCULL page variant → Proc operations compatibility: adapts proc operations (evidence: `scullp/main.c`)
- User space → SCULL virtual-memory variant: reads and writes (evidence: `scullv/main.c`)
- SCULL virtual-memory variant → Access compatibility: checks access (evidence: `scullv/main.c`)
- SCULL virtual-memory variant → Proc operations compatibility: adapts proc operations (evidence: `scullv/main.c`)
- LDD virtual bus → Bus interfaces: implements interface (evidence: `lddbus/lddbus.c`)
