%%{init: {'theme':'base','themeVariables':{'primaryColor':'#3c3836','primaryTextColor':'#fbf1c7','primaryBorderColor':'#fe8019','lineColor':'#fabd2f','secondaryColor':'#504945','tertiaryColor':'#282828','background':'#282828','mainBkg':'#3c3836','secondBkg':'#504945'}}}%% flowchart LR U[User] -->|keystroke| TE[Terminal Emulator] TE -->|pty| TTY[TTY Device] TTY -->|stdin| SH[Shell bash/zsh/fish] SH -->|fork exec| K[Linux Kernel] K -->|stdout| TTY TTY -->|pixel| TE style U fill:#458588,stroke:#83a598,color:#fbf1c7 style TE fill:#689d6a,stroke:#8ec07c,color:#fbf1c7 style TTY fill:#d79921,stroke:#fabd2f,color:#282828 style SH fill:#b16286,stroke:#d3869b,color:#fbf1c7 style K fill:#cc241d,stroke:#fb4934,color:#fbf1c7
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#3c3836','primaryTextColor':'#fbf1c7','primaryBorderColor':'#fe8019','lineColor':'#fabd2f','secondaryColor':'#504945','background':'#282828'}}}%% flowchart LR subgraph HL[Hard Link] HA[file.txt] --> I1[inode 1234 ข้อมูลจริง] HB[backup.txt] --> I1 end subgraph SL[Symbolic Link] SA[link.txt] -->|path string| SB[original.txt] SB --> I2[inode 5678 ข้อมูลจริง] end style HA fill:#98971a,stroke:#b8bb26,color:#282828 style HB fill:#98971a,stroke:#b8bb26,color:#282828 style I1 fill:#d79921,stroke:#fabd2f,color:#282828 style SA fill:#458588,stroke:#83a598,color:#fbf1c7 style SB fill:#b16286,stroke:#d3869b,color:#fbf1c7
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#3c3836','primaryTextColor':'#fbf1c7','primaryBorderColor':'#fe8019','lineColor':'#fabd2f','background':'#282828'}}}%% flowchart LR IN[stdin fd=0] -->|<| P((Process)) P -->|>| OUT[stdout fd=1] P -->|2>| ERR[stderr fd=2] style IN fill:#98971a,stroke:#b8bb26,color:#282828 style P fill:#d79921,stroke:#fabd2f,color:#282828 style OUT fill:#458588,stroke:#83a598,color:#fbf1c7 style ERR fill:#cc241d,stroke:#fb4934,color:#fbf1c7
%%{init: {'theme':'base','themeVariables':{'primaryColor':'#3c3836','primaryTextColor':'#fbf1c7','primaryBorderColor':'#fe8019','lineColor':'#fabd2f','background':'#282828'}}}%% stateDiagram-v2 [*] --> NEW: fork() NEW --> READY: admitted READY --> RUNNING: scheduler dispatch RUNNING --> READY: timer / preempt RUNNING --> WAITING: I/O event WAITING --> READY: I/O เสร็จ RUNNING --> STOPPED: SIGSTOP / SIGTSTP STOPPED --> READY: SIGCONT RUNNING --> TERMINATED: exit() / SIGKILL TERMINATED --> [*]