# ps2dev/ps2sdk architecture

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

- Interactive diagram: https://gitdiagram.com/ps2dev/ps2sdk
- Repository: https://github.com/ps2dev/ps2sdk

## Overview

PS2SDK is a collection of libraries and loadable IOP modules for building PlayStation 2 applications. The principal workflow is an application using EE-side APIs and runtime support to access system functions and hardware services, with RPC libraries bridging to IOP modules where needed. The graph preserves the README’s major capabilities; some subsystem connections are documented at product level, while detailed wiring is shown only where supported by the sampled source. Paths identify representative implementation files.

Main entry points: [`ee/rpc/cdvd/src/libcdvd.c`](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/cdvd/src/libcdvd.c) (CD/DVD API), [`ee/rpc/hdd/src/libhdd.c`](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/hdd/src/libhdd.c) (HDD API), [`ee/rpc/memorycard/src/libmc.c`](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/memorycard/src/libmc.c) (Memory card API), [`ee/network/tcpip/src/ps2ip.c`](https://github.com/ps2dev/ps2sdk/blob/master/ee/network/tcpip/src/ps2ip.c) (TCP/IP stack)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ee["EE runtime"]
  node_kernel["Kernel API<br/>[glue.c]"]
  node_libc["Newlib glue<br/>[glue.c]"]
  node_graphics["Graphics APIs<br/>[draw.c]"]
  node_eeinput["Input APIs<br/>[libpad.c]"]
  node_sound["Sound RPC<br/>[ps2snd.c]"]
end

subgraph group_io["IOP services"]
end

subgraph group_storage["Storage and media"]
  node_cdvdapi["CD/DVD API<br/>[libcdvd.c]"]
  node_hddapi["HDD API<br/>[libhdd.c]"]
  node_mcapi["Memory card API<br/>[libmc.c]"]
  node_filexioapi["FileXio API<br/>[fileXio_rpc.c]"]
  node_cdvd["CD/DVD driver<br/>[cdvdman.c]"]
  node_cdfs["CD filesystem<br/>[main.c]"]
  node_apa["HDD partitions<br/>[apa.c]"]
  node_pfs["HDD filesystem<br/>[pfs.c]"]
  node_mcman["Memory card driver<br/>[main.c]"]
end

subgraph group_network["Networking"]
  node_tcpip["TCP/IP stack<br/>[ps2ip.c]"]
  node_netman["Network manager<br/>[netman.c]"]
  node_smap["Ethernet driver<br/>[main.c]"]
  node_httpfs["HTTP filesystem<br/>[ps2http.c]"]
  node_netfs["Host network FS<br/>[ps2netfs.c]"]
end

subgraph group_devices["Devices and tools"]
  node_usbinput["USB input drivers<br/>[padInit.c]"]
  node_debug["Debug services<br/>[main.c]"]
  node_romtool["ROM image tool<br/>[main.c]"]
end

node_app(("PS2 application"))

node_app -->|"uses system APIs"| node_kernel
node_app -->|"uses runtime"| node_libc
node_app -->|"renders graphics"| node_graphics
node_app -->|"reads controls"| node_eeinput
node_app -->|"requests audio"| node_sound
node_app -->|"accesses discs"| node_cdvdapi
node_app -->|"accesses HDD"| node_hddapi
node_app -->|"accesses cards"| node_mcapi
node_app -->|"uses file services"| node_filexioapi
node_app -->|"uses networking"| node_tcpip
node_cdvdapi -->|"RPC requests"| node_cdvd
node_cdfs -->|"reads disc sectors"| node_cdvd
node_hddapi -->|"HDD operations"| node_apa
node_pfs -->|"uses partitions"| node_apa
node_mcapi -->|"RPC requests"| node_mcman
node_tcpip -->|"sends and receives"| node_smap
node_smap -.->|"registers network device"| node_netman
node_app -->|"loads HTTP files"| node_httpfs
node_app -->|"loads host files"| node_netfs
node_app -->|"uses USB devices"| node_usbinput
node_app -.->|"uses debugging"| node_debug
node_app -.->|"prepares ROM images"| node_romtool

click node_kernel "https://github.com/ps2dev/ps2sdk/blob/master/ee/kernel/src/glue.c"
click node_libc "https://github.com/ps2dev/ps2sdk/blob/master/ee/libcglue/src/glue.c"
click node_graphics "https://github.com/ps2dev/ps2sdk/blob/master/ee/draw/src/draw.c"
click node_eeinput "https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/pad/src/libpad.c"
click node_sound "https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/ps2snd/src/ps2snd.c"
click node_cdvdapi "https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/cdvd/src/libcdvd.c"
click node_hddapi "https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/hdd/src/libhdd.c"
click node_mcapi "https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/memorycard/src/libmc.c"
click node_filexioapi "https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/filexio/src/fileXio_rpc.c"
click node_cdvd "https://github.com/ps2dev/ps2sdk/blob/master/iop/cdvd/cdvdman/src/cdvdman.c"
click node_cdfs "https://github.com/ps2dev/ps2sdk/blob/master/iop/cdvd/cdfs/src/main.c"
click node_apa "https://github.com/ps2dev/ps2sdk/blob/master/iop/hdd/libapa/src/apa.c"
click node_pfs "https://github.com/ps2dev/ps2sdk/blob/master/iop/hdd/pfs/src/pfs.c"
click node_mcman "https://github.com/ps2dev/ps2sdk/blob/master/iop/memorycard/mcman/src/main.c"
click node_tcpip "https://github.com/ps2dev/ps2sdk/blob/master/ee/network/tcpip/src/ps2ip.c"
click node_netman "https://github.com/ps2dev/ps2sdk/blob/master/iop/network/netman/src/netman.c"
click node_smap "https://github.com/ps2dev/ps2sdk/blob/master/iop/network/smap/src/main.c"
click node_httpfs "https://github.com/ps2dev/ps2sdk/blob/master/iop/fs/http/src/ps2http.c"
click node_netfs "https://github.com/ps2dev/ps2sdk/blob/master/iop/fs/netfs/src/ps2netfs.c"
click node_usbinput "https://github.com/ps2dev/ps2sdk/blob/master/iop/input/padman/src/padInit.c"
click node_debug "https://github.com/ps2dev/ps2sdk/blob/master/iop/debug/iopdebug/src/main.c"
click node_romtool "https://github.com/ps2dev/ps2sdk/blob/master/tools/romimg/src/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_kernel,node_libc,node_graphics,node_eeinput,node_sound toneBlue
class node_cdvdapi,node_hddapi,node_mcapi,node_filexioapi,node_cdvd,node_cdfs,node_apa,node_pfs,node_mcman toneMint
class node_tcpip,node_netman,node_smap,node_httpfs,node_netfs toneRose
class node_usbinput,node_debug,node_romtool,node_app toneIndigo
```

## Components

### EE runtime

- [Kernel API](https://github.com/ps2dev/ps2sdk/blob/master/ee/kernel/src/glue.c): `ee/kernel/src/glue.c`
- [Newlib glue](https://github.com/ps2dev/ps2sdk/blob/master/ee/libcglue/src/glue.c): `ee/libcglue/src/glue.c`
- [Graphics APIs](https://github.com/ps2dev/ps2sdk/blob/master/ee/draw/src/draw.c): `ee/draw/src/draw.c`
- [Input APIs](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/pad/src/libpad.c): `ee/rpc/pad/src/libpad.c`
- [Sound RPC](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/ps2snd/src/ps2snd.c): `ee/rpc/ps2snd/src/ps2snd.c`

### Storage and media

- [CD/DVD API](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/cdvd/src/libcdvd.c): `ee/rpc/cdvd/src/libcdvd.c`
- [HDD API](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/hdd/src/libhdd.c): `ee/rpc/hdd/src/libhdd.c`
- [Memory card API](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/memorycard/src/libmc.c): `ee/rpc/memorycard/src/libmc.c`
- [FileXio API](https://github.com/ps2dev/ps2sdk/blob/master/ee/rpc/filexio/src/fileXio_rpc.c): `ee/rpc/filexio/src/fileXio_rpc.c`
- [CD/DVD driver](https://github.com/ps2dev/ps2sdk/blob/master/iop/cdvd/cdvdman/src/cdvdman.c): `iop/cdvd/cdvdman/src/cdvdman.c`
- [CD filesystem](https://github.com/ps2dev/ps2sdk/blob/master/iop/cdvd/cdfs/src/main.c): `iop/cdvd/cdfs/src/main.c`
- [HDD partitions](https://github.com/ps2dev/ps2sdk/blob/master/iop/hdd/libapa/src/apa.c): `iop/hdd/libapa/src/apa.c`
- [HDD filesystem](https://github.com/ps2dev/ps2sdk/blob/master/iop/hdd/pfs/src/pfs.c): `iop/hdd/pfs/src/pfs.c`
- [Memory card driver](https://github.com/ps2dev/ps2sdk/blob/master/iop/memorycard/mcman/src/main.c): `iop/memorycard/mcman/src/main.c`

### Networking

- [TCP/IP stack](https://github.com/ps2dev/ps2sdk/blob/master/ee/network/tcpip/src/ps2ip.c): `ee/network/tcpip/src/ps2ip.c`
- [Network manager](https://github.com/ps2dev/ps2sdk/blob/master/iop/network/netman/src/netman.c): `iop/network/netman/src/netman.c`
- [Ethernet driver](https://github.com/ps2dev/ps2sdk/blob/master/iop/network/smap/src/main.c): `iop/network/smap/src/main.c`
- [HTTP filesystem](https://github.com/ps2dev/ps2sdk/blob/master/iop/fs/http/src/ps2http.c): `iop/fs/http/src/ps2http.c`
- [Host network FS](https://github.com/ps2dev/ps2sdk/blob/master/iop/fs/netfs/src/ps2netfs.c): `iop/fs/netfs/src/ps2netfs.c`

### Devices and tools

- [USB input drivers](https://github.com/ps2dev/ps2sdk/blob/master/iop/input/padman/src/padInit.c): `iop/input/padman/src/padInit.c`
- [Debug services](https://github.com/ps2dev/ps2sdk/blob/master/iop/debug/iopdebug/src/main.c): `iop/debug/iopdebug/src/main.c`
- [ROM image tool](https://github.com/ps2dev/ps2sdk/blob/master/tools/romimg/src/main.c): `tools/romimg/src/main.c`

### Other components

- **PS2 application**

## Connections

- PS2 application → Kernel API: uses system APIs
- PS2 application → Newlib glue: uses runtime
- PS2 application → Graphics APIs: renders graphics
- PS2 application → Input APIs: reads controls
- PS2 application → Sound RPC: requests audio
- PS2 application → CD/DVD API: accesses discs
- PS2 application → HDD API: accesses HDD
- PS2 application → Memory card API: accesses cards
- PS2 application → FileXio API: uses file services
- PS2 application → TCP/IP stack: uses networking
- CD/DVD API → CD/DVD driver: RPC requests
- CD filesystem → CD/DVD driver: reads disc sectors
- HDD API → HDD partitions: HDD operations
- HDD filesystem → HDD partitions: uses partitions
- Memory card API → Memory card driver: RPC requests
- TCP/IP stack → Ethernet driver: sends and receives
- Ethernet driver → Network manager: registers network device
- PS2 application → HTTP filesystem: loads HTTP files
- PS2 application → Host network FS: loads host files
- PS2 application → USB input drivers: uses USB devices
- PS2 application → Debug services: uses debugging
- PS2 application → ROM image tool: prepares ROM images
