{"id":50537227,"url":"https://github.com/zhenruyan/zenstates-go","last_synced_at":"2026-06-03T17:30:39.655Z","repository":{"id":355664924,"uuid":"1229058119","full_name":"zhenruyan/zenstates-go","owner":"zhenruyan","description":"AMD Ryzen processor overclocking toolkit — rewritten in Go with beautiful terminal display.","archived":false,"fork":false,"pushed_at":"2026-05-04T17:14:11.000Z","size":20,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-04T19:13:03.271Z","etag":null,"topics":["amd","overclocking","zenstates"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhenruyan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-04T16:52:30.000Z","updated_at":"2026-05-04T17:14:15.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zhenruyan/zenstates-go","commit_stats":null,"previous_names":["zhenruyan/zenstates-go"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zhenruyan/zenstates-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenruyan%2Fzenstates-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenruyan%2Fzenstates-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenruyan%2Fzenstates-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenruyan%2Fzenstates-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhenruyan","download_url":"https://codeload.github.com/zhenruyan/zenstates-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhenruyan%2Fzenstates-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33876327,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amd","overclocking","zenstates"],"created_at":"2026-06-03T17:30:38.487Z","updated_at":"2026-06-03T17:30:39.646Z","avatar_url":"https://github.com/zhenruyan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ZenStates-Linux (Go Edition)\n\nAMD Ryzen processor overclocking toolkit — rewritten in Go with beautiful terminal display.\n\n```\n.\n├── go.mod\n├── Makefile\n├── cmd/\n│   ├── zenstates/              # P-State management tool\n│   └── togglecode/             # ASUS Q-Code display toggle\n├── internal/\n│   ├── display/                # 🎨 Terminal display (tables/colors/icons)\n│   ├── msr/                    # MSR register read/write\n│   └── pstate/                 # P-State parsing \u0026 bit manipulation\n├── README.md                   # English documentation\n├── README_zh.md                # 中文文档\n└── ...\n```\n\n## Build\n\n```bash\nmake                    # Build all tools\nsudo make install       # Install to /usr/local/bin\n```\n\n## zenstates — AMD Ryzen P-State Editor\n\nRequires root and the `msr` kernel module: `sudo modprobe msr`\n\n### Output Preview\n\n```\n  AMD Ryzen P-States\n\n┌─────────┬──────────────┬─────┬─────┬─────┬──────────┬───────────────┐\n│ P-State │ Status       │ FID │ DID │ VID │ Frequency │ vCore         │\n├─────────┼──────────────┼─────┼─────┼─────┼──────────┼───────────────┤\n│ P0      │ ● Enabled    │ 152 │ 8   │ 32  │ 3800 MHz │ 1.35000 V     │\n│ P1      │ ○ Disabled   │ --  │ --  │ --  │    --    │    --         │\n│ P2      │ ● Enabled    │ 132 │ 12  │ 104 │ 3500 MHz │ 0.90000 V     │\n│ P3      │ ○ Disabled   │ --  │ --  │ --  │    --    │    --         │\n│ P4      │ ○ Disabled   │ --  │ --  │ --  │    --    │    --         │\n│ P5      │ ○ Disabled   │ --  │ --  │ --  │    --    │    --         │\n│ P6      │ ○ Disabled   │ --  │ --  │ --  │    --    │    --         │\n│ P7      │ ○ Disabled   │ --  │ --  │ --  │    --    │    --         │\n└─────────┴──────────────┴─────┴─────┴─────┴──────────┴───────────────┘\n\n  C6 State\n    Package  ●  Enabled\n    Core     ●  Enabled\n```\n\nDiff display when modifying a P-State:\n\n```\n  P0 Changes\n\n┌───────────┬────────────────────┬────────────────────┐\n│ Field     │ Before             │ After              │\n├───────────┼────────────────────┼────────────────────┤\n│ Frequency │ 3800 MHz           │ 3900 MHz           │\n│ vCore     │ 1.35000 V          │ 1.30000 V          │\n└───────────┴────────────────────┴────────────────────┘\n```\n\n### Usage\n\n```\n  ZenStates-Linux — AMD Ryzen P-State Editor\n  Dynamically edit AMD Ryzen processor P-States via MSR\n\n  Usage: zenstates [options]\n\n  Options:\n    -l              List all P-States\n    -p \u003c0-7\u003e        P-State to set\n    --enable        Enable P-State\n    --disable       Disable P-State\n\n    --freq \u003cMHz\u003e    Target frequency (e.g. 3800)         ← NEW! direct freq setting\n    --voltage \u003cV\u003e   Target core voltage (e.g. 1.35)      ← NEW! direct voltage setting\n\n    -f \u003cval\u003e        FID to set (legacy, decimal)\n    -d \u003cval\u003e        DID to set (legacy, decimal)\n    -v \u003cval\u003e        VID to set (legacy, decimal)\n\n    --c6-enable     Enable C-State C6\n    --c6-disable    Disable C-State C6\n    --no-color      Disable colored output\n    --governor \u003cg\u003e  Set CPU frequency governor (performance/powersave/...)\n\n  Examples:\n    zenstates -l                                # List all P-States\n    zenstates -p 0 --freq 3800 --voltage 1.35   # P0: 3800MHz, 1.3500V\n    zenstates -p 1 --disable                   # Disable P1\n    zenstates -p 0 -f 152 -d 8 -v 32           # Legacy: FID/DID/VID\n    zenstates --governor performance            # Set CPU governor\n```\n\n### Examples\n\n```bash\n# List all P-States\nsudo ./bin/zenstates -l\n\n# Set P0 to 3800MHz @ 1.3500V (recommended)\nsudo ./bin/zenstates -p 0 --freq 3800 --voltage 1.35\n\n# Disable P1\nsudo ./bin/zenstates -p 1 --disable\n\n# Enable C6\nsudo ./bin/zenstates --c6-enable\n\n# Set CPU governor\nsudo ./bin/zenstates --governor performance\n\n# Legacy: set FID/DID/VID directly\nsudo ./bin/zenstates -p 0 -f 152 -d 8 -v 32\n\n# Set CPU governor to performance\nsudo ./bin/zenstates --governor performance\n```\n\n## togglecode — ASUS Q-Code Display Toggle\n\nToggle the Q-Code display on ASUS Crosshair VI Hero and other boards with a compatible Super I/O chip.\n\n```\n  ASUS Q-Code Display Toggle\n  Super I/O: 0x2E/0x2F · GPIO LD7 · Reg 0xF0\n\n  • Entering Super I/O config mode...\n  • Selecting GPIO logical device (LD7)...\n  • Reading GPIO register 0xF0...\n  • Current state: Q-Code = ON (0xF0 = 0x48, bit3=1)\n  • Toggling bit 3...\n\n  ✔ Q-Code display toggled successfully!\n\n  • Q-Code: ON → OFF\n  • Reg 0xF0: 0x48 → 0x40  (bit3: 1→0)\n```\n\n## Display Features\n\n| Feature | Description |\n|---------|------------|\n| **Color output** | Auto-detects terminal, ANSI colors |\n| **Unicode icons** | ✔ ✘ ● ○ ▶ • status indicators |\n| **Box-drawing tables** | ┌─┐│└┘ Unicode table borders |\n| **Diff view** | Before/after comparison when modifying P-States |\n| **Direct freq/voltage** | `--freq 3800 --voltage 1.35` auto-calculates FID/DID/VID |\n| **CPU governor** | `--governor performance` — set frequency scaling governor |\n| **No-color mode** | `--no-color` flag, auto-disable on pipe/redirect |\n| **Auto fallback** | Removes ANSI codes when output is piped to a file |\n\n## Frequency Table (DID=8)\n\n| FID | Frequency (MHz) |\n|-----|----------------|\n| 144 | 3600           |\n| 148 | 3700           |\n| 152 | 3800           |\n| 156 | 3900           |\n| 160 | 4000           |\n| 164 | 4100           |\n\n## Voltage Table\n\n| VID | Voltage (V) |\n|-----|------------|\n| 48  | 1.2500     |\n| 40  | 1.3000     |\n| 32  | 1.3500     |\n| 24  | 1.4000     |\n| 16  | 1.4500     |\n\n## Differences from Python Original\n\n| Aspect | Python Version | Go Version |\n|--------|---------------|------------|\n| **Number format** | Hexadecimal I/O | **Decimal I/O** |\n| **Display** | Plain text | **Color table + Unicode icons + Diff view** |\n| **High-level API** | — | **`--freq` / `--voltage`** auto calculation |\n| **MSR I/O** | `os.lseek/read/write` | `os.File.ReadAt/WriteAt` + binary |\n| **Bit ops** | Global `setbits()` | `pstate.PState` method chain |\n| **Port I/O** | `portio` + `iopl(3)` | `/dev/port` file operations |\n| **CPU governor** | ✘ Not available | **`--governor` — set frequency scaling policy** |\n| **Deployment** | Python + dependencies | **Static single binary**, zero dependencies |\n\n## Credits\n\nThis Go port is based on the original **[ZenStates-Linux](https://github.com/r4m0n/ZenStates-Linux)** Python project by [r4m0n](https://github.com/r4m0n).\n\n- `zenstates.py` — Original P-State editing tool\n- `togglecode.py` — Original ASUS Q-Code toggle script\n\nThank you for the foundational work on AMD Ryzen overclocking utilities!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhenruyan%2Fzenstates-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhenruyan%2Fzenstates-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhenruyan%2Fzenstates-go/lists"}