# calmsacibis995/svr4-src architecture

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

- Interactive diagram: https://gitdiagram.com/calmsacibis995/svr4-src
- Repository: https://github.com/calmsacibis995/svr4-src

## Overview

This repository is the source tree for UNIX System V Release 4 Version 3: an operating system kernel plus user commands and system utilities. A principal user workflow is entering a shell, which initializes the session and reads profile files before accepting commands; the wider tree also includes administration, development, networking, and diagnostic tools. The graph highlights sampled runtime areas rather than attempting to map the full source tree. Relationships are limited to those visible in excerpts or the source index; unsampled subsystems are shown without inferred call links.

Main entry points: [`cmd/sh/main.c`](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sh/main.c) (Bourne shell), [`cmd/sh/defs.h`](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sh/defs.h) (Shell definitions), [`cmd/ksh/sh/main.c`](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/ksh/sh/main.c) (Korn shell), [`cmd/awk/main.c`](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/awk/main.c) (AWK interpreter)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_userland["User environments"]
  node_sh["Bourne shell<br/>[main.c]"]
  node_sh_defs["Shell definitions<br/>[defs.h]"]
  node_ksh["Korn shell<br/>[main.c]"]
  node_fmli["FMLI interface<br/>[main.c]"]
  node_awk["AWK interpreter<br/>[main.c]"]
  node_awk_defs["AWK definitions<br/>[awk.h]"]
end

subgraph group_kernel["Kernel runtime"]
  node_kernel_start["Kernel startup<br/>[main.c]"]
  node_kernel_headers["Kernel interfaces"]
end

subgraph group_utilities["System utilities"]
  node_truss["Process tracer<br/>[main.c]"]
  node_crash["Crash debugger<br/>[main.c]"]
  node_make["Build orchestrator<br/>[main.c]"]
  node_cscope["Code browser<br/>[main.c]"]
  node_mcs["ELF modifier<br/>[main.c]"]
  node_mail["Mail command<br/>[main.c]"]
  node_mail_defs["Mail definitions<br/>[mail.h]"]
  node_sendmail["Mail transport<br/>[main.c]"]
  node_sendmail_defs["Transport definitions<br/>[sendmail.h]"]
end

subgraph group_network["Networking"]
  node_ftp["FTP client<br/>[main.c]"]
  node_tftp["TFTP client<br/>[main.c]"]
end

node_user(("User"))

node_user -.->|"starts session"| node_sh
node_sh -->|"includes"| node_sh_defs
node_ksh -->|"includes"| node_sh_defs
node_awk -->|"includes"| node_awk_defs
node_kernel_start -->|"uses interfaces"| node_kernel_headers
node_mail -->|"includes"| node_mail_defs
node_sendmail -->|"includes"| node_sendmail_defs

click node_sh "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sh/main.c"
click node_sh_defs "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sh/defs.h"
click node_ksh "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/ksh/sh/main.c"
click node_fmli "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/fmli/xx/main.c"
click node_awk "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/awk/main.c"
click node_awk_defs "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/awk/awk.h"
click node_kernel_start "https://github.com/calmsacibis995/svr4-src/blob/main/uts/i386/os/main.c"
click node_kernel_headers "https://github.com/calmsacibis995/svr4-src/tree/main/uts/i386/sys"
click node_truss "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/truss/main.c"
click node_crash "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/crash/main.c"
click node_make "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/make/main.c"
click node_cscope "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/cscope/common/main.c"
click node_mcs "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sgs/mcs/common/main.c"
click node_mail "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/mail/main.c"
click node_mail_defs "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/mail/mail.h"
click node_sendmail "https://github.com/calmsacibis995/svr4-src/blob/main/ucbcmd/sendmail/src/main.c"
click node_sendmail_defs "https://github.com/calmsacibis995/svr4-src/blob/main/ucbcmd/sendmail/src/sendmail.h"
click node_ftp "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/cmd-inet/usr.bin/ftp/main.c"
click node_tftp "https://github.com/calmsacibis995/svr4-src/blob/main/cmd/cmd-inet/usr.bin/tftp/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_sh,node_sh_defs,node_ksh,node_fmli,node_awk,node_awk_defs,node_user toneBlue
class node_kernel_start,node_kernel_headers toneAmber
class node_truss,node_crash,node_make,node_cscope,node_mcs,node_mail,node_mail_defs,node_sendmail,node_sendmail_defs toneMint
class node_ftp,node_tftp toneRose
```

## Components

### User environments

- [Bourne shell](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sh/main.c): `cmd/sh/main.c`
- [Shell definitions](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sh/defs.h): `cmd/sh/defs.h`
- [Korn shell](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/ksh/sh/main.c): `cmd/ksh/sh/main.c`
- [FMLI interface](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/fmli/xx/main.c): `cmd/fmli/xx/main.c`
- [AWK interpreter](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/awk/main.c): `cmd/awk/main.c`
- [AWK definitions](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/awk/awk.h): `cmd/awk/awk.h`

### Kernel runtime

- [Kernel startup](https://github.com/calmsacibis995/svr4-src/blob/main/uts/i386/os/main.c): `uts/i386/os/main.c`
- [Kernel interfaces](https://github.com/calmsacibis995/svr4-src/tree/main/uts/i386/sys): `uts/i386/sys`

### System utilities

- [Process tracer](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/truss/main.c): `cmd/truss/main.c`
- [Crash debugger](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/crash/main.c): `cmd/crash/main.c`
- [Build orchestrator](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/make/main.c): `cmd/make/main.c`
- [Code browser](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/cscope/common/main.c): `cmd/cscope/common/main.c`
- [ELF modifier](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/sgs/mcs/common/main.c): `cmd/sgs/mcs/common/main.c`
- [Mail command](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/mail/main.c): `cmd/mail/main.c`
- [Mail definitions](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/mail/mail.h): `cmd/mail/mail.h`
- [Mail transport](https://github.com/calmsacibis995/svr4-src/blob/main/ucbcmd/sendmail/src/main.c): `ucbcmd/sendmail/src/main.c`
- [Transport definitions](https://github.com/calmsacibis995/svr4-src/blob/main/ucbcmd/sendmail/src/sendmail.h): `ucbcmd/sendmail/src/sendmail.h`

### Networking

- [FTP client](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/cmd-inet/usr.bin/ftp/main.c): `cmd/cmd-inet/usr.bin/ftp/main.c`
- [TFTP client](https://github.com/calmsacibis995/svr4-src/blob/main/cmd/cmd-inet/usr.bin/tftp/main.c): `cmd/cmd-inet/usr.bin/tftp/main.c`

### Other components

- **User**

## Connections

- User → Bourne shell: starts session
- Bourne shell → Shell definitions: includes (evidence: `cmd/sh/main.c`)
- Korn shell → Shell definitions: includes (evidence: `cmd/ksh/sh/main.c`)
- AWK interpreter → AWK definitions: includes (evidence: `cmd/awk/main.c`)
- Kernel startup → Kernel interfaces: uses interfaces (evidence: `uts/i386/os/main.c`)
- Mail command → Mail definitions: includes (evidence: `cmd/mail/main.c`)
- Mail transport → Transport definitions: includes (evidence: `ucbcmd/sendmail/src/main.c`)
