# harvey-os/harvey architecture

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

- Interactive diagram: https://gitdiagram.com/harvey-os/harvey
- Repository: https://github.com/harvey-os/harvey

## Overview

This repository is a re-release of Plan 9 4th Edition: an operating system and its userland, rather than one standalone application. Its broad runtime shape is a booted kernel offering networking and a file-protocol foundation to system services and user programs. The README documents 9P2000, Venti, Fossil, Factotum, Replica, and the Wiki, but their server implementations are not present in the supplied tree excerpt, so those nodes use only supported directory paths. Sampled source also shows platform-specific kernel startup and standalone commands; detailed links among unsampled subsystems are intentionally omitted.

Main entry points: [`sys/include/9p.h`](https://github.com/harvey-os/harvey/blob/main/sys/include/9p.h) (9P2000), [`sys/src/9/pc/main.c`](https://github.com/harvey-os/harvey/blob/main/sys/src/9/pc/main.c) (Platform startup), [`sys/src/9`](https://github.com/harvey-os/harvey/tree/main/sys/src/9) (Fossil), [`sys/src/9/port`](https://github.com/harvey-os/harvey/tree/main/sys/src/9/port) (Portable kernel)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_kernel["Kernel"]
  node_boot["Boot sequence"]
  node_portkernel["Portable kernel"]
  node_platform["Platform startup<br/>[main.c]"]
  node_ipstack["IP stack"]
end

subgraph group_services["System services"]
  node_ninep["9P2000<br/>[9p.h]"]
  node_fossil[("Fossil")]
  node_venti[("Venti")]
  node_factotum["Factotum"]
  node_replica["Replica"]
end

subgraph group_userland["Userland applications"]
  node_acme["Acme editor<br/>[main.c]"]
  node_mail["Mail client<br/>[mesg.c]"]
  node_news["News reader<br/>[news.c]"]
  node_wiki["Wiki<br/>[main.c]"]
end

subgraph group_commands["System commands"]
  node_ipconfig["IP configuration<br/>[main.c]"]
  node_spin["Spin verifier<br/>[main.c]"]
  node_lzip["Lzip compressor<br/>[main.c]"]
  node_cifs["CIFS client<br/>[main.c]"]
  node_vt["Terminal<br/>[main.c]"]
end

node_user(("User"))

node_user -.->|"uses"| node_acme
node_user -.->|"uses"| node_mail
node_user -.->|"uses"| node_news
node_user -.->|"uses"| node_wiki
node_boot -.->|"starts"| node_platform
node_platform -->|"initializes"| node_portkernel
node_platform -.->|"configures"| node_ipstack
node_ipconfig -->|"configures"| node_ipstack
node_portkernel -.->|"serves"| node_ninep
node_fossil -.->|"serves"| node_ninep
node_venti -.->|"supports"| node_fossil
node_factotum -.->|"authenticates"| node_ninep
node_replica -.->|"updates"| node_fossil
node_wiki -.->|"uses"| node_ninep

click node_boot "https://github.com/harvey-os/harvey/tree/main/sys/src/9/boot"
click node_portkernel "https://github.com/harvey-os/harvey/tree/main/sys/src/9/port"
click node_platform "https://github.com/harvey-os/harvey/blob/main/sys/src/9/pc/main.c"
click node_ipstack "https://github.com/harvey-os/harvey/tree/main/sys/src/9/ip"
click node_ninep "https://github.com/harvey-os/harvey/blob/main/sys/include/9p.h"
click node_fossil "https://github.com/harvey-os/harvey/tree/main/sys/src/9"
click node_venti "https://github.com/harvey-os/harvey/tree/main/sys/src/9"
click node_factotum "https://github.com/harvey-os/harvey/tree/main/sys/src/9"
click node_replica "https://github.com/harvey-os/harvey/tree/main/sys/src/9"
click node_acme "https://github.com/harvey-os/harvey/blob/main/acme/bin/source/win/main.c"
click node_mail "https://github.com/harvey-os/harvey/blob/main/acme/mail/src/mesg.c"
click node_news "https://github.com/harvey-os/harvey/blob/main/acme/news/src/news.c"
click node_wiki "https://github.com/harvey-os/harvey/blob/main/acme/wiki/src/main.c"
click node_ipconfig "https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/ip/ipconfig/main.c"
click node_spin "https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/spin/main.c"
click node_lzip "https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/lzip/main.c"
click node_cifs "https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/cifs/main.c"
click node_vt "https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/vt/main.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_boot,node_portkernel,node_platform,node_ipstack,node_user toneBlue
class node_ninep,node_fossil,node_venti,node_factotum,node_replica toneAmber
class node_acme,node_mail,node_news,node_wiki toneMint
class node_ipconfig,node_spin,node_lzip,node_cifs,node_vt toneRose
```

## Components

### Kernel

- [Boot sequence](https://github.com/harvey-os/harvey/tree/main/sys/src/9/boot): `sys/src/9/boot`
- [Portable kernel](https://github.com/harvey-os/harvey/tree/main/sys/src/9/port): `sys/src/9/port`
- [Platform startup](https://github.com/harvey-os/harvey/blob/main/sys/src/9/pc/main.c): `sys/src/9/pc/main.c`
- [IP stack](https://github.com/harvey-os/harvey/tree/main/sys/src/9/ip): `sys/src/9/ip`

### System services

- [9P2000](https://github.com/harvey-os/harvey/blob/main/sys/include/9p.h): `sys/include/9p.h`
- [Fossil](https://github.com/harvey-os/harvey/tree/main/sys/src/9): `sys/src/9`
- [Venti](https://github.com/harvey-os/harvey/tree/main/sys/src/9): `sys/src/9`
- [Factotum](https://github.com/harvey-os/harvey/tree/main/sys/src/9): `sys/src/9`
- [Replica](https://github.com/harvey-os/harvey/tree/main/sys/src/9): `sys/src/9`

### Userland applications

- [Acme editor](https://github.com/harvey-os/harvey/blob/main/acme/bin/source/win/main.c): `acme/bin/source/win/main.c`
- [Mail client](https://github.com/harvey-os/harvey/blob/main/acme/mail/src/mesg.c): `acme/mail/src/mesg.c`
- [News reader](https://github.com/harvey-os/harvey/blob/main/acme/news/src/news.c): `acme/news/src/news.c`
- [Wiki](https://github.com/harvey-os/harvey/blob/main/acme/wiki/src/main.c): `acme/wiki/src/main.c`

### System commands

- [IP configuration](https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/ip/ipconfig/main.c): `sys/src/cmd/ip/ipconfig/main.c`
- [Spin verifier](https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/spin/main.c): `sys/src/cmd/spin/main.c`
- [Lzip compressor](https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/lzip/main.c): `sys/src/cmd/lzip/main.c`
- [CIFS client](https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/cifs/main.c): `sys/src/cmd/cifs/main.c`
- [Terminal](https://github.com/harvey-os/harvey/blob/main/sys/src/cmd/vt/main.c): `sys/src/cmd/vt/main.c`

### Other components

- **User**

## Connections

- User → Acme editor: uses
- User → Mail client: uses
- User → News reader: uses
- User → Wiki: uses
- Boot sequence → Platform startup: starts
- Platform startup → Portable kernel: initializes (evidence: `sys/src/9/pc/main.c`)
- Platform startup → IP stack: configures
- IP configuration → IP stack: configures (evidence: `sys/src/cmd/ip/ipconfig/main.c`)
- Portable kernel → 9P2000: serves
- Fossil → 9P2000: serves (evidence: `README`)
- Venti → Fossil: supports (evidence: `README`)
- Factotum → 9P2000: authenticates (evidence: `README`)
- Replica → Fossil: updates (evidence: `README`)
- Wiki → 9P2000: uses
