Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FreeBSD][Apple] Implement fallback frequency calculation #251

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

er2off
Copy link

@er2off er2off commented Jul 4, 2024

This PR is a recreation of #232 because seems like @Dr-Noob is now ready to merge it.

Copy link

github-actions bot commented Jul 4, 2024

cpufetch does not accept pull requests, see the contributing guidelines for details

@github-actions github-actions bot closed this Jul 4, 2024
@Dr-Noob Dr-Noob reopened this Jul 4, 2024
@Dr-Noob
Copy link
Owner

Dr-Noob commented Jul 4, 2024

General question, why is this needed? Have you found a x86 CPU which does not get the frequency reported when using FreeBSD and macOS? Which CPU is that?

@er2off
Copy link
Author

er2off commented Jul 6, 2024

Which CPU is that?

For me it's AMD Ryzen 5 3500, it reports Can't read frequency information from cpuid (needed level is 0x00000016, max is 0x00000010).

@Dr-Noob
Copy link
Owner

Dr-Noob commented Jul 7, 2024

Which CPU is that?

For me it's AMD Ryzen 5 3500, it reports Can't read frequency information from cpuid (needed level is 0x00000016, max is 0x00000010).

I see, makes sense. Then please have a look at my review comment.

@er2off
Copy link
Author

er2off commented Jul 10, 2024

I see, makes sense. Then please have a look at my review comment.

Maybe I don't understood something but referenced commit nor next commits doesn't change anything for x86/amd64.

(kinda offtopic for this issue) BTW cpufetch doesn't work on ARM64 FreeBSD (because nobody ported) and u-boot doesn't expose many information about CPU, some related sysctls for rpi3b are

hw.fdt.compatible: raspberrypi,3-model-b brcm,bcm2837
hw.fdt.model: Raspberry Pi 3 Model B Rev 1.2
hw.machine: arm64
hw.model: ARM Cortex-A53 r0p4
hw.ncpu: 4
hw.byteorder: 1234
hw.machine_arch: aarch64

(neofetch on this platform simply says hw.model value which doesn't represent real cpu name)

@Dr-Noob
Copy link
Owner

Dr-Noob commented Jul 11, 2024

I see, makes sense. Then please have a look at my review comment.

Maybe I don't understood something but referenced commit nor next commits doesn't change anything for x86/amd64.

There is no visible change in x86. What changed is the fact that you can now include src/common/sysctl.h in src/x86/cpuid.c and use get_sys_info_by_name instead of sysctlbyname directly.

(kinda offtopic for this issue) BTW cpufetch doesn't work on ARM64 FreeBSD (because nobody ported) and u-boot doesn't expose many information about CPU, some related sysctls for rpi3b are

hw.fdt.compatible: raspberrypi,3-model-b brcm,bcm2837
hw.fdt.model: Raspberry Pi 3 Model B Rev 1.2
hw.machine: arm64
hw.model: ARM Cortex-A53 r0p4
hw.ncpu: 4
hw.byteorder: 1234
hw.machine_arch: aarch64

(neofetch on this platform simply says hw.model value which doesn't represent real cpu name)

Regarding what you mention about ARM64 in FreeBSD, if you have a proper error message from cpufetch please open an issue and we'll see what can be done to support it 👍 .

src/x86/cpuid.c Outdated Show resolved Hide resolved
src/x86/cpuid.c Outdated Show resolved Hide resolved
@Dr-Noob
Copy link
Owner

Dr-Noob commented Aug 3, 2024

Looks good to me! Please rebase and confirm this works for your hardware. If this is the case, I'll merge this into master shortly.

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.

None yet

2 participants