# lopm123456789-max/krafton_jungle_pintos_threads architecture

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

- Interactive diagram: https://gitdiagram.com/lopm123456789-max/krafton_jungle_pintos_threads
- Repository: https://github.com/lopm123456789-max/krafton_jungle_pintos_threads

## Overview

Pintos is a 64-bit x86-64 teaching operating system. Its principal user-to-result path is a user program making a system call, with process management loading executable files and virtual memory managing user pages; threads schedule execution and interrupts connect kernel services to hardware. The tree also contains filesystem, device, and VM subsystems. Several implementation files are unsampled, so their documented roles are represented, but uncertain internal links are omitted rather than inferred.

Main entry points: [`pintos/vm/vm.c`](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/vm.c) (VM Manager), [`pintos/filesys/filesys.c`](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/filesys.c) (Filesystem API), [`pintos/userprog/process.c`](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/process.c) (Process Loader), [`pintos/devices/disk.c`](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/disk.c) (Disk Driver)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_userprog["User Processes"]
  node_syscall["System Calls<br/>[syscall.c]"]
  node_process["Process Loader<br/>[process.c]"]
  node_exception["Exceptions<br/>[exception.c]"]
  node_gdt["CPU Descriptors<br/>[gdt.c]"]
end

subgraph group_threads["Kernel Core"]
  node_thread["Thread Scheduler<br/>[thread.c]"]
  node_interrupt["Interrupt Dispatch<br/>[interrupt.c]"]
  node_sync["Synchronization<br/>[synch.c]"]
  node_palloc["Page Allocator<br/>[palloc.c]"]
end

subgraph group_vm["Virtual Memory"]
  node_vm["VM Manager<br/>[vm.c]"]
  node_anon["Anonymous Pages<br/>[anon.c]"]
  node_filepage["File-backed Pages<br/>[file.c]"]
  node_uninit["Lazy Pages<br/>[uninit.c]"]
  node_inspect["VM Inspection<br/>[inspect.c]"]
end

subgraph group_filesys["File System"]
  node_filesys["Filesystem API<br/>[filesys.c]"]
  node_directory["Directories<br/>[directory.c]"]
  node_inode["Inodes<br/>[inode.c]"]
  node_fat["FAT Allocation<br/>[fat.c]"]
  node_cache["Page Cache<br/>[page_cache.c]"]
end

subgraph group_devices["Devices"]
  node_disk["Disk Driver<br/>[disk.c]"]
  node_timer["Timer Driver<br/>[timer.c]"]
  node_serial["Serial I/O<br/>[serial.c]"]
end

node_user(("User Program"))
node_hardware{{"x86 Hardware"}}

node_user -.->|"invokes"| node_syscall
node_syscall -.->|"dispatches"| node_process
node_process -->|"opens executable"| node_filesys
node_process -->|"configures address space"| node_vm
node_process -->|"creates process thread"| node_thread
node_exception -->|"registers handlers"| node_interrupt
node_thread -->|"uses interrupt state"| node_interrupt
node_thread -->|"uses synchronization"| node_sync
node_thread -->|"allocates pages"| node_palloc
node_process -->|"configures user context"| node_gdt
node_vm -.->|"allocates frames"| node_palloc
node_vm -.->|"dispatches page operations"| node_anon
node_vm -.->|"dispatches page operations"| node_filepage
node_vm -->|"initializes pages"| node_uninit
node_vm -->|"supports inspection"| node_inspect
node_directory -->|"uses filesystem API"| node_filesys
node_directory -->|"uses inode operations"| node_inode
node_inode -->|"uses filesystem state"| node_filesys
node_fat -->|"accesses sectors"| node_disk
node_fat -->|"uses filesystem state"| node_filesys
node_filesys -.->|"routes directory work"| node_directory
node_filesys -.->|"routes file work"| node_inode
node_filepage -.->|"uses cached pages"| node_cache
node_disk -->|"registers completion handler"| node_interrupt
node_disk -->|"waits for completion"| node_sync
node_disk -->|"waits during detection"| node_timer
node_timer -->|"registers timer interrupt"| node_interrupt
node_serial -->|"registers serial interrupts"| node_interrupt
node_disk -->|"issues disk I/O"| node_hardware
node_timer -->|"programs timer"| node_hardware
node_serial -->|"accesses serial ports"| node_hardware

click node_syscall "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/syscall.c"
click node_process "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/process.c"
click node_exception "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/exception.c"
click node_gdt "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/gdt.c"
click node_thread "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/thread.c"
click node_interrupt "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/interrupt.c"
click node_sync "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/synch.c"
click node_palloc "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/palloc.c"
click node_vm "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/vm.c"
click node_anon "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/anon.c"
click node_filepage "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/file.c"
click node_uninit "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/uninit.c"
click node_inspect "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/inspect.c"
click node_filesys "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/filesys.c"
click node_directory "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/directory.c"
click node_inode "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/inode.c"
click node_fat "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/fat.c"
click node_cache "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/page_cache.c"
click node_disk "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/disk.c"
click node_timer "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/timer.c"
click node_serial "https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/serial.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_syscall,node_process,node_exception,node_gdt,node_user toneBlue
class node_thread,node_interrupt,node_sync,node_palloc toneAmber
class node_vm,node_anon,node_filepage,node_uninit,node_inspect toneMint
class node_filesys,node_directory,node_inode,node_fat,node_cache toneRose
class node_disk,node_timer,node_serial,node_hardware toneIndigo
```

## Components

### User Processes

- [System Calls](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/syscall.c): `pintos/userprog/syscall.c`
- [Process Loader](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/process.c): `pintos/userprog/process.c`
- [Exceptions](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/exception.c): `pintos/userprog/exception.c`
- [CPU Descriptors](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/userprog/gdt.c): `pintos/userprog/gdt.c`

### Kernel Core

- [Thread Scheduler](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/thread.c): `pintos/threads/thread.c`
- [Interrupt Dispatch](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/interrupt.c): `pintos/threads/interrupt.c`
- [Synchronization](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/synch.c): `pintos/threads/synch.c`
- [Page Allocator](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/threads/palloc.c): `pintos/threads/palloc.c`

### Virtual Memory

- [VM Manager](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/vm.c): `pintos/vm/vm.c`
- [Anonymous Pages](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/anon.c): `pintos/vm/anon.c`
- [File-backed Pages](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/file.c): `pintos/vm/file.c`
- [Lazy Pages](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/uninit.c): `pintos/vm/uninit.c`
- [VM Inspection](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/vm/inspect.c): `pintos/vm/inspect.c`

### File System

- [Filesystem API](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/filesys.c): `pintos/filesys/filesys.c`
- [Directories](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/directory.c): `pintos/filesys/directory.c`
- [Inodes](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/inode.c): `pintos/filesys/inode.c`
- [FAT Allocation](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/fat.c): `pintos/filesys/fat.c`
- [Page Cache](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/filesys/page_cache.c): `pintos/filesys/page_cache.c`

### Devices

- [Disk Driver](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/disk.c): `pintos/devices/disk.c`
- [Timer Driver](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/timer.c): `pintos/devices/timer.c`
- [Serial I/O](https://github.com/lopm123456789-max/krafton_jungle_pintos_threads/blob/main/pintos/devices/serial.c): `pintos/devices/serial.c`

### Other components

- **User Program**
- **x86 Hardware**

## Connections

- User Program → System Calls: invokes
- System Calls → Process Loader: dispatches
- Process Loader → Filesystem API: opens executable (evidence: `pintos/userprog/process.c`)
- Process Loader → VM Manager: configures address space (evidence: `pintos/userprog/process.c`)
- Process Loader → Thread Scheduler: creates process thread (evidence: `pintos/threads/thread.c`)
- Exceptions → Interrupt Dispatch: registers handlers (evidence: `pintos/userprog/exception.c`)
- Thread Scheduler → Interrupt Dispatch: uses interrupt state (evidence: `pintos/threads/thread.c`)
- Thread Scheduler → Synchronization: uses synchronization (evidence: `pintos/threads/thread.c`)
- Thread Scheduler → Page Allocator: allocates pages (evidence: `pintos/threads/thread.c`)
- Process Loader → CPU Descriptors: configures user context (evidence: `pintos/userprog/process.c`)
- VM Manager → Page Allocator: allocates frames
- VM Manager → Anonymous Pages: dispatches page operations
- VM Manager → File-backed Pages: dispatches page operations
- VM Manager → Lazy Pages: initializes pages (evidence: `pintos/vm/uninit.c`)
- VM Manager → VM Inspection: supports inspection (evidence: `pintos/vm/vm.c`)
- Directories → Filesystem API: uses filesystem API (evidence: `pintos/filesys/directory.c`)
- Directories → Inodes: uses inode operations (evidence: `pintos/filesys/directory.c`)
- Inodes → Filesystem API: uses filesystem state (evidence: `pintos/filesys/inode.c`)
- FAT Allocation → Disk Driver: accesses sectors (evidence: `pintos/filesys/fat.c`)
- FAT Allocation → Filesystem API: uses filesystem state (evidence: `pintos/filesys/fat.c`)
- Filesystem API → Directories: routes directory work
- Filesystem API → Inodes: routes file work
- File-backed Pages → Page Cache: uses cached pages
- Disk Driver → Interrupt Dispatch: registers completion handler (evidence: `pintos/devices/disk.c`)
- Disk Driver → Synchronization: waits for completion (evidence: `pintos/devices/disk.c`)
- Disk Driver → Timer Driver: waits during detection (evidence: `pintos/devices/disk.c`)
- Timer Driver → Interrupt Dispatch: registers timer interrupt (evidence: `pintos/devices/timer.c`)
- Serial I/O → Interrupt Dispatch: registers serial interrupts (evidence: `pintos/devices/serial.c`)
- Disk Driver → x86 Hardware: issues disk I/O (evidence: `pintos/devices/disk.c`)
- Timer Driver → x86 Hardware: programs timer (evidence: `pintos/devices/timer.c`)
- Serial I/O → x86 Hardware: accesses serial ports (evidence: `pintos/devices/serial.c`)
