Skip to content

feat: real CPU detection for /proc/cpuinfo#169

Merged
ryanbreen merged 1 commit intomainfrom
feat/real-cpuinfo
Feb 7, 2026
Merged

feat: real CPU detection for /proc/cpuinfo#169
ryanbreen merged 1 commit intomainfrom
feat/real-cpuinfo

Conversation

@ryanbreen
Copy link
Owner

Summary

  • Add x86_64 CPUID module (arch_impl/x86_64/cpuinfo.rs) that reads vendor ID, family/model/stepping, brand string, and feature flags from CPUID leaves 0/1/0x80000001-4
  • Add ARM64 system register module (arch_impl/aarch64/cpuinfo.rs) that reads MIDR_EL1, MPIDR_EL1, ID_AA64ISAR0/1_EL1, ID_AA64PFR0_EL1, and ID_AA64MMFR0_EL1 for implementer, part name, and feature detection
  • Update generate_cpuinfo() in procfs to use real detected values instead of hardcoded placeholders
  • Both architectures correctly detect their CPU: "QEMU Virtual CPU version 2.5+" on x86_64, "ARM Cortex-A72" on ARM64

Test plan

  • ARM64 build clean (zero warnings)
  • x86_64 build clean (zero warnings)
  • ARM64 boot test passed - [boot] CPU detected: ARM Cortex-A72
  • x86_64 boot test passed - CPU detected: QEMU Virtual CPU version 2.5+

🤖 Generated with Claude Code

Add CPUID-based detection on x86_64 and system register reads
(MIDR_EL1, ID_AA64ISAR0_EL1, ID_AA64PFR0_EL1, etc.) on ARM64 to
populate /proc/cpuinfo with real hardware data instead of hardcoded
placeholder values.

x86_64 now reports: vendor, family, model, stepping, brand string,
and feature flags derived from CPUID leaves 0/1/0x80000001-4.
ARM64 now reports: implementer, part name, variant, revision, and
feature flags derived from ID register fields.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ryanbreen ryanbreen merged commit ca0c871 into main Feb 7, 2026
1 of 2 checks passed
@ryanbreen ryanbreen deleted the feat/real-cpuinfo branch February 7, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant